Frappe MCP Server

v1.2.0
io.github.muthanii/frappe_mcp Checked 19 hours ago Published 4 months ago

Interact with Frappe/ERPNext sites — document CRUD, search, and whitelisted method calls

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

frappe_ping Check Frappe connection

Check connectivity and credentials against the configured Frappe/ERPNext site. Use first when another tool fails, to tell a network or credential problem apart from a bad doctype or document name. This is a diagnostic, not a data tool — it never reads or writes documents. Behavior: read-only and idempotent, with no side effects. A pong proves the site is reachable and that FRAPPE_API_KEY/FRAPPE_API_SECRET authenticate; it does not prove the API user has permission for any particular DocType. Failure surfaces as a connection error (site unreachable, wrong URL, TLS problem) or an auth error (b…

frappe_get_doc Get one document

Retrieve one complete document (a single DocType record) by its exact doctype and document name. Use when the document's name is already known, such as 'SINV-00001'. Use frappe_search_docs instead to find documents by field value, to fetch many records, or to return only a few fields; use frappe_run_method for values that are computed rather than stored on the document. Behavior: read-only and idempotent, with no side effects. Returns the document in whatever state it is stored — draft, submitted or cancelled — without filtering. Results respect the API user's role permissions: a document…

ParameterTypeDescription
doctype *stringThe target DocType name (e.g. 'Sales Invoice', 'Customer', 'Item', 'Sales Order', 'Purchase Order', 'User'). Case-sensitive and must match the DocType exactly as defined in Frappe.
name *stringThe unique document name or ID to retrieve (e.g. 'SINV-00001', 'CUST-00001', 'ITEM-00001', 'Administrator'). This is the `name` primary key shown in the Frappe list view or document form, not a title…

frappe_search_docs Search or list documents

Search or list documents of one DocType, with optional filters, field selection, ordering and pagination. Use to find documents by field value or to browse a DocType. Use frappe_get_doc instead when the exact document name is known and every field is wanted; use frappe_run_method for aggregates, totals or report output, which this tool cannot compute. Behavior: read-only and idempotent, with no side effects. Only documents the API user's role permissions allow are returned, so a short result may mean restricted access rather than no matches. An unknown doctype raises a not-found error, and an…

ParameterTypeDescription
doctype *stringThe DocType to search within (e.g. 'Sales Invoice', 'Customer', 'Item', 'ToDo', 'Contact'). Case-sensitive; exactly one DocType per call, as this tool cannot search across DocTypes.
fieldsarrayOptional list of fieldnames to return. Limits the response to only the specified fields, which keeps large result sets manageable. Example: ['name', 'status', 'grand_total', 'posting_date']. When omit…
filtersarrayOptional list of filter conditions, all ANDed together. Each filter is a triple [field, operator, value]. Supported operators: =, !=, >, <, >=, <=, like, not like, in, not in, between. Example: [['sta…
limitintegerMaximum number of results to return (default: 20, maximum: 200). Frappe caps results at 200 per request; there is no offset parameter, so paginate by narrowing `filters` rather than by increasing this…
order_bystringField to sort by with direction, formatted as 'fieldname direction'. Examples: 'creation desc' (newest first), 'modified asc' (oldest updated first), 'name asc' (alphabetical). The direction is requir…

frappe_create_doc Create a document

Create a new document of the given DocType from the supplied field values. Use to insert a record that does not yet exist. Use frappe_update_doc instead to change a record that already exists — this tool never updates in place, so re-running it creates a second, separately named document. Behavior: writes to the site and is NOT idempotent. The document is inserted as a draft (docstatus 0) and is not submitted, so submittable DocTypes such as Sales Invoice still need a submit step via frappe_run_method. Frappe assigns the name from the DocType's naming series, so the name is unknown until thi…

ParameterTypeDescription
data *objectKey-value pairs of document field values to set. Keys are fieldnames (e.g. 'customer_name', 'email_id', 'status', 'items'), not form labels; Link fields take the target document's `name`. Child-table…
doctype *stringThe target DocType name for the new document (e.g. 'Customer', 'Sales Invoice', 'Item', 'ToDo', 'Contact', 'Address'). Case-sensitive and must be a DocType that exists on the target Frappe site.

frappe_update_doc Update a document

Update selected fields of an existing document, identified by its doctype and name. Use for partial edits: only the keys present in `data` change and every other field is left alone. Use frappe_create_doc for records that do not exist yet, and prefer this tool over frappe_delete_doc when a document should be voided rather than removed — setting a status such as 'Cancelled' preserves the audit trail. Behavior: writes to the site, overwriting the previous values of the fields supplied; those old values are not recoverable through this API. Idempotent — repeating an identical call leaves the…

ParameterTypeDescription
data *objectFieldnames and their new values. Only the fields included here are modified; others retain their current values. Passing a child-table field replaces every row in that table. Example: {'status': 'Canc…
doctype *stringThe DocType of the document to update (e.g. 'Sales Invoice', 'Customer', 'Item', 'Sales Order'). Case-sensitive and must match the doctype of the existing document.
name *stringThe `name` primary key of the existing document to modify (e.g. 'SINV-00001', 'CUST-00001', 'ITEM-00001'). The document must already exist; this tool does not create one.

frappe_delete_doc Delete a document (irreversible)

Permanently delete a document by its doctype and name. Use only for genuinely disposable records such as ToDo or Note, or for a test document created moments earlier — the deletion is irreversible, with no undo and no recycle bin. Prefer frappe_update_doc to set a status such as 'Cancelled' whenever an audit trail matters, which covers most transactional records (Sales Invoice, Sales Order, Payment Entry, Journal Entry). Behavior: writes to the site. Not idempotent from the caller's point of view — a second call for the same name raises a not-found error. Frappe refuses the delete while ot…

ParameterTypeDescription
doctype *stringThe DocType of the document to delete (e.g. 'ToDo', 'Note', 'Contact', 'Address'). WARNING: deleting a transactional or parent document removes its child rows and may be blocked by, or orphan, linked…
name *stringThe exact `name` primary key of the document to permanently remove (e.g. 'TODO-00001', 'NOTE-00001'). This operation cannot be undone, so verify the value identifies the intended record before calling…

frappe_run_method Call a whitelisted server method

Call a whitelisted server-side Python method on the Frappe site. Use as the escape hatch for anything the CRUD tools cannot express — submitting or cancelling documents, running reports, computing stock balances, or invoking a custom app's API. Use frappe_get_doc, frappe_search_docs, frappe_create_doc or frappe_update_doc for ordinary record work: they validate their arguments and describe their effects, whereas this tool cannot. Behavior: the effect is determined entirely by the method named and may read, write, delete or enqueue background jobs, so treat every call as potentially destructi…

ParameterTypeDescription
method *stringFull dotted Python path to the whitelisted method — module path plus function name. Examples: 'frappe.auth.get_logged_user', 'frappe.client.submit', 'erpnext.stock.utils.get_stock_balance', or any c…
kwargsobjectOptional keyword arguments passed to the remote method. Keys must match that method's parameter names exactly — they depend entirely on the method being called, and an unknown key raises an error ra…