
A server that implements the Anthropic Model Control Protocol (MCP) server for accessing Frappe.
概览
A Model Context Protocol (MCP) server for Frappe Framework that exposes Frappe's functionality to AI assistants through the official REST API, with a focus on document CRUD operations, schema handling, and detailed API instructions. This MCP server allows AI assistants to interact with Frappe applications through a standardized interface using the official Frappe REST API. It provides tools for: - Document operations (create, read, update, delete, list) - Schema and metadata handling - DocType discovery and exploration - Detailed API usage instructions and examples The server includes comprehensive error handling, validation, and helpful responses to make it easier for AI assistants to work with Frappe. - Node.
README
以下为原文 README 节选,完整内容请查看原文。
Frappe MCP Server
A Model Context Protocol (MCP) server for Frappe Framework that exposes Frappe’s functionality to AI assistants through the official REST API, with a focus on document CRUD operations, schema handling, and detailed API instructions.
Overview
This MCP server allows AI assistants to interact with Frappe applications through a standardized interface using the official Frappe REST API. It provides tools for:
- Document operations (create, read, update, delete, list)
- Schema and metadata handling
- DocType discovery and exploration
- Detailed API usage instructions and examples
The server includes comprehensive error handling, validation, and helpful responses to make it easier for AI assistants to work with Frappe.
Installation
Prerequisites
- Node.js 18 or higher
- A running Frappe instance (version 15 or higher)
- API key and secret from Frappe (optional but recommended)
Setup
- Install via npm:
npm install -g frappe-mcp-server
Alternatively, run directly with npx:
npx frappe-mcp-server
(no installation needed)
Configuration
The server can be configured using environment variables:
FRAPPE_URL: The URL of your Frappe instance (default:http://localhost:8000)FRAPPE_API_KEY: Your Frappe API keyFRAPPE_API_SECRET: Your Frappe API secret
Getting API Credentials
To get API credentials from your Frappe instance:
- Go to User > API Access > New API Key
- Select the user for whom you want to create the key
- Click “Generate Keys”
- Copy the API Key and API Secret
Usage
Starting the Server
npx frappe-mcp-server
Or with environment variables:
FRAPPE_URL=https://your-frappe-instance.com FRAPPE_API_KEY=your_api_key FRAPPE_API_SECRET=your_api_secret npx frappe-mcp-server
Integrating with AI Assistants
To use this MCP server with an AI assistant, you need to configure the assistant to connect to this server. The exact configuration depends on the AI assistant platform you’re using.
For Claude, add the following to your MCP settings configuration file:
{
"mcpServers": {
"frappe": {
"command": "npx",
"args": ["frappe-mcp-server"], // Assumes frappe-mcp-server is in MCP server path
"env": {
"FRAPPE_URL": "https://your-frappe-instance.com",
"FRAPPE_API_KEY": "your_api_key",
"FRAPPE_API_SECRET": "your_api_secret"
},
"disabled": false,
"alwaysAllow": []
}
}
}
Available Tools
Document Operations
create_document: Create a new document in Frappeget_document: Retrieve a document from Frappeupdate_document: Update an existing document in Frappedelete_document: Delete a document from Frappelist_documents: List documents from Frappe with filters
Schema Operations
get_doctype_schema: Get the complete schema for a DocType including field definitions, validations, and linked DocTypes
安装
npx frappe-mcp-server配置
{
"mcpServers": {
"frappe": {
"command": "npx",
"args": ["frappe-mcp-server"], // Assumes frappe-mcp-server is in MCP server path
"env": {
"FRAPPE_URL": "https://your-frappe-instance.com",
"FRAPPE_API_KEY": "your_api_key",
"FRAPPE_API_SECRET": "your_api_secret"
},
"disabled": false,
"alwaysAllow": []
}
}
}