Frappe MCP Server

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.

Category
Visit Server

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}, and user://me.
    • Prompts: Ready-to-use AI templates for Sales Orders, approvals, monthly reports, and employee onboarding.

โš™๏ธ 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 build inside F:/MCP/frappe js mcp first so that dist/index.js exists.
  • 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.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured