frappe_mcp_server
The Frappe MCP Server is a server that exposes the functionalities of the Frappe Framework to AI assistants. It allows for document CRUD operations and schema management through the official REST API, providing detailed instructions on API usage. With comprehensive error handling and validation, it is designed to facilitate effective interaction between AI assistants and Frappe.
GitHub Stars
83
User Rating
Not Rated
Favorites
0
Views
24
Forks
40
Issues
7
Installation
Difficulty
IntermediateEstimated Time
10-20 minutes
Requirements
Node.js 18以上Frappe 15以上Installation
Installation
Prerequisites
Please specify required software and versions:Node.js: 18.0.0 or higher
Frappe: Version 15 or higher
API Key and Secret: Obtain from Frappe (required)
Installation Steps
1. Install via npm
bash
npm install -g frappe-mcp-server
bash
npx frappe-mcp-server
Troubleshooting
Common Issues
Issue: Server won't start Solution: Check Node.js version and reinstall dependencies. Issue: Authentication errors occur Solution: Verify that API key and secret are set correctly.Configuration
Configuration
Basic Configuration
The server is configured using environment variables:FRAPPE_URL: The URL of your Frappe instance (default: http://localhost:8000)FRAPPE_API_KEY: Your Frappe API key (required)FRAPPE_API_SECRET: Your Frappe API secret (required)Setting Environment Variables
bash
export FRAPPE_URL="http://your-frappe-instance.com"
export FRAPPE_API_KEY="your_api_key"
export FRAPPE_API_SECRET="your_api_secret"
Advanced Configuration
Security Settings
Store API keys in environment variables or secure configuration files
Set appropriate file access permissions
Adjust logging levels
Examples
Examples
Basic Usage
Here are basic usage examples for the MCP server:Starting the Server
bash
npx frappe-mcp-server
bash
FRAPPE_URL=https://your-frappe-instance.com FRAPPE_API_KEY=your_api_key FRAPPE_API_SECRET=your_api_secret npx frappe-mcp-server
Programmatic Usage
javascript
// JavaScript example (Node.js)
const { MCPClient } = require('@modelcontextprotocol/client');
const client = new MCPClient();
await client.connect();
// Execute tool
const result = await client.callTool('toolName', {
parameter1: 'value1',
parameter2: 'value2'
});
console.log(result);
Use Cases
Making API calls for AI assistants to manipulate data in Frappe applications.
Dynamically generating documents using Frappe's schema.
Utilizing error handling to provide appropriate feedback to users.
Retrieving data based on user requests through Frappe's REST API by AI assistants.