Skip to main content
Glama

Frappe MCP Server (Python + uv + Docker)

A modern, containerized Python implementation of the Model Context Protocol (MCP) server for Frappe Framework, built with FastMCP, uv for dependency management, and Docker for deployment.

Features

  • Document Operations: Full CRUD operations for Frappe documents

  • Schema Introspection: DocType field definitions and structure analysis

  • Report Generation: Query reports, financial statements, and data exports

  • Method Calling: Execute whitelisted Frappe methods

  • Authentication: Secure API key/secret authentication

Related MCP server: Frappe MCP Server

Quick Start

Prerequisites

  • Docker and Docker Compose

  • Access to a Frappe site with API credentials

Setup

git clone https://github.com/appliedrelevance/frappe_mcp_server_uv.git
cd frappe_mcp_server_uv
cp .env.example .env
# Edit .env with your Frappe credentials
docker-compose up -d frappe-mcp-server

Available MCP Tools

Document Operations

  • create_document: Create new Frappe documents

  • get_document: Retrieve document by DocType and name

  • update_document: Update existing documents

  • delete_document: Delete documents

  • list_documents: Query documents with filters

  • call_method: Execute whitelisted Frappe methods

Schema Operations

  • get_doctype_schema: Get complete DocType structure

  • get_field_options: Get Link/Select field options

  • get_doctype_list: List available DocTypes

  • get_frappe_usage_info: Combined schema and usage information

Report Operations

  • run_query_report: Execute Frappe query reports

  • get_report_meta: Get report metadata and structure

  • list_reports: List available reports

  • run_doctype_report: Generate DocType-based reports

  • get_financial_statements: Access P&L, Balance Sheet, Cash Flow

Helper Operations

  • ping: Server health check

  • version: Get server version information

  • validate_auth: Check API credential status

Development

# Install with development dependencies
uv sync --dev

# Run tests
uv run pytest

# Format code
uv run black src/ && uv run isort src/

License

ISC License - see LICENSE file for details.

Available Tools

24 tools
amend_documentA
    Amend a document in Frappe (create a new amended version of a cancelled document).
    
    This tool handles document amendment by creating a new document with an amended name
    (e.g., DOC-001-1, DOC-001-2) and copying all relevant field values from the original
    cancelled document, establishing proper linkage via the 'amended_from' field.
    
    Args:
        doctype: DocType name
        name: Document name (case-sensitive) - must be a cancelled document
        
    Returns:
        Success message with new amended document name if successful, or detailed 
        error information if amendment fails due to validation errors or constraints.
    

Inputs: doctype (required), name (required). Returns: result

call_methodC
    Execute a whitelisted Frappe method.
    
    Args:
        method: Method name to call (whitelisted)
        params: Parameters to pass to the method (optional)
    

Inputs: method (required), params. Returns: result

cancel_documentA
    Cancel a document in Frappe (change docstatus from 1 to 2).
    
    This tool handles document cancellation using Frappe's cancellation workflow,
    including proper validation and error handling to provide clear feedback
    for corrective action.
    
    Args:
        doctype: DocType name
        name: Document name (case-sensitive)
        
    Returns:
        Success message if cancelled, or detailed error information if cancellation
        fails due to validation errors, linked documents, or permission issues.
    

Inputs: doctype (required), name (required). Returns: result

count_documentsA
    Count documents in Frappe with optional filters.
    
    This tool addresses the filtering limitation that existed in previous implementations
    by using Frappe's native count functionality via the REST API with a custom filter language.
    
    Args:
        doctype: DocType name
        filters: Filter string (optional). Uses custom syntax to bypass MCP validation issues.
    
    Filter Syntax:
        - Simple equality: "field:value" -> {"field": "value"}
        - Operators: "field:operator:value" -> {"field": ["operator", value]}
        - Multiple filters: "field1:value1,field2:operator:value2"
        
    Supported Operators:
        - Equality: = (default), !=
        - Comparison: <, >, <=, >=  
        - Pattern: like, not_like (use % for wildcards)
        - Lists: in, not_in (separate values with |)
        - Null checks: is:null, is:not_null, is_not:null
        - Ranges: between (separate values with |)

    Examples:
        - "status:Unreconciled" -> Status equals Unreconciled
        - "amount:>:100" -> Amount greater than 100
        - "name:like:%admin%" -> Name contains 'admin'
        - "status:in:Open|Working|Pending" -> Status in list
        - "date:between:2025-01-01|2025-12-31" -> Date in range
        - "phone:is:not_null" -> Phone is not null
    
    Tool Examples:
        - count_documents("User") -> Count all users
        - count_documents("Bank Transaction", "status:Unreconciled") -> Count unreconciled transactions
        - count_documents("Bank Transaction", "unallocated_amount:>:0") -> Count with unallocated amount
        - count_documents("Task", "status:in:Open|Working|Pending") -> Count tasks with multiple statuses
        - count_documents("User", "name:like:%admin%") -> Count users with 'admin' in name  
        - count_documents("Payment Entry", "posting_date:between:2025-01-01|2025-12-31") -> Count in date range
        - count_documents("Contact", "phone:is:not_null") -> Count contacts with phone numbers
    

Inputs: doctype (required), filters. Returns: result

create_documentB
    Create a new document in Frappe.
    
    Args:
        doctype: DocType name
        values: Document field values. Required fields must be included.
               For Link fields, provide the exact document name.
               For Table fields, provide an array of row objects.
    

Inputs: doctype (required), values (required). Returns: result

delete_documentB
    Delete a document from Frappe.
    
    This tool handles document deletion with comprehensive error handling,
    providing detailed feedback about why deletions fail and actionable
    guidance for resolving common deletion blockers.
    
    Args:
        doctype: DocType name
        name: Document name (case-sensitive)
        
    Returns:
        Success message if deleted, or detailed error information with
        corrective actions for linked documents, permissions, or constraints.
    

Inputs: doctype (required), name (required). Returns: result

get_doctype_listA
    Get a list of available DocTypes, optionally filtered by module.
    
    Args:
        module: Module name to filter by (optional)
        limit: Maximum number of DocTypes to return (default: 50)
    

Inputs: module, limit. Returns: result

get_doctype_schemaA
    Get the complete schema for a DocType including field definitions, validations, and linked DocTypes.
    
    Use this to understand the structure of a DocType before creating or updating documents.
    
    Args:
        doctype: DocType name
    

Inputs: doctype (required). Returns: result

get_documentB
    Retrieve a document from Frappe.
    
    Args:
        doctype: DocType name
        name: Document name (case-sensitive)
    

Inputs: doctype (required), name (required). Returns: result

get_field_optionsA
    Get available options for a Link or Select field.
    
    For Link fields, returns documents from the linked DocType.
    For Select fields, returns the predefined options.
    
    Args:
        doctype: DocType name
        fieldname: Field name
        limit: Maximum number of options to return (default: 20)
    

Inputs: doctype (required), fieldname (required), limit. Returns: result

get_financial_statementsB
    Get standard financial reports (P&L, Balance Sheet, Cash Flow).
    
    Args:
        report_type: Type of financial statement 
                   ('Profit and Loss Statement', 'Balance Sheet', 'Cash Flow')
        company: Company name
        from_date: Start date (YYYY-MM-DD format, optional)
        to_date: End date (YYYY-MM-DD format, optional) 
        periodicity: Periodicity (Monthly, Quarterly, Half-Yearly, Yearly)
    

Inputs: report_type (required), company (required), from_date, to_date, +1 more. Returns: result

get_frappe_usage_infoB
    Get combined information about a DocType or workflow, including schema metadata and usage guidance.
    
    Args:
        doctype: DocType name (optional if workflow is provided)
        workflow: Workflow name (optional if doctype is provided)
    

Inputs: doctype, workflow. Returns: result

get_report_columnsA
    Get the column structure for a specific report.
    
    Args:
        report_name: Name of the report
        filters: Filter string (optional). Uses custom syntax to bypass MCP validation issues.
    
    Filter Syntax: Use the same string-based syntax as count_documents and list_documents.
    Examples: "status:Open", "date:>=:2025-01-01", "status:in:Open|Working"
    

Inputs: report_name (required), filters. Returns: result

get_report_metaC
    Get metadata for a specific report including columns and filters.
    
    Args:
        report_name: Name of the report to get metadata for
    

Inputs: report_name (required). Returns: result

list_documentsA
    List documents from Frappe with filters.
    
    Args:
        doctype: DocType name
        filters: Filter string (optional). Uses custom syntax to bypass MCP validation issues.
        fields: Comma-separated field names (optional). E.g. "name,customer,total"
        limit: Maximum number of records to return (optional). E.g. "20"
        order_by: Field to order by (optional, can include 'desc' like 'creation desc')
    
    Filter Syntax:
        - Simple equality: "field:value" -> {"field": "value"}
        - Operators: "field:operator:value" -> {"field": ["operator", value]}
        - Multiple filters: "field1:value1,field2:operator:value2"
        
    Supported Operators:
        - Equality: = (default), !=
        - Comparison: <, >, <=, >=  
        - Pattern: like, not_like (use % for wildcards)
        - Lists: in, not_in (separate values with |)
        - Null checks: is:null, is:not_null, is_not:null
        - Ranges: between (separate values with |)

    Examples:
        - list_documents("Bank Transaction", "status:Unreconciled") -> List unreconciled transactions
        - list_documents("Task", "status:in:Open|Working", "name,subject", "10") -> List open tasks with specific fields
        - list_documents("User", "name:like:%admin%") -> List users with 'admin' in name
    

Inputs: doctype (required), filters, fields, limit, +1 more. Returns: result

list_reportsC
    Get a list of all available reports in the system.
    
    Args:
        module: Filter reports by module (optional)
        limit: Maximum number of reports to return (default: 50)
    

Inputs: module, limit. Returns: result

pingB

A simple tool to check if the server is responding.

Inputs: no named parameters. Returns: result

run_doctype_reportB
    Run a standard doctype report with filters and sorting.
    
    Args:
        doctype: DocType to generate report for
        fields: Fields to include in report (optional)
        filters: Filter string (optional). Uses custom syntax to bypass MCP validation issues.
        limit: Maximum number of records (default: 100)
        order_by: Field to order by (optional)
    
    Filter Syntax: Use the same string-based syntax as count_documents and list_documents.
    Examples: "status:Open", "date:>=:2025-01-01", "status:in:Open|Working"
    

Inputs: doctype (required), fields, filters, limit, +1 more. Returns: result

run_query_reportA
    Execute a Frappe query report with filters.
    
    Args:
        report_name: Name of the report to run
        filters: Filter string (optional). Uses custom syntax to bypass MCP validation issues.
    
    Filter Syntax: Use the same string-based syntax as count_documents and list_documents.
    Examples: "status:Open", "date:>=:2025-01-01", "status:in:Open|Working"
    

Inputs: report_name (required), filters. Returns: result

submit_documentA
    Submit a document in Frappe (change docstatus from 0 to 1).
    
    This tool handles document submission using Frappe's submission workflow,
    including proper validation and error handling to provide clear feedback
    for corrective action.
    
    Args:
        doctype: DocType name
        name: Document name (case-sensitive)
        
    Returns:
        Success message if submitted, or detailed error information if submission
        fails due to validation errors or missing required fields.
    

Inputs: doctype (required), name (required). Returns: result

test_hardcoded_filterC

Test hardcoded filter to verify Frappe API filtering works. This bypasses all parameter validation issues.

Inputs: doctype (required). Returns: result

update_documentC
    Update an existing document in Frappe.
    
    Args:
        doctype: DocType name
        name: Document name (case-sensitive)
        values: Field values to update
    

Inputs: doctype (required), name (required), values (required). Returns: result

validate_authB

Validate API credentials and return authentication status.

Inputs: no named parameters. Returns: result

versionA

Get version information for the Frappe MCP server.

Inputs: no named parameters. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 24 tools

    Disambiguation4/5

    Most tools have distinct purposes, but there is some overlap between list_documents, run_doctype_report, and run_query_report, which could cause confusion in selecting the right tool for listing or reporting tasks. However, descriptions help clarify their specific uses, and other tools like create_document, update_document, and cancel_document are clearly differentiated.

    Naming Consistency5/5

    Tool names follow a highly consistent verb_noun pattern throughout, such as create_document, update_document, list_documents, and get_doctype_schema. All tools use snake_case with clear, descriptive names, making them predictable and easy to understand without any deviations or mixed conventions.

    Tool Count4/5

    With 24 tools, the count is slightly high but reasonable for a comprehensive Frappe server covering document management, reporting, and system operations. It includes core CRUD operations, financial statements, and utility tools, though it may feel heavy compared to simpler servers but aligns well with the domain's complexity.

    Completeness5/5

    The tool set provides complete coverage for Frappe document management, including full CRUD lifecycle (create, get, update, delete, submit, cancel, amend), schema exploration, reporting, and financial statements. There are no obvious gaps; agents can perform all essential operations without dead ends, supported by utility tools like ping and version.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Allows AI assistants to interact with Frappe applications through the official REST API, enabling document CRUD operations, schema handling, and detailed API instructions.
      182 npm
      2
      ISC
    • A
      license
      Not graded
      quality
      D
      maintenance
      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.
      182 npm
      ISC
    • A
      license
      Not graded
      quality
      D
      maintenance
      Integrates with ERPNext/Frappe API to enable AI assistants to interact with ERPNext data and create custom applications including DocTypes, workflows, scripts, and more.
      MIT