Frappe MCP Server
Enables AI models to securely interact with Frappe Framework/ERPNext instances, supporting document CRUD, RPC methods, file management, workflows, reporting, and more via the Model Context Protocol.
README
Frappe MCP Server (Full Roadmap Implementation)
A Model Context Protocol (MCP) Server for the Frappe Framework / ERPNext, built using the @modelcontextprotocol/sdk and powered by the frappe-js-sdk client.
This server enables AI models (like Claude) to securely interact with your Frappe instances, perform document CRUD, execute whitelisted python RPC methods, upload/download files, manage workflows, run query/script reports, check background job queues, listen to realtime socket events, and generate PDFs.
📂 Features Checklist
- Phase 1: Document Tools: Create, retrieve, update, delete, paginated listing, counting, field-level get/set, document renaming, single DocTypes, and document submit/cancel actions.
- Phase 2: RPC Method Calling: Call any whitelisted method path, with optimized wrappers for search autocomplete link fields, report list views, and form schemas.
- Phase 3: File Manager: File uploads (via base64 or remote URL downloads), listing attachments, downloading files (retrieved as base64), and file record deletion.
- Phase 4: Auth & Session Swapping: Session login/logout, profile checks, permission lookups, and dynamic credentials swapping (
switch_user). - Phase 5: Workflow Engine: Document workflow state queries, action list queries, applying workflow transitions, and retrieving workflow log history.
- Phase 6: Reporting & Analytics: Running Query/Script reports with custom filters, exporting reports directly to CSV strings, and retrieving dashboard charts or number card values.
- Phase 7: Background Jobs: Checking job queues, listing job log entries, and forcing enqueued task execution.
- Phase 8: Advanced Integrations: Listening to Socket.io realtime events (emitted to stderr logs), publishing realtime events, retrieving unread bell notifications, rendering HTML print formats, generating binary PDFs (returned as base64), batch bulk edits, enqueuing data imports/exports, downloading templates, and mailing/logging emails.
- Phase 9: MCP Resource & Prompt Protocols:
- Resources: Dynamic URIs like
schema://{doctype},schema://{doctype}/fields,data://{doctype}/{name},report://{report_name},workflow://{doctype}, anduser://me. - Prompts: Ready-to-use AI templates for Sales Orders, approvals, monthly reports, and employee onboarding.
- Resources: Dynamic URIs like
⚙️ Configuration
Create a .env file in the root directory (refer to .env.example):
# Frappe Server URL (required)
FRAPPE_URL=https://your-frappe-instance.frappe.cloud
# --- Authentication Choices (Pick ONE) ---
# Choice A: API Key & Secret (Recommended for servers/backends)
FRAPPE_API_KEY=your_api_key
FRAPPE_API_SECRET=your_api_secret
# Choice B: OAuth Bearer Token
FRAPPE_TOKEN=your_token
FRAPPE_TOKEN_TYPE=Bearer
# Choice C: Username & Password (Session cookie)
FRAPPE_USERNAME=administrator
FRAPPE_PASSWORD=admin_password
# --- Logging ---
# log levels: debug, info, warn, error
LOG_LEVEL=info
🚀 Commands
To run in development mode (auto-rebuilding):
npm run dev
To compile and bundle for production (outputs to dist/index.js):
npm run build
To run the unit test suite:
npm run test
To run the compiled production bundle:
npm run start
🧪 How to Test
1. Run Automated Unit Tests
We use Vitest to run tests that mock the SDK calls to verify tool schemas, input parameter validation, routing, resource templates, and prompt builders:
npm run test
2. Test Manually with MCP Inspector (Recommended)
You can visually interact with the server, list resources, view prompts, and run tools using the official MCP Inspector tool.
To run the inspector on the dev server:
npx -y @modelcontextprotocol/inspector npx tsx src/index.ts
To run the inspector on the compiled production build:
npx -y @modelcontextprotocol/inspector node dist/index.js
This will output an URL (typically http://localhost:5173) that you can open in your browser to test calling all the tools (like list_documents or call_method) with mock or real inputs.
🔌 Integration with Claude Desktop
To connect this server to your Claude Desktop application, edit your claude_desktop_config.json (located at %APPDATA%\Claude\claude_desktop_config.json on Windows or ~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"frappe-mcp": {
"command": "node",
"args": [
"F:/MCP/frappe js mcp/dist/index.js"
],
"env": {
"FRAPPE_URL": "https://your-frappe-instance.frappe.cloud",
"FRAPPE_API_KEY": "your_api_key",
"FRAPPE_API_SECRET": "your_api_secret",
"LOG_LEVEL": "info"
}
}
}
}
[!IMPORTANT]
- Ensure you run
npm run buildinsideF:/MCP/frappe js mcpfirst so thatdist/index.jsexists.- Replace
"F:/MCP/frappe js mcp/dist/index.js"with the absolute path of your workspace.- Restart Claude Desktop after making configuration changes.
🐳 Docker Deployment
The project includes a multi-stage Dockerfile and docker-compose.yml to compile and containerize the server.
To build the image and run it in a container:
docker compose -f docker/docker-compose.yml up --build -d
The compose config maps environment variables directly into the service.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。