ai_mcp
Extends the MCP server with ERPNext-specific capabilities, including document CRUD across all business modules (Accounts, Stock, Selling, Buying, Manufacturing), KPI summaries, low-stock reordering, workflow actions, report execution, and exporting report data.
Provides tools for interacting with Frappe, enabling dynamic querying and management of DocTypes, schema operations, custom fields, document lifecycle, system health checks, and execution of whitelisted backend methods.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ai_mcpList all pending sales orders with their totals"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
🤖 AI MCP - Universal Dynamic MCP Server for Frappe & ERPNext v16
ai_mcp is a native Frappe application that packages an enterprise-grade dynamic Model Context Protocol (MCP) server for Frappe and ERPNext v16. It exposes 36 dynamic tools, FastMCP Resources, pre-built Prompts, Server-Sent Events (SSE) transport, and real-time Document Event Webhooks across all 816+ system DocTypes.
🌟 Enterprise Features
Single-Site & Multi-Site Single Install
Seamlessly installs on any Frappe site with standard
bench install-app ai_mcp. Auto-initializesAI MCP Settingsand exports fixtures out of the box.
Built-in Bench CLI Command
Run the server for any site directly via
bench --site <site-name> mcp-server --transport [stdio|sse].
816+ DocTypes Dynamic Operations
Query, fetch, create, update, bulk-update, and delete documents dynamically across all modules (Accounts, Stock, Selling, Buying, Manufacturing, Projects, Custom).
Role-Based Tool Permission Matrix
Restricts high-risk tools (
run_sql_query,delete_document,create_custom_field,bulk_update_documents) toSystem ManagerorAI Adminroles or explicitfrappe.has_permission()checks.
Rate-Limiting & Payload Truncation Guardrails
Redis-backed rate limiting (default 60 req/min) and automatic response payload truncation (default 100KB limit).
Asynchronous Non-Blocking Audit Logging
Offloads audit logging to background queues (
frappe.enqueue) to eliminate DB write overhead during tool execution.
FastMCP Resources & Prompts
Dynamic resources (
frappe://system-health/{site},frappe://kpi-summary/{site},frappe://doctypes/{site}) and AI business prompts (financial_summary_prompt,stock_reorder_prompt,procurement_audit_prompt).
Real-Time Document Webhooks
Document event triggers (
Purchase Order,Material Request) sending real-time webhooks to AI agents upon document submission.
Related MCP server: Frappe Assistant Core
🚀 Installation & Setup
1. Install App on Any Site
cd ~/frappe-bench
bench get-app ai_mcp # or local path / git repository
bench --site site1.local install-app ai_mcp2. Launch MCP Server for Any Site
Stdio Mode:
bench --site site1.local mcp-serverSSE Streaming Mode:
bench --site site1.local mcp-server --transport sse --port 8000🌐 REST API & SSE Endpoints
Endpoint | Method | Description |
|
| Execute any MCP tool over HTTP REST API. |
|
| List available tools and docstrings. |
|
| Get SSE connection URLs and streaming headers. |
🛠️ Complete MCP Tools Reference (36 Tools)
Tool Category | Function Name | Description |
Discovery & Schema |
| List active DocTypes filtered by module or search keyword. |
| Fetch complete schema definition, fieldtypes, and child tables. | |
| Map incoming/outgoing Link fields and child tables (ER-diagram). | |
Schema Building |
| Create custom field dynamically with |
| Adjust standard field properties without editing core files. | |
Universal CRUD |
| Query & list documents for any DocType with filters/sorting. |
| Fetch full record details for any document. | |
| Insert new document record for any DocType. | |
| Update fields on existing record. | |
| Bulk update multiple records in a single transaction (Restricted). | |
| Delete record for any DocType (Restricted). | |
| Parse & import base64-encoded CSV dataset. | |
Automation Bots |
| Scan low stock items and auto-create draft Material Requests. |
| Group Error Logs by method and optionally purge old logs. | |
| Detect duplicate column values for any DocType safely. | |
| Auto-apply 'Approve' action on Workflow-enabled documents. | |
KPIs & Finance |
| Compute receivables, monthly sales, pending orders, item count. |
| Get live/historical exchange rate between currencies. | |
Communications |
| Send email via queue or log to Communication DocType. |
| Attach base64 file or URL to any document record. | |
Transactions |
| Commit current DB transaction. |
| Roll back current DB transaction. | |
PDF & Printing |
| Render PDF/HTML preview for any document record. |
Search & Auth |
| Keyword search across global index. |
| Check user read/write/create/delete permissions. | |
| Autocomplete options for Link fields. | |
Methods & Background |
| Execute any |
| Enqueue background job to RQ workers with Redis fallback. | |
Lifecycle & Reports |
| Submit submittable document (docstatus 0 ➔ 1). |
| Cancel submitted document (docstatus 1 ➔ 2). | |
| Advance document state via Workflow action. | |
| Run built-in Frappe/ERPNext report. | |
| Export report directly to Excel (.xlsx) file. | |
| Check DB status, error logs, installed apps, scheduler. | |
| Get total record count for any DocType. | |
| Read-only SQL SELECT queries with injection guardrails (Restricted). |
mcp-erpnext
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
Alicense-qualityCmaintenanceAllows Frappe Framework apps to function as MCP servers, exposing Python-defined tools for LLM interaction.151MIT- Alicense-qualityAmaintenanceMCP 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.282AGPL 3.0
- Alicense-qualityDmaintenanceA comprehensive MCP server for ERPNext providing generic, doctype-agnostic access to any ERPNext document type with robust permission controls, audit logging, and enterprise-grade security.MIT
- Flicense-qualityBmaintenanceA robust, asynchronous Model Context Protocol (MCP) server that securely connects LLMs to your ERPNext instance (Self-Hosted or Frappe Cloud) via its REST API.
Related MCP Connectors
Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/renish-1111/mcp-erpnext'
If you have feedback or need assistance with the MCP directory API, please join our Discord server