ERPNext MCP server for AI agents

Live

API KEY

ERP

Accounting & Finance

ERPNext gives your agent access to your ERP data: list, read, and count documents of any DocType, run reports, and create, update, submit, cancel, and delete documents such as invoices and leads.

  • Per-user credentials: each call uses the actual user's API key, never a shared bot.
  • Encrypted per-tenant vault: AES-256, resolved at request time, never in LLM context.
  • Scoped before every call: pre-call scope check, 90-day SIEM-exportable audit chain.
ERPNext
agent · Acme Q3
Run
List the open Sales Invoices for Acme Corp.
S
erpnext_documents_list
187ms
ERP agent
5 Sales Invoices are open for Acme Corp. The oldest is 32 days old.
Sources: ERPNext Sales Invoice, 5 documents
erpnext
5 invoices
18:29
Message Claude...

Tools your ERP agent reaches for on ERPNext, scoped per user.

CALL ANY TOOL
17 tools for ERP in ERPNext: list, read, and count documents of any DocType, run reports, and create, update, submit, cancel, and delete documents.
erpnext_comment_add
Add comment
Add a comment to a document's timeline. Returns message with the new Comment. Use this to log a note on a customer, invoice or other document.
Parameters
Name
Type
Required
Description
comment_by
string
Required
Display name of the commenter. Example: Jane Doe
comment_email
string
Required
Email of the commenter, usually the API user. Example: jane@example.com
content
string
Required
Comment text (HTML allowed). Example: Called the customer about the overdue invoice.
reference_doctype
string
Required
Reference Doctype. Example: Customer
reference_name
string
Required
Reference Name. Example: CUST-00001
erpnext_doctype_meta_get
Get doctype meta
erpnext_document_cancel
Cancel document
erpnext_document_create
Create document
erpnext_document_delete
Delete document
erpnext_document_get
Get document
erpnext_document_rename
Document rename
erpnext_document_submit
Submit document
erpnext_document_update
Update document
erpnext_document_value_get
Get document value
erpnext_document_value_set
Set document value
erpnext_documents_count
Count documents
erpnext_documents_list
List documents
erpnext_link_search
Search link
erpnext_method_call
Call method
erpnext_report_run
Run report
erpnext_user_me_get
Get user me
Build your Agent
Same auth pattern across LangChain, OpenAI, Anthropic, and Google ADK.
Python · LlamaIndex
import { ScalekitClient } from "@scalekit-sdk/node";
import { createReactAgent } from "@langchain/langgraph/prebuilt";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

// ERPNext tools scoped to this user
const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["erpnext"], toolNames: [
    "erpnext_documents_list",
    "erpnext_document_create",
    "erpnext_report_run"] },
  pageSize: 100,
});

const agent = createReactAgent({ llm, tools });
await agent.invoke({ messages: [{ role: "user", content: "List the open Sales Invoices for Acme Corp, create a follow-up Lead, and run the Accounts Receivable report" }] });
import OpenAI from "openai";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const openai = new OpenAI();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["erpnext"] }, pageSize: 100,
});

const res = await openai.chat.completions.create({
  model: "gpt-5",
  messages: [{ role: "user", content: "List the open Sales Invoices for Acme Corp, create a follow-up Lead, and run the Accounts Receivable report" }],
  tools,
});

// Execute the tool call with the user's vaulted ERPNext API key
await sk.tools.executeTool(res.choices[0].message.tool_calls[0], "user_123");
import Anthropic from "@anthropic-ai/sdk";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const anthropic = new Anthropic();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["erpnext"] }, pageSize: 100,
});

const msg = await anthropic.messages.create({
  model: "claude-sonnet-5",
  max_tokens: 1024,
  messages: [{ role: "user", content: "List the open Sales Invoices for Acme Corp, create a follow-up Lead, and run the Accounts Receivable report" }],
  tools,
});

// Tool call runs with the user's vaulted ERPNext API key
await sk.tools.executeTool(msg.content, "user_123");
import { Agent } from "@google/adk/agents";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["erpnext"] }, pageSize: 100,
});

const agent = new Agent({
  name: "erp_agent",
  model: "gemini-2.5-pro",
  instruction: "ERPNext tools scoped to this user",
  tools,
});

await agent.run("List the open Sales Invoices for Acme Corp, create a follow-up Lead, and run the Accounts Receivable report");
Try these prompts
Copy any prompt into your agent. Each maps directly to a ERPNext tool. Click to copy, paste into your agent, done.
Documents
Copy the prompt
Copied
List the open Sales Invoices for Acme Corp.
Copy the prompt
Copied
Get the full Sales Invoice with its child tables.
Copy the prompt
Copied
Count the Leads created this month.
Create and update
Copy the prompt
Copied
Create a new Lead from these details.
Copy the prompt
Copied
Update the status of this Sales Order.
Copy the prompt
Copied
Add a comment to this document's timeline.
Reports and schema
Copy the prompt
Copied
Run the Accounts Receivable report.
Copy the prompt
Copied
Show the fields of the Sales Invoice DocType.
Copy the prompt
Copied
Search for a customer by name.
SEE HOW AUTH WORKS
Each user connects their own ERPNext API key and secret once, and Scalekit sends it with every call. Credentials stay vaulted, every call is scope checked, and every action is logged.
1
Authorize
Your user connects
ERPNext
once. We tie it to their identity and the access they approved, with no shared bot account and no org-wide access
Who:
user ‘A’
when:
Once per user
access:
Limited to user
2
Store
Their
ERPNext
credential lives in a vault scoped to them. User A's data is never reachable by an agent acting for user B, even on the same connection
vault:
encrypted
scope:
per-user
tenants:
isolated
3
Resolve
When your agent calls a
ERPNext
tool, we fetch the right credential server-side. It never touches your agent, never appears in the LLM context, never shows up in your logs
speed:
~40ms
check:
before every call
seen by:
nobody
4
Audit
Every
ERPNext
tool call is logged: who triggered it, which tool ran, what came back. 90 days of history, tied to the user who authorized it
history:
90 days
export:
SIEM-ready
logged:
every call
Test other agents
See the same per-user auth pattern across other accounting and CRM connectors.
GTM and RevOps Teams
Revenue forecast commentary
Pulls open pipeline from Salesforce and HubSpot, calculates coverage against quota, flags at-risk stages, posts commentary to Slack, and logs every snapshot to Google Sheets.
Test other agents
See the same per-user auth pattern across other accounting and CRM connectors.
GTM
Revenue forecast agent
Score pipeline coverage against quota across Salesforce and HubSpot, post forecast commentary to Slack, log snapshots to Sheets.
Why Scalekit
Secure your agent's access. Connectors ship in minutes
01.
Shared tokens break per-user analytics
A shared ERPNext API key and secret looks fine in a demo. In production every document submit and cancel looks like one service account, and you cannot tell which user triggered it. Scalekit resolves the credential of the actual user who triggered the agent, never a shared bot.
// shared key
audit → bot_service_account

// scalekit
audit → user_abc ✓
02.
Authentication is not authorization
03.
Multi-tenancy is architectural
04.
ERPNext today. Ten connectors tomorrow.
“Our agents act across Salesforce, Gong, Google Drive, and more, on behalf of every customer. Scalekit behind the scenes meant we can keep adding tools without ever rebuilding how credentials or tool calling work.”
Venu Madhav Kattagoni
Head of Engineering / Von
FAQs
Frequently Asked Questions
Does the agent access ERPNext as the user or through a shared key?
As the user. Each user connects their own ERPNext API key and secret once, and Scalekit sends it with every call. Audit logs attribute every document create, submit, and cancel to that user, not a shared service account.
Where is the ERPNext API key stored?
In Scalekit's managed AES-256 token vault, namespaced per tenant. To rotate it, the user reconnects with a new API key and secret. Revocation is a single dashboard action. Credentials never appear in prompts, logs, or LLM context.
Can I limit what the agent does in ERPNext?
Yes. Filter by tool name in listScopedTools to expose only what you want, for example the list, get, and count tools without erpnext_document_delete, erpnext_document_cancel, or erpnext_method_call, which calls a whitelisted server method. Scalekit also enforces scope checks before every API call.
What happens when a user revokes ERPNext access?
The connection is invalidated on the next tool call. Subsequent requests for that user fail closed with a clear error. Other users in the tenant remain unaffected. The event is logged for audit.
Can the agent work with any DocType in ERPNext?
Yes. erpnext_documents_list, erpnext_document_get, and erpnext_document_create work on any DocType, and erpnext_doctype_meta_get returns a DocType's fields so the agent knows what to send.
Start in your coding agent
Up and running in one command
Install the Scalekit skill in your editor of choice. Connector, auth, tools, prompt, all wired up
Claude Code REPL
/plugin marketplace add scalekit-inc/claude-code-authstack
/plugin install agentkit@scalekit-auth-stack
Cursor Code REPL
# ~/.cursor/mcp.json
{
""mcpServers"": {
""erpnext"": {
""url"": ""https://mcp.scalekit.com/erpnext"",
""headers"": { ""Authorization"": ""Bearer $SCALEKIT_TOKEN"" }
}
}
}
Codex Code REPL
# ~/.codex/config.toml
[mcp_servers.erpnext]
url = ""https://mcp.scalekit.com/erpnext""
auth_env = ""SCALEKIT_TOKEN""
Copilot Code REPL
# .vscode/mcp.json
{
""servers"": {
""erpnext"": {
""url"": ""https://mcp.scalekit.com/erpnext"",
""type"": ""http""
}
}
}