ERPNext MCP Server
Provides full read/write access to an ERPNext instance, with tools for querying and managing documents, inventory, manufacturing, sales, purchasing, BOMs, pricing, document lifecycle actions, server-side method calls, and reports.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ERPNext MCP Server Check stock levels for all components in BOM-COM-HALPI2-007"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ERPNext MCP Server
A Model Context Protocol server that connects MCP-compatible AI tools to ERPNext. It gives your AI assistant full read/write access to your ERPNext instance — inventory, manufacturing, sales, purchasing, and reporting — through natural language.
Originally forked from rakeshgangwar/erpnext-mcp-server. This fork adds API key authentication, minimal response optimization, and additional tools for document lifecycle management and server-side method calls.
What You Can Do
Once connected, you interact with ERPNext through natural conversation with your AI assistant. Here are examples from real-world usage:
Inventory & Stock
"Check stock levels for all components in the HALPI2 BOM — do we have enough to build 10 units?"
"Create a stock reconciliation to set the actual quantity of SOM-CM5108000 to 15 in Stores"
"Record a material receipt for the 200 PCBs we received from JLCPCB"
Manufacturing
"Complete work orders for the 8 HALPI2 units I assembled this week and create the manufacture stock entries"
"The open work orders reference obsolete BOMs with disabled components — cancel and amend them with the current default BOMs"
"Manufacture 5 units from work order MFG-WO-2026-00014, substituting CM5-lite modules for the standard ones"
Sales & Fulfillment
"Shopify orders #A2399 and #A2402 have been fulfilled — find the corresponding ERPNext sales orders and create delivery notes"
"Which fulfilled Shopify orders are missing delivery notes in ERPNext?"
Note: Cross-system workflows involving Shopify require a separate Shopify MCP server (e.g., shopify-mcp) running alongside this one. The AI assistant uses both servers together seamlessly.
BOMs & Products
"Update all active HALPI2 BOMs to replace the old enclosure sub-assembly with the new one"
"Show me the full component breakdown and cost for BOM-COM-HALPI2-007"
"Create a new 256GB NVMe SSD item variant under the existing template"
Purchasing
"The purchase order has the wrong item on line 4 — it should be SOM-CM5116016, not SOM-CM5116000. Fix the PO and the linked purchase receipt."
Pricing (with Shopify MCP)
"Update Shopify prices for all HALPI2 variants to reflect the new ERPNext base prices, adding 25.5% VAT"
"Set up a 20% sale on all HALPI2 variants with strikethrough pricing"
Reporting
"Run the Stock Balance report for the Stores warehouse"
"Find all active BOMs that still reference disabled items"
Related MCP server: Frappe Assistant Core
Prerequisites
Node.js 20+
An ERPNext instance with API access enabled
API key and secret — generate these in ERPNext under Settings > Users > [your user] > API Access > Generate Keys
Installation
Clone and build:
git clone https://github.com/hatlabs/erpnext-mcp-server.git
cd erpnext-mcp-server
npm install
npm run buildClaude Code
claude mcp add erpnext \
-e ERPNEXT_URL=https://your-erpnext.example.com \
-e ERPNEXT_API_KEY=your-api-key \
-e ERPNEXT_API_SECRET=your-api-secret \
-- node /path/to/erpnext-mcp-server/build/index.jsClaude Desktop
Open Settings > Developer > Edit Config and add the erpnext entry under mcpServers:
{
"mcpServers": {
"erpnext": {
"command": "node",
"args": ["/path/to/erpnext-mcp-server/build/index.js"],
"env": {
"ERPNEXT_URL": "https://your-erpnext.example.com",
"ERPNEXT_API_KEY": "your-api-key",
"ERPNEXT_API_SECRET": "your-api-secret"
}
}
}
}Other MCP Clients
Any MCP-compatible client can use this server. It communicates over stdio and requires three environment variables:
Variable | Description |
| Base URL of your ERPNext instance |
| API key for authentication |
| API secret for authentication |
Tools
The server exposes 10 tools that the AI client discovers automatically through MCP:
Tool | Description |
| List all available DocTypes |
| Get field definitions for a DocType |
| Query documents with filters and field selection |
| Get a single document by name, including all child tables |
| Create a new document |
| Update an existing document |
| Submit a document (set docstatus to 1) |
| Cancel a submitted document (set docstatus to 2) |
| Call a whitelisted server-side API method |
| Run an ERPNext report |
Development
npm install # Install dependencies
npm run build # Compile TypeScript
npm run watch # Auto-rebuild on changes
npm run lint # Run linter
npm run format:check # Check formatting
npm run inspector # Launch MCP Inspector for debuggingThe MCP Inspector opens a browser-based UI for testing tool calls interactively.
Available Tools
11 toolscall_methodA
Call an ERPNext/Frappe whitelisted server-side API method. WARNING: This can invoke any whitelisted method including destructive operations — use with caution. Args are passed as JSON body (POST) or query params (GET), with keys matching the method's parameter names.
Inputs: method (required), args, http_method.
cancel_documentA
Cancel a submitted document (set docstatus to 2). Cancelled documents cannot be modified — use amend workflow to create a corrected copy.
Inputs: name (required), doctype (required).
create_documentB
Create a new document in ERPNext
Inputs: data (required), doctype (required).
get_child_documentsA
Query child table rows by joining parent and child DocTypes. Direct child table queries return 403; this tool queries the parent DocType with child table field joins. Returns one row per matching child table row.
Inputs: child_doctype (required), parent_doctype (required), limit, child_fields, +3 more.
get_doctype_fieldsA
Get field definitions for a specific DocType from ERPNext metadata. Returns fieldname, fieldtype, label, options, and reqd for each field.
Inputs: doctype (required).
get_doctypesA
Get a list of all available DocTypes
Inputs: no named parameters.
get_documentA
Get a single document by DocType and name, including child tables. Response is automatically stripped of system metadata and null/default fields. Use 'fields' to select specific top-level fields, and 'child_fields' to select fields within child tables. 'name', 'docstatus', and 'status' are always included.
Inputs: name (required), doctype (required), fields, child_fields.
get_documentsB
Get a list of documents for a specific doctype. ERPNext defaults to 20 results if no limit is specified.
Inputs: doctype (required), limit, fields, filters.
run_reportC
Run an ERPNext report
Inputs: report_name (required), filters.
submit_documentA
Submit a document (set docstatus to 1). This is irreversible — submitted documents can only be cancelled, not reverted to draft.
Inputs: name (required), doctype (required).
update_documentC
Update an existing document in ERPNext
Inputs: data (required), name (required), doctype (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Most tools are clearly separated by resource and action: metadata lookup, document list/single fetch, child-table query, create/update, and lifecycle actions are distinct. The main ambiguity is call_method, which is intentionally generic and could overlap with nearly every specialized tool, though its warning and description make that risk explicit.
All tool names use consistent snake_case and a predictable verb-first pattern such as get_document, create_document, update_document, submit_document, and cancel_document. The few variations like run_report and get_doctypes still fit the same readable convention.
Eleven tools is well-scoped for an ERPNext server: enough to cover metadata discovery, document CRUD-style operations, lifecycle transitions, reports, and generic API access without excessive fragmentation.
The surface covers core ERPNext workflows including metadata inspection, listing, single-document retrieval, creation, updates, child-table querying, submission/cancellation, reports, and generic method calls. Minor gaps remain around draft deletion and report discovery/metadata, but agents can work around most of these.
Maintenance
Related MCP Connectors
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
Connect any AI agent to 1,000+ apps and 27,000+ actions through one remote MCP server (OAuth).
Connect Exact Online to your AI assistant via MCP. Manage Exact Online with natural language.
Connect AI clients to your Dactic work context through a hosted MCP service.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI assistants to interact with ERPNext/Frappe instances through the REST API, allowing document management, report execution, and DocType operations using natural language.6MIT
- AlicenseNot gradedqualityAmaintenanceMCP server that enables LLMs to interact with ERPNext/Frappe sites for document CRUD, search, reports, workflows, and analytics, respecting user permissions and logging all actions.337AGPL 3.0
- AlicenseBqualityDmaintenanceIntegrates with ERPNext/Frappe API to enable AI assistants to create, read, update, and list documents, run reports, and authenticate via the Model Context Protocol.6MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with ERPNext data and functionality through the Model Context Protocol, including document CRUD, report running, and API method calls.MIT