Home / MCP / ERPNext MCP Server

ERPNext MCP Server

TypeScript MCP server that integrates ERPNext/Frappe API for AI-assisted ERP data access and actions.

typescript
Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
    "mcpServers": {
        "erpnext": {
            "url": "http://your-erpnext-instance.com"
        }
    }
}

You deploy this MCP server to bridge ERPNext data and capabilities with your AI assistants. It provides authenticated access to ERPNext documents, supports common document operations, and lets you run ERPNext reports through a consistent Model Context Protocol interface.

How to use

You interact with the ERPNext MCP server from an MCP client. Start by authenticating with ERPNext, then fetch documents, create or update records, run reports, or inspect DocTypes. Use the server’s standard endpoints to access ERPNext data via doctype names and document identifiers, or reference documents through ERPNext URIs like erpnext://{doctype}/{name} for direct access.

Recommended usage patterns include: authenticating once and reusing the session for subsequent tool calls, listing documents for a given doctype to understand available data, creating new items or customers, updating existing records, and invoking reports that your assistants can query to answer questions or perform actions within ERPNext.

How to install

Prerequisites you need installed on your machine or server: Node.js and npm, and a compatible TypeScript build setup. You should also have access to your ERPNext instance and its API credentials if you plan to use the HTTP connection.

Follow this step-by-step flow to prepare and run the MCP server locally or in your environment.

1) Install dependencies for the MCP server project.

2) Build the server to generate the runnable JS bundle.

3) Run the server or use the development watcher for auto-rebuild during development.

Additional sections

Configuration details and security notes help you run the ERPNext MCP server safely and effectively.

Environment variables you will use:

        Usage examples and configuration notes

        The server supports both HTTP-based remote access and local stdio execution. Use the HTTP method to connect to a remote ERPNext instance, or run a local stdio server that serves as the MCP endpoint.

        If you are configuring Claude Desktop or VSCode-based workflows, you will point your MCP client at the provided commands and environment entries shown in the examples.

        Tools and endpoints you can use

        The ERPNext MCP server exposes a set of tools to interact with ERPNext data and operations. You can authenticate, fetch documents, create and update documents, run reports, and query DocType fields.

        Available tools

        authenticate_erpnext

        Authenticate with ERPNext using a username and password to establish a session for subsequent operations.

        get_documents

        Retrieve a list of documents for a specific DocType, enabling you to browse data sets like Customer, Item, or Sales Invoice.

        create_document

        Create a new document in ERPNext with specified fields and values.

        update_document

        Update fields of an existing ERPNext document identified by its DocType and name.

        run_report

        Execute a predefined ERPNext report and obtain results for display or analysis.

        get_doctype_fields

        Get the list of fields for a specific DocType to understand data schema.

        get_doctypes

        Fetch a list of all available DocTypes in the ERPNext instance.