How dharam-k/erpnext-mcp-server works
ERPNext Investigator MCP exposes a safety-first diagnostic toolset to MCP clients. The principal flow is a client request through the MCP server’s guarded tool handling, which validates site and inputs, gathers ERPNext evidence through supported APIs (and optional read-only adapters), then returns redacted results with an audit record. The README documents additional investigation, planning, and operational capabilities; these are represented at the server boundary because the sampled server excerpt is incomplete.
Main entry points: server.py MCP server · frappe.py Frappe REST client · remote_files.py Local and remote file investigation · audit.py Approval and change plans
Components 22
MCP interface
- MCP server
src/erpnext_mcp/server.py - Admin dashboard
src/erpnext_mcp/server.py
ERPNext investigation
- ERPNext diagnostics
src/erpnext_mcp/server.py - Investigation and analysis
src/erpnext_mcp/server.py - Jobs and health checks
src/erpnext_mcp/server.py - SQL validation and metadata
src/erpnext_mcp/server.py - Local and remote file investigation
src/erpnext_mcp/remote_files.py - Approval and change plans
src/erpnext_mcp/audit.py - Backup lifecycle hooks
src/erpnext_mcp/server.py - Incident journal and RCA
src/erpnext_mcp/server.py
Policy and audit
- Runtime settings
src/erpnext_mcp/config.py - Input and redaction policy
src/erpnext_mcp/security.py - Audit logger
src/erpnext_mcp/audit.py
Local records
- Incident and plan files
src/erpnext_mcp/audit.py - Audit log file
src/erpnext_mcp/audit.py
Optional integrations
- Frappe REST client
src/erpnext_mcp/client/frappe.py - Read-only MariaDB adapter
src/erpnext_mcp/client/database.py
Other components
- MCP client
- ERPNext / Frappe
- MariaDB
- Configured staging host
- Backup provider
Connections 24
- MCP client → MCP server: sends tool requests
- MCP server → Runtime settings: loads policy
- MCP server → Input and redaction policy: validates and redacts
- MCP server → Audit logger: records requests
- MCP server → ERPNext diagnostics: dispatches tools
- MCP server → Investigation and analysis: dispatches tools
- MCP server → Jobs and health checks: dispatches tools
- MCP server → SQL validation and metadata: dispatches tools
- MCP server → Local and remote file investigation: dispatches tools
- MCP server → Approval and change plans: dispatches tools
- MCP server → Backup lifecycle hooks: dispatches tools
- MCP server → Incident journal and RCA: dispatches tools
- MCP server → Admin dashboard: serves dashboard
- ERPNext diagnostics → Frappe REST client: requests API data
- Investigation and analysis → Frappe REST client: requests evidence
- Jobs and health checks → Frappe REST client: requests status
- Frappe REST client → ERPNext / Frappe: calls REST API
- SQL validation and metadata → Read-only MariaDB adapter: queries metadata
- Read-only MariaDB adapter → MariaDB: reads
- Local and remote file investigation → Configured staging host: reads via SFTP
- Approval and change plans → Incident and plan files: persists plans
- Incident journal and RCA → Incident and plan files: reads and writes
- Audit logger → Audit log file: appends records
- Backup lifecycle hooks → Backup provider: requests backup operations