Read and write ERPNext documents — any DocType — over Frappe's generic REST API, plus the submit/cancel document lifecycle.
ERPNext ships in the w6w first-party pack. It declares 10 actions, 2 health checks, and the host runs its code in a sandbox that never sees the credential.
io.w6w.erpnextERPNext is an open-source, self-hosted ERP built on the Frappe framework, and Frappe does not expose per-business-object endpoints the way a SaaS CRM does — it exposes its own metadata layer, so every Customer, Sales Order, Item, Lead or Employee is a “DocType” reachable through one generic REST surface: /api/resource/<doctype>. This app wraps that surface rather than guessing at a fixed schema, because which DocTypes and fields exist depends entirely on which ERPNext modules and customizations a given install has turned on.
It covers the full document lifecycle any DocType shares: list with Frappe’s own filter/field/sort/paging language, read one by name, create, update and delete. On top of that it adds ERPNext’s submit/cancel workflow — the draft → submitted → cancelled state machine that Sales Orders, Purchase Orders, Sales Invoices and most transactional DocTypes use to move from an editable draft to a posted, accounting-relevant document — plus a record count and a whitelisted remote-method escape hatch for business logic no generic CRUD call reaches.
Good for creating a Customer or Lead from an external form, submitting a Sales Order once a workflow’s own approval step clears, keeping an Item catalog in sync with an outside pricing tool, or reaching any other DocType an installation exposes without waiting for a dedicated action to be written for it.
Three routes to the same 10 actions. The Workflow tab is generated from ERPNext's own manifest and carries its real ids, so it is copy-pasteable; the Code and CLI examples are the same call for any action on any app, so every app-specific value in them is a blank you fill in.
call-method Call any whitelisted Frappe/ERPNext method directly, for business logic no generic document action reaches — e.g. `frappe.client.get_list`, or a method a custom app adds. Runs with exactly the connected User's permissions.
cancel-document Cancel a submitted document (Sales Order, Purchase Order, Sales Invoice, or any other submittable DocType). Only a submitted document can be cancelled.
count-documents Count documents of any DocType matching a filter, using the framework's `frappe.client.get_count`, without fetching the records themselves.
create-document Create a new document of any DocType — Customer, Sales Order, Item, Lead, or any other DocType this site has installed.
delete-document Permanently delete a document of any DocType by its `name`. Submitted documents must be cancelled first — Frappe refuses to delete them directly.
get-document Read one document of any DocType by its `name` (Frappe's primary key, not a display title).
list-documents List records of any DocType — Customer, Sales Order, Item, Lead, or any other DocType this site has installed — with Frappe's own filter, field-selection, sort and paging parameters.
submit-document Submit a draft document (Sales Order, Purchase Order, Sales Invoice, or any other submittable DocType), moving it from Draft to Submitted. Pass the FULL document — the output of Get Document — not just its doctype and name.
update-document Update a document of any DocType by its `name`. Only the fields present in Values are changed — everything else is left alone.
A workflow step names the app and the action, and the editor fills in the
connection when you pick one. This is the Step shape from the
workflow spec, carrying ERPNext's real ids.
{
"manifestVersion": "2",
"name": "erpnext-example",
"steps": [
{
"id": "call-method",
"uses": {
"app": "io.w6w.erpnext",
"action": "call-method",
"connection": "conn_YOUR_CONNECTION_ID"
},
"with": {
"method": "<method>",
"httpMethod": "<httpMethod>"
}
}
]
}call-method count-documents create-document get-document get-logged-user +5 more actions available
Every app-specific value here is a blank you have to fill in. An
app action is reached through the connection that authenticates it, so the
address is a connection id, not the app id — and connections belong to your account,
so a public page cannot know yours. Create one for ERPNext, then fill in
the three blanks: conn_YOUR_CONNECTION_ID, the action key, and the
parameters that action declares. The call itself is real — the shape is transcribed
from the studio's own snippet builder, which prints the same kind of blanks — but
nothing in it is specific to ERPNext. The Workflow tab is where this app's
real ids are.
npm install @w6w/sdkyarn add @w6w/sdkpnpm add @w6w/sdkdeno add npm:@w6w/sdkimport { W6wClient, isActionRun } from "@w6w/sdk";
// Reads W6W_BASE_URL and W6W_TOKEN from the environment when omitted.
const client = new W6wClient();
const envelope = await client.run({
urn: "conn_YOUR_CONNECTION_ID",
action: "call-method",
payload: {
method: "<value>",
httpMethod: "<value>",
// args: "<value>",
},
});
if (isActionRun(envelope)) console.log(envelope.value); npm install -g @w6w/cli w6w run conn_YOUR_CONNECTION_ID --action call-method --payload '{"method":"<value>","httpMethod":"<value>"}' Give an AI agent ERPNext — without giving it ERPNext's credentials. One MCP endpoint exposes every app, function and workflow the caller is entitled to, as tools it can discover and run. Access is granted per team while we onboard.
One tool call{
"name": "w6w_invoke",
"arguments": {
"ref": "app:io.w6w.erpnext#call-method",
"input": {
"method": "<method>",
"httpMethod": "<httpMethod>"
}
}
}
Every tool names its target with a single ref. The
app: form above doesn't name a connection at all — the
host resolves which of the caller's ERPNext connections to sign
with, and refuses rather than guesses when the answer is ambiguous.
The token is attached host-side, at the moment of the call. It is never a tool argument, never in the model's context, and never in a transcript — so a prompt injection has nothing to exfiltrate.
Tools are derived per end user from what that person has actually connected and is entitled to — not one shared bot identity carrying the union of everyone's access.
Multi-step work runs on the workflow engine and returns a run handle the agent can poll — retries, branching and state survive the conversation that started them.
ERPNext's declared health checks are on the surface too, so an agent can tell "the vendor is down" from "your credential expired" before it burns a retry on either.
The MCP surface is part of the hosted platform. ERPNext itself is MIT, and the runtime that executes it is source-available (FSL).
ERPNext declares its own checks, so its health is a property of the app rather than something the host guesses at.
This connection's own site, probed unsigned against frappe.auth.get_logged_user. Frappe's own 403 'login to access' refusal proves the site is answering as Frappe — no credential is sent, so an expired API Secret must not make the site look down.