Frappe MCP Server
Frappe Bench & Site Manager — MCP Server
Verwalten Sie Ihre lokalen Frappe-Benches und -Sites direkt von Claude.ai (Web + Mobil) aus. Verwendet FastMCP über HTTP mit einem statischen Ngrok-Tunnel.
📱 Claude.ai → 🌐 Ngrok (permanent URL) → 🖥️ MCP Server (localhost:8000) → 🔧 Frappe BenchesVerfügbare Tools
Tool | Kategorie | Funktion |
| Bench-Operationen | Startet Supervisor/Bench-Dienste neu |
| Site-Verwaltung | Listet Benches, Sites, Apps und Status auf |
| DocType-Daten | Authentifizierte REST-API-Aufrufe |
| Konsole | Führt Python im Frappe-Kontext aus |
| Protokolle | Ruft Site-/Bench-Protokolldateien ab und filtert diese |
| Konfiguration | Zeigt konfigurierte Benches an (keine Geheimnisse werden offengelegt) |
Related MCP server: Remote Terminal
Voraussetzungen
Python 3.10+
Eine oder mehrere Frappe-Benches, die bereits lokal eingerichtet sind und funktionieren
ngrok-Konto (der kostenlose Tarif reicht aus)
Schritt 1: Abhängigkeiten installieren
git clone <this-repo>
cd frappe-mcp
pip install -r requirements.txtSchritt 2: Konfiguration
cp config.example.json config.jsonBearbeiten Sie die config.json:
{
"benches": [
{
"id": "bench1",
"label": "Main Dev Bench",
"path": "/home/youruser/frappe-bench",
"bench_cmd": "/home/youruser/frappe-bench/env/bin/bench"
}
],
"site_credentials": {
"mysite.localhost": {
"api_key": "YOUR_API_KEY",
"api_secret": "YOUR_API_SECRET",
"port": 8000
}
}
}Wichtig: config.json wird von git ignoriert – committen Sie diese niemals.
Schritt 3: Frappe-API-Anmeldedaten abrufen
Für jede Site, auf die Sie über frappe_api oder bench_execute zugreifen möchten:
Öffnen Sie die Frappe-Site in Ihrem Browser
Gehen Sie zu Einstellungen → API-Zugriff
Klicken Sie auf Schlüssel generieren (für Ihren Administrator-Benutzer)
Kopieren Sie
api_keyundapi_secretin dieconfig.json → site_credentials
Schritt 4: Starten des MCP-Servers
python main.pySie sollten Folgendes sehen:
🚀 Frappe MCP Server starting...
Benches configured : 1
Sites with creds : 1
Listening on : http://0.0.0.0:8000
MCP endpoint : http://0.0.0.0:8000/mcp
Audit log : mcp_audit.logSchritt 5: Ngrok einrichten (einmalig)
Ngrok installieren
macOS (Homebrew):
brew install ngrok/ngrok/ngrokLinux:
curl -sSL https://ngrok-agent.s3.amazonaws.com/ngrok.asc | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null
echo "deb https://ngrok-agent.s3.amazonaws.com buster main" | sudo tee /etc/apt/sources.list.d/ngrok.list
sudo apt update && sudo apt install ngrokOder direkt herunterladen: https://ngrok.com/download
Authentifizierungs-Token hinzufügen
ngrok config add-authtoken YOUR_AUTHTOKENHolen Sie sich Ihr Token von: https://dashboard.ngrok.com/get-started/your-authtoken
Tunnel mit Ihrer kostenlosen statischen Domain starten
ngrok http 8000 --domain=yourname.ngrok-free.appHolen Sie sich eine kostenlose statische Domain: ngrok Dashboard → Cloud Edge → Domains → New Domain
Ihre permanente MCP-URL lautet dann:
https://yourname.ngrok-free.app/mcpSchritt 6: Verbindung zu Claude.ai herstellen
Öffnen Sie claude.ai → Einstellungen → Integrationen
Klicken Sie auf Integration hinzufügen
Geben Sie die URL ein:
https://yourname.ngrok-free.app/mcpKlicken Sie auf Hinzufügen – das war's
Funktioniert von Ihrem Telefon und Laptop aus überall, solange Ihr Laptop läuft.
Schritt 7: Automatischer Start beim Booten (optional)
Linux (systemd)
Erstellen Sie /etc/systemd/system/frappe-mcp.service:
[Unit]
Description=Frappe MCP Server
After=network.target
[Service]
Type=simple
User=youruser
WorkingDirectory=/home/youruser/frappe-mcp
ExecStart=/usr/bin/python3 /home/youruser/frappe-mcp/main.py
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.targetsudo systemctl daemon-reload
sudo systemctl enable frappe-mcp
sudo systemctl start frappe-mcpmacOS (launchd)
Erstellen Sie ~/Library/LaunchAgents/com.frappe.mcp.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.frappe.mcp</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/python3</string>
<string>/Users/youruser/frappe-mcp/main.py</string>
</array>
<key>WorkingDirectory</key>
<string>/Users/youruser/frappe-mcp</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>StandardOutPath</key>
<string>/Users/youruser/frappe-mcp/mcp_stdout.log</string>
<key>StandardErrorPath</key>
<string>/Users/youruser/frappe-mcp/mcp_stderr.log</string>
</dict>
</plist>launchctl load ~/Library/LaunchAgents/com.frappe.mcp.plistTests ausführen
python test_tools.pyEs wird keine echte Frappe-Bench benötigt – alle Tools werden mit einer Mock-Konfiguration getestet.
Sicherheitshinweise
config.jsonwird niemals committet (gitignored)API-Schlüssel werden niemals in Tool-Antworten offengelegt (
get_config_overviewzeigt nur "configured"/"missing" an)Alle Subprozess-Aufrufe verwenden
shell=False– keine Shell-Injection möglichbench_executeverfügt über einen zweistufigen Sicherheitsscanner: harte Blockaden und weiche WarnungenBlockierte Muster (konfigurierbar):
DROP,TRUNCATE,os.system,exec(,eval(usw.Ratenbegrenzung: 30 Anfragen/Minute pro IP (konfigurierbar)
Alle Tool-Aufrufe werden an
mcp_audit.logangehängt
Beispiel-Prompts für Claude
List all my Frappe sites and their status.
How many NGO records are on site1.localhost in bench1?
Show me the last 50 error log lines for site1.localhost — filter for "PermissionError".
Restart the web worker on bench1.
What's in the mGrant Settings module field for site1.localhost?
Show me all active Grants on site1.localhost with fields name, grant_name, grant_status.Dateistruktur
frappe-mcp/
├── main.py # FastMCP server + tool registration
├── config.py # Config loader + validator + singleton
├── security.py # Input sanitizer, command blocker, rate limiter
├── logger.py # Audit logger → mcp_audit.log
├── tools/
│ ├── bench_ops.py # bench_restart (+ Phase 2 stubs)
│ ├── site_manager.py # list_sites (+ Phase 2 stub)
│ ├── frappe_api.py # frappe_api (+ Phase 2 stub)
│ ├── executor.py # bench_execute
│ └── log_reader.py # get_logs
├── config.json # Your config (gitignored)
├── config.example.json # Template (committed)
├── requirements.txt
├── .gitignore
├── test_tools.py # Test suite (mock config, no bench needed)
└── README.mdFehlerbehebung
config.json not found
→ Führen Sie cp config.example.json config.json aus und tragen Sie Ihre Bench-Pfade ein.
Bench path '/home/...' does not exist
→ Der path in config.json → benches muss ein existierendes Verzeichnis sein.
bench command not found
→ Verwenden Sie den vollständigen Pfad zum Bench-Binary, z. B. /home/user/frappe-bench/env/bin/bench.
No credentials configured for site
→ Fügen Sie api_key/api_secret für diese Site in config.json → site_credentials hinzu.
Authentication failed (401)
→ Generieren Sie die API-Schlüssel in der Frappe-Site neu: Einstellungen → API-Zugriff.
Ngrok zeigt ERR_NGROK_3200
→ Ihre statische Domain ist möglicherweise nicht aktiviert. Überprüfen Sie das ngrok Dashboard → Domains.
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
- AlicenseAqualityCmaintenanceEnables SSH remote access to servers through Claude, allowing users to execute commands, transfer files via SFTP, and manage multiple remote connections using natural language.128MIT
- AlicenseNot gradedqualityBmaintenanceExecute commands on remote Linux servers through Claude with an interactive web terminal showing full output while Claude receives smart-filtered summaries for token efficiency. Supports multi-server management, SFTP file transfers, batch scripts, and automation recipes.5MIT
- AlicenseNot gradedqualityCmaintenanceGive Claude direct access to your AWS account, SSH into your servers, run shell commands on your laptop, query your databases, and manage PM2 processes — all from a Claude chat. No Claude Code subscription needed. Your keys never leave your machine.2MIT
- AlicenseNot gradedqualityBmaintenanceIntegrates Claude with ERPNext v16, enabling CRUD operations, queries, and method calls through a secure MCP interface.MIT
Related MCP Connectors
Read, edit, publish, and preview your pepita websites from Claude.
Persistent context for Claude. Your AI always knows your projects and next actions across sessions.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
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/kallusuvaidyam/frappe_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server