Skip to main content
Glama

ERPNext MCP Server

Model Context Protocol (MCP) server for ERPNext/Frappe REST API

This is a TypeScript-based MCP server that lets AI assistants interact with an ERPNext/Frappe instance via MCP tools and resources.

Features

Resources

  • Read any ERPNext document via erpnext://{doctype}/{name}

  • List available DocTypes via erpnext://DocTypes

Tools

  • get_doctypes - Get a list of all available DocTypes

  • get_doctype_fields - Get a best-effort field list for a DocType (derived from a sample record)

  • get_documents - Get a list of documents for a specific doctype

  • create_document - Create a new document in ERPNext

  • update_document - Update an existing document in ERPNext

  • run_report - Run an ERPNext report

Related MCP server: MCP Task

Configuration

The server requires the following environment variables:

  • ERPNEXT_URL - The base URL of your ERPNext instance

  • ERPNEXT_API_KEY - API key for authentication

  • ERPNEXT_API_SECRET - API secret for authentication

Note: This server currently expects API token auth. Username/password auth is not implemented.

Development

Install dependencies:

npm install

Build the server:

npm run build

For development with auto-rebuild:

npm run watch

Installation

To use with Claude Desktop, add the server config:

On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json On Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "erpnext": {
      "command": "node",
      "args": ["/path/to/erpnext-mcp-server/build/index.js"],
      "env": {
        "ERPNEXT_URL": "http://your-erpnext-instance.com",
        "ERPNEXT_API_KEY": "your-api-key",
        "ERPNEXT_API_SECRET": "your-api-secret"
      }
    }
  }
}

To use with Claude in VSCode, add the server config to:

On MacOS: ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json On Windows: %APPDATA%/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

Debugging

Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:

npm run inspector

The Inspector will provide a URL to access debugging tools in your browser.

Usage Examples

Get Customer List

<use_mcp_tool>
<server_name>erpnext</server_name>
<tool_name>get_documents</tool_name>
<arguments>
{
  "doctype": "Customer"
}
</arguments>
</use_mcp_tool>

Get Customer Details

<access_mcp_resource>
<server_name>erpnext</server_name>
<uri>erpnext://Customer/CUSTOMER001</uri>
</access_mcp_resource>

Create New Item

<use_mcp_tool>
<server_name>erpnext</server_name>
<tool_name>create_document</tool_name>
<arguments>
{
  "doctype": "Item",
  "data": {
    "item_code": "ITEM001",
    "item_name": "Test Item",
    "item_group": "Products",
    "stock_uom": "Nos"
  }
}
</arguments>
</use_mcp_tool>

Get Item Fields

<use_mcp_tool>
<server_name>erpnext</server_name>
<tool_name>get_doctype_fields</tool_name>
<arguments>
{
  "doctype": "Item"
}
</arguments>
</use_mcp_tool>

Available Tools

6 tools
create_documentB

Create a new document in ERPNext

ParametersJSON Schema
NameRequiredDescriptionDefault
doctypeYesERPNext DocType (e.g., Customer, Item)
dataYesDocument data

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It only states that a new document is created; it does not disclose side effects, permissions needed, error behavior, or whether the created document is returned. This is a significant gap for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with no wasted words. It is front-loaded with the verb and resource, making it easy to scan. However, it is somewhat under-specified, so it loses a point for completeness even though the conciseness itself is good.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema and a nested object parameter, the description leaves important context unexplained. It does not mention what the 'data' object should contain, which doctypes are supported, or what the response looks like. This is inadequate for a tool that creates resources.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already provides 100% coverage for both parameters (doctype and data) with descriptions. The tool description adds no extra parameter meaning, so the baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Create') and resource ('a new document in ERPNext'), which distinguishes it from sibling tools like update_document and get_documents. It is specific enough to convey the core purpose, though it could add a bit more scope detail such as requiring a doctype.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for creating new documents but gives no explicit guidance on when to choose this over alternatives, nor any exclusions. There is no mention of scenarios where update_document might be more appropriate or of prerequisites for creation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_doctype_fieldsB

Get fields list for a specific DocType

ParametersJSON Schema
NameRequiredDescriptionDefault
doctypeYesERPNext DocType (e.g., Customer, Item)

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of behavioral disclosure. It only states the raw action without mentioning whether the operation is read-only, what the response contains, or any authentication/error behavior. This is a minimal disclosure with no behavioral context beyond the action itself.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence that front-loads the verb and object. Every word earns its place, and there is no redundancy or filler. It is appropriately sized for the tool's simplicity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple one-parameter tool, the description is adequate but has gaps. It does not specify what the returned fields list includes (e.g., field names, types, required flags) or explain error handling for invalid doctypes. With no output schema, the description could benefit from a brief note on return structure, but the core purpose is clear.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% (the 'doctype' parameter has a clear description). The description does not add any additional parameter meaning beyond the schema, but it also doesn't need to since the schema fully explains the parameter. Baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb+resource construction: 'Get fields list for a specific DocType'. This clearly distinguishes it from sibling tools like get_doctypes (which lists doctypes) and get_documents (which retrieves document data). The scope is well-defined.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description offers no guidance on when to use this tool versus alternatives. It implicitly implies use when needing fields of a specific doctype, but does not state any exclusions or mention sibling tools. No explicit context or prerequisites are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_doctypesA

Get a list of all available DocTypes

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must carry the behavioral burden. It clearly indicates a read operation ('Get') with no side effects, but it does not disclose potential nuances like authentication requirements, whether custom DocTypes are included, or the exact return structure. This is adequate for a simple list operation but leaves room for ambiguity.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no filler. It communicates the essential purpose efficiently.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (no parameters, no output schema), the description is mostly complete. However, it does not specify the return format (e.g., array of names vs. objects) or any sorting/ordering, which could be ambiguous for an agent. Still, it is sufficient for a basic listing tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so there is no need for parameter descriptions. The baseline of 4 applies as the description does not need to compensate for schema gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Get a list') and clearly identifies the resource ('all available DocTypes'). It is distinct from sibling tools like get_doctype_fields or get_documents, which operate on different entities.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. It does not mention, for example, using get_doctype_fields to explore fields of a specific DocType, or that this is a precursor to fetching documents. The usage context is implied but not explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_documentsA

Get a list of documents for a specific doctype

ParametersJSON Schema
NameRequiredDescriptionDefault
doctypeYesERPNext DocType (e.g., Customer, Item)
fieldsNoFields to include (optional)
filtersNoFilters in the format {field: value} (optional)
limitNoMaximum number of documents to return (optional)

TDQS

A3.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden for behavioral disclosure. It only states a basic listing operation and does not mention read-only nature, pagination, sorting, return format, or any side effects. The agent cannot predict behavior beyond the name.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence that is efficient and free of unnecessary words. It communicates the core purpose without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 4 parameters, a nested filters object, no output schema, and no annotations, the description is too sparse. It does not explain list behavior, filtering interplay, pagination, or return structure, leaving the agent under-informed for a tool of this complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema itself documents all parameters adequately. The description adds no extra meaning beyond the schema (e.g., 'for a specific doctype' merely restates the doctype parameter). Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Get') and resource ('a list of documents') with a clear qualifier ('for a specific doctype'). This directly contrasts with sibling tools like get_doctypes and get_doctype_fields, making the tool's purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'for a specific doctype' implies usage context and helps distinguish from sibling tools, but there is no explicit when-to-use or when-not-to-use guidance. It is clear enough for an agent to select this tool over alternatives, but lacks explicit exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

run_reportC

Run an ERPNext report

ParametersJSON Schema
NameRequiredDescriptionDefault
report_nameYesName of the report
filtersNoReport filters (optional)

TDQS

C2.7/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full responsibility for behavioral disclosure. It only says 'Run an ERPNext report,' offering no information about side effects, read-only nature, required permissions, or output characteristics. The lack of any behavioral context makes it nearly useless for understanding tool behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no wasted words. It is efficient, though arguably under-specified. Given the minimal detail required for a two-parameter tool, this level of conciseness is acceptable, but it could be expanded slightly without losing clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has no output schema and no annotations, and the description is too brief to convey essential context such as what the report returns, how filters are used, or any constraints. The parameter schema covers the 'what' but not the 'how' or expected behavior, making the description insufficient for an agent to use it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has descriptions for both parameters ('Report filters (optional)' and 'Name of the report'), achieving 100% coverage. The description itself adds no additional parameter information, so it neither helps nor hurts. The baseline of 3 is appropriate since the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb 'Run' and a resource 'ERPNext report', which distinguishes it from sibling tools that deal with doctypes and documents. However, it lacks detail on what 'run' entails (e.g., returning data), making it clear but slightly under-specified.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this tool versus alternatives. The sibling tools are about document operations, so it is implied this is for reports, but no explicit context, prerequisites, or exclusions are provided. The description simply states what it does, not when to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

update_documentC

Update an existing document in ERPNext

ParametersJSON Schema
NameRequiredDescriptionDefault
doctypeYesERPNext DocType (e.g., Customer, Item)
nameYesDocument name/ID
dataYesDocument data to update

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It implies mutation but does not disclose whether updates are partial or full replacements, idempotency, error behavior, or required permissions. This is a significant gap for a write operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence that front-loads the verb and resource. It is appropriately short but could be easily expanded with key details without losing brevity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has three required parameters, a nested data object, and no output schema, the description is too sparse. It does not explain return values, partial update behavior, or how the data object should be structured beyond the schema. The description is inadequate for a mutation tool without annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% coverage, with clear descriptions for each parameter (doctype, name, data). The description adds no additional parameter-level meaning, so the baseline of 3 is appropriate since the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the specific verb 'Update' and resource 'existing document in ERPNext,' which clearly distinguishes it from sibling tools like create_document or get_documents. However, it lacks detail on what kind of document or which fields can be updated, but it is not misleading.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is given on when to use this tool versus alternatives. It does not explain prerequisites, differences from create_document, or any exclusions. The description simply states the operation without context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 6 tool updates
    • First observedcreate_document
    • First observedget_doctype_fields
    • First observedget_doctypes
    • First observedget_documents
    • First observedrun_report
    • First observedupdate_document

TDQS

B3.4/5.0

Scored across 6 tools

Disambiguation5/5

Each tool has a clearly distinct purpose with no overlap: create_document and update_document handle document lifecycle operations, get_doctypes and get_doctype_fields provide metadata, get_documents retrieves document lists, and run_report executes reports. The descriptions reinforce these distinct roles, making misselection unlikely.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern using snake_case, such as create_document, get_doctypes, and update_document. This predictability makes the tool set easy to navigate and understand, with no deviations in naming style.

Tool Count5/5

With 6 tools, the server is well-scoped for ERPNext operations, covering core document management, metadata access, and reporting. Each tool serves a specific function without redundancy, making the count appropriate for the domain's typical needs.

Completeness4/5

The tool set provides strong coverage for document CRUD (create, get, update) and metadata access, with run_report adding reporting functionality. A minor gap exists in document deletion, which could limit full lifecycle management, but agents can likely work around this omission.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Allows AI assistants to interact with Frappe applications through the official REST API, enabling document CRUD operations, schema handling, and detailed API instructions.
    164 npm
    2
    ISC
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables LLMs to interact with any ERPNext instance through comprehensive CRUD operations, advanced permissions, and a web chat interface.
    1
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    Integrates with ERPNext/Frappe API to enable AI assistants to create, read, update, and list documents, run reports, and authenticate via the Model Context Protocol.
    6
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI assistants to interact with ERPNext data and functionality through the Model Context Protocol, including document CRUD, report running, and API method calls.
    MIT