Skip to main content
Glama
ERPNext Autonomous AI Operator MCP Server

ERPNext Autonomous AI Operator MCP Server

by Amirul78800

πŸš€ ERPNext Autonomous AI Operator (MCP Server)

Build and Publish Docker Image Docker Hub Docker Pulls License: MIT

An enterprise-ready Model Context Protocol (MCP) server built for ERPNext v15/v16. Designed to run as a multi-architecture Docker container (linux/amd64, linux/arm64) on TrueNAS SCALE, Docker Compose, Kubernetes, or any on-premise/cloud host, connecting directly to Antigravity AI, Claude, Cursor, or any MCP client over HTTP/SSE.


🌟 Capabilities

Domain

Available Operations

Safety Policy

Inventory & Master Data

Register Items, configure UOM & pricing, query real-time stock balances across warehouses, create Stock Entries

Live creation for items; Draft (docstatus=0) for stock movements

Sales & Purchasing

Generate Quotations, Purchase Orders, and Sales/Purchase Invoices

Draft-First (docstatus=0) β€” Requires human review before posting

CRM & Helpdesk

Create Leads, attach notes, log support tickets & issues

Immediate entry with audit attribution to Bot User

HRMS

Submit Leave Applications on behalf of employees

Submitted in Draft status

Universal Frappe Engine

Fetch (get_doc), list with filters (list_docs), dynamic record creation & updates

Safe reflection over all standard and custom Frappe DocTypes


Related MCP server: MCP Task

βš™οΈ Automated CI/CD Pipeline

This repository features an automated GitHub Actions workflow (.github/workflows/docker-publish.yml):

  • On Push to main: Automatically builds multi-architecture images (linux/amd64 and linux/arm64) using Docker Buildx and pushes to:

    • Docker Hub: amirul123/erpnext-mcp:latest

    • GitHub Packages: ghcr.io/amirul78800/erpnext-mcp:latest

  • On Semantic Release Tags (e.g. v1.0.0): Automatically tags and publishes immutable release versions.


πŸ› οΈ Step 1: Create the Dedicated Bot User in ERPNext

To maintain a clean audit log and adhere to least-privilege security:

  1. Log into your ERPNext instance (https://erp.example.com).

  2. Navigate to: Settings βž” Users βž” New User.

    • Email: ai.operator@example.com

    • First Name: AI Operator

    • Role Profile: Check System Manager (or customize granular roles: Stock Manager, Sales Manager, HR User, etc.).

    • Save the user.

  3. Scroll down to the API Access section on the user page:

    • Click Generate Keys.

    • Copy the API Secret immediately (it will only be shown once!).

    • Note down both the API Key and API Secret.


🚒 Step 2: Deploy Container (Docker Compose / TrueNAS SCALE)

In Arcane, Portainer, or your Docker Compose file, add the mcp-server service:

services:
  mcp-server:
    image: amirul123/erpnext-mcp:latest
    container_name: erpnext-mcp-server
    restart: unless-stopped
    ports:
      - "8000:8000"
    environment:
      # If on the same docker network as ERPNext, you can point to http://frontend:8080
      # Or your public/internal HTTPS URL:
      ERPNEXT_URL: "https://erp.example.com"
      ERPNEXT_API_KEY: "your_generated_api_key"
      ERPNEXT_API_SECRET: "your_generated_api_secret"
      ERPNEXT_VERIFY_SSL: "true"
      MCP_HOST: "0.0.0.0"
      MCP_PORT: "8000"

Start the container. The MCP Server-Sent Events (SSE) endpoint will be live at:

http://<HOST_IP>:8000/sse

⚑ Step 3: Connect Your AI Assistant (Antigravity / Claude / Cursor)

Add the MCP server configuration to your AI client's settings:

{
  "mcpServers": {
    "erpnext": {
      "url": "http://<HOST_IP>:8000/sse",
      "transport": "sse"
    }
  }
}

(Replace <HOST_IP> with your host's LAN or Tailscale IP).


πŸ’¬ Step 4: Example Natural Language Prompts

Once connected, your AI assistant can autonomously execute ERP operations:

1. Registering New Items

"Register a new Item: Stainless Steel Socket Head Cap Screw M4x16mm. Item code: FAST-M4-16, standard rate 0.45, stock UOM Nos, item group Hardware."

2. Checking Stock Balance

"Check the current stock balance for item FAST-M4-16 across all warehouses."

3. Creating a Sales Quote

"Create a draft quotation for customer 'Acme Corp' with 100 units of FAST-M4-16 at 0.45 each."

4. CRM & Customer Support

"Add a new lead: Alex Wong, phone +60123456789, email alex@example.com, interested in our manufacturing equipment."

5. HRMS Self-Service

"Submit a draft casual leave application for employee 'EMP-001' from 2026-12-01 to 2026-12-03."


πŸ™ Acknowledgements & References

This project builds upon the open-source efforts of the Frappe and AI ecosystems:


πŸ“„ License

This project is licensed under the MIT License.

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • 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
      Not graded
      quality
      D
      maintenance
      Integrates with ERPNext/Frappe API to enable AI assistants to interact with ERPNext data and create custom applications including DocTypes, workflows, scripts, and more.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to directly interact with ERPNext/Frappe business data and operations, including document management, submissions, cancellations, reports, PDF generation, file uploads, and whitelisted method calls, with per-request permission enforcement.
      MIT