Skip to main content
Glama
erpnext-fast-mcp-server

erpnext-fast-mcp-server

by sppandita85

erpnext-fast-mcp-server

A FastMCP server that exposes generic ERPNext / Frappe DocType operations as MCP tools, so any MCP-compatible client (Claude Desktop, Claude Code, etc.) can read and write data in an ERPNext site over its REST API.

Tools

  • get_document(doctype, name) — fetch a single document

  • list_documents(doctype, filters, fields, order_by, limit, limit_start) — search/list documents

  • create_document(doctype, data) — create a document

  • update_document(doctype, name, data) — update fields on a document

  • delete_document(doctype, name) — delete a document

  • get_doctype_meta(doctype) — fetch a DocType's field/schema definition

  • get_count(doctype, filters) — count documents matching filters

  • run_report(report_name, filters) — run a Query/Script report

These are generic, so they work against any DocType (Customer, Sales Invoice, Item, Stock Entry, etc.) without hardcoding business objects.

Related MCP server: Frappe Assistant Core

Setup

  1. Install dependencies (using uv):

    uv sync
  2. Get API credentials from your Frappe/ERPNext site: User → API Access → Generate Keys. Copy the API Key and API Secret shown (the secret is only displayed once).

  3. Copy .env.example to .env and fill in your values:

    cp .env.example .env
    FRAPPE_URL=https://your-site.frappe.cloud
    FRAPPE_API_KEY=your-api-key
    FRAPPE_API_SECRET=your-api-secret

    .env is git-ignored — never commit real credentials.

  4. Run the server directly to check it starts:

    uv run erpnext-mcp

Using with Claude Desktop / Claude Code

Add to your MCP client config (e.g. claude_desktop_config.json):

{
  "mcpServers": {
    "erpnext": {
      "command": "uv",
      "args": ["run", "--directory", "/absolute/path/to/erpnext-fast-mcp-server", "erpnext-mcp"],
      "env": {
        "FRAPPE_URL": "https://your-site.frappe.cloud",
        "FRAPPE_API_KEY": "your-api-key",
        "FRAPPE_API_SECRET": "your-api-secret"
      }
    }
  }
}

Alternatively, keep credentials only in .env (not in the client config) and omit the env block above — python-dotenv will load .env from the project directory at startup.

Security notes

  • Never commit .env or hardcode API keys/secrets in source.

  • Scope the Frappe user's role/permissions to the minimum needed — the MCP tools inherit whatever permissions the API key's user has on the site.

  • delete_document is irreversible; consider removing it from the tool list if you don't want an MCP client to be able to delete records.

Available Tools

8 tools
create_documentA

Create a new document of the given DocType.

data: field values for the new document, e.g. {"customer_name": "Acme Corp"}.

Inputs: data (required), doctype (required). Returns: object

delete_documentA

Permanently delete a document. This cannot be undone.

Inputs: name (required), doctype (required). Returns: object

get_countB

Count documents of a DocType, optionally matching filters.

Inputs: doctype (required), filters. Returns: result

get_doctype_metaA

Fetch the field/schema definition (metadata) for a DocType.

Useful for discovering what fields exist before create_document/update_document calls.

Inputs: doctype (required). Returns: object

get_documentA

Fetch a single document by DocType and name (primary key).

Example: get_document("Customer", "CUST-0001")

Inputs: name (required), doctype (required). Returns: object

list_documentsA

List/search documents of a DocType.

filters: Frappe filter syntax, e.g. [["status", "=", "Open"]] or {"status": "Open"}. fields: list of fieldnames to return, e.g. ["name", "customer_name"]. Defaults to ["name"]. order_by: e.g. "creation desc". limit: max rows to return (default 20). limit_start: offset for pagination.

Inputs: doctype (required), limit, fields, filters, +2 more. Returns: result

run_reportB

Run a Frappe/ERPNext Query or Script Report and return its result.

Inputs: report_name (required), filters. Returns: object

update_documentB

Update fields on an existing document.

data: field values to change, e.g. {"status": "Closed"}.

Inputs: data (required), name (required), doctype (required). Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 8 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: CRUD operations (list, create, get, update, delete), metadata inspection, counting, and report execution. There is no overlap or ambiguity between them.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern: list_documents, create_document, get_document, update_document, delete_document, get_doctype_meta, get_count, run_report. The use of singular for single-document operations and plural for listing is a sensible convention.

    Tool Count5/5

    8 tools is well-scoped for a document management server. Each tool covers a necessary operation without redundancy or bloat, fitting comfortably within the ideal range.

    Completeness5/5

    The tool set provides full CRUD lifecycle coverage for any DocType, plus useful supplementary tools for metadata discovery, counting, and running reports. There are no critical gaps in the core document workflows.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables interaction with ERPNext instances via its REST API to manage documents, inventory, and reports. It supports full CRUD operations, submittable document workflows, and schema inspection through natural language.
      28
      2
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      MCP 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.
      337
      AGPL 3.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server that enables Claude, ChatGPT, and other LLMs to interact with ERPNext sites through natural language, supporting document CRUD, search, reports, workflows, and custom tools, while respecting user permissions and logging all calls.
      AGPL 3.0
    • A
      license
      A
      quality
      D
      maintenance
      Connects MCP-compatible AI assistants to an ERPNext instance through the official Frappe API, enabling natural-language read/write access to inventory, manufacturing, sales, purchasing, reporting, and document lifecycle operations.
      11
      2
      MIT