ERPNext MCP Server

ERPNext MCP Server

MCP server for ERPNext that provides full CRUD operations, workflow management, custom fields, and DocType management.

Category
Visit Server

README

ERPNext MCP Server

MCP (Model Context Protocol) Server for ERPNext with full CRUD operations, workflow management, custom fields, and DocType management.

Built with MCP SDK 1.25.1 - the latest stable version.

Features

Document Operations

  • get_document - Get a single document by DocType and name
  • get_documents - List documents with filtering, field selection, and pagination
  • create_document - Create new documents
  • update_document - Update existing documents
  • delete_document - Delete documents
  • submit_document - Submit submittable documents (Draft → Submitted)
  • cancel_document - Cancel submitted documents

DocType Management

  • get_doctypes - List all available DocTypes
  • get_doctype_fields - Get field definitions for a DocType
  • get_doctype_meta - Get complete DocType metadata
  • create_doctype - Create new custom DocTypes
  • add_doctype_field - Add fields to existing DocTypes
  • create_custom_field - Create custom fields (survives updates)
  • create_property_setter - Override DocType/field properties

Workflow Management

  • get_workflow - Get active workflow for a DocType
  • create_workflow - Create new workflows with states and transitions
  • update_workflow - Update existing workflows

Reports

  • run_report - Execute ERPNext reports with filters

Authentication

  • authenticate_erpnext - Authenticate with username/password (alternative to API key)

Installation

npm install @kai-oesterling/erpnext-mcp-server

Or clone and build:

git clone https://github.com/Kai-Oesterling/erpnext-mcp-server.git
cd erpnext-mcp-server
npm install
npm run build

Configuration

Set environment variables:

export ERPNEXT_URL=https://erp.example.com
export ERPNEXT_API_KEY=your_api_key
export ERPNEXT_API_SECRET=your_api_secret

# Optional: Enable debug logging
export ERPNEXT_DEBUG=true

Creating API Keys in ERPNext

  1. Go to User settings in ERPNext
  2. Navigate to "API Access" section
  3. Generate new API Key and Secret
  4. Use these credentials in environment variables

Usage

With Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "erpnext": {
      "command": "node",
      "args": ["/path/to/erpnext-mcp-server/build/index.js"],
      "env": {
        "ERPNEXT_URL": "https://erp.example.com",
        "ERPNEXT_API_KEY": "your_api_key",
        "ERPNEXT_API_SECRET": "your_api_secret"
      }
    }
  }
}

With MCP Inspector

npx @modelcontextprotocol/inspector node build/index.js

Standalone

npm start

Development

# Watch mode
npm run watch

# Run with tsx (no build needed)
npm run dev

# Build
npm run build

Error Handling

This server includes detailed error extraction from ERPNext responses:

  • Parses _server_messages for validation errors
  • Extracts exception details from ERPNext responses
  • Provides meaningful HTTP status messages
  • Includes debug logging when ERPNEXT_DEBUG=true

Resources

The server also exposes MCP resources:

  • erpnext://DocTypes - List all available DocTypes
  • erpnext://{doctype}/{name} - Access individual documents

License

MIT

Author

Kai Oesterling kai@oesterling.org

Credits

Based on the original erpnext-mcp-server by Rakesh Gangwar. Extended with workflows, custom fields, DocType creation, and improved error handling.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured