Provides comprehensive access to ERPNext ERP system with generic, doctype-agnostic CRUD operations, search and filtering capabilities, dynamic schema discovery, and enterprise-grade security features including multi-layer permission controls and audit logging.
ERPNext MCP Server
A comprehensive Model Context Protocol (MCP) server for ERPNext that provides generic, doctype-agnostic access to any ERPNext document type with robust permission controls, audit logging, and enterprise-grade security.
🏗️ Architecture Overview
Core Components
- 🔧 Generic Client: Works with any ERPNext doctype (Customer, Item, Sales Order, etc.)
- 🛡️ Permission System: Multi-layer access control with field-level restrictions
- 📊 Audit System: Comprehensive logging of all operations
- ⚡ Performance: Built-in caching and rate limiting
- 🔍 Discovery: Dynamic tool generation based on configured doctypes
🚀 Quick Start
1. Installation
2. Configuration
Create config/config.json
:
3. Run Server
🔐 Permission Model
Multi-Layer Security Architecture
The permission system operates on four security layers:
1. Operation-Level Permissions
2. Field-Level Access Control
3. Conditional Validation
4. Audit & Monitoring
Permission Examples
Restrictive Configuration (Read-only analyst)
Operational Configuration (Sales user)
🛠️ Available Tools & Usage
System Tools
test_connection
Test ERPNext server connectivity
list_doctypes
Show all configured doctypes and permissions
get_doctype_permissions
Get detailed permissions for specific doctype
Generic Document Operations
get_generic_document
Get any document by doctype and name
list_generic_documents
List documents for any doctype with filters
create_generic_document
Create document for any doctype
Doctype-Specific Tools
For each configured doctype, the server automatically generates:
list_{doctype}_documents
- List documentsget_{doctype}_document
- Get specific documentsearch_{doctype}_documents
- Search documentscreate_{doctype}_document
- Create new documentupdate_{doctype}_document
- Update documentdelete_{doctype}_document
- Delete document (if permitted)
Example Usage with Claude
Data Analysis
→ Uses list_customer_documents
with filters
Data Entry
→ Uses create_customer_document
with validation
Information Retrieval
→ Uses get_sales_invoice_document
Search & Discovery
→ Uses search_item_documents
Environment Variables
🔒 Security Considerations
Authentication
- Uses ERPNext API Key/Secret authentication
- No passwords stored in configuration
- Supports ERPNext user-level permissions
Generate API Key & Secret
- Click on "Generate Keys" or "Add API Key"
- Set appropriate permissions for the API user:
- User: Select or create a dedicated API user
- Roles: Assign necessary permissions (e.g., "System Manager", "Sales Manager")
Network Security
- HTTPS-only connections to ERPNext
- Configurable request timeouts
- Connection pooling with limits
Audit Trail
All operations are logged with:
- Timestamp and user context
- Operation type and target doctype
- Success/failure status and reasons
- Data accessed/modified (field names only)
- IP address and session information
Example audit log:
🧪 Testing & Validation
Test Connection
Validate Permissions
🏃♂️ Deployment
Claude Desktop Integration
Add to claude_desktop_config.json
:
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables comprehensive interaction with ERPNext systems through natural language, providing secure access to any document type (customers, items, invoices, etc.) with enterprise-grade permission controls and audit logging.