MCP
OnERP is a Model Context Protocol server. An AI client connected to it reads business objects, makes changes, runs actions and calls functions in one workspace, with the same permissions and rules as anyone else.
The server address
Section titled “The server address”The server speaks streamable HTTP at /api/mcp on the API’s address, for example
https://erp.example.com/api/mcp.
Two ways to sign in
Section titled “Two ways to sign in”| Sign-in | Acts as | Use it for |
|---|---|---|
| OAuth, in the browser | The person who signed in, in the workspace they chose | A personal assistant such as a desktop AI app |
API key in x-api-key |
A service account | An unattended integration or automation |
OAuth. A client that supports MCP authorization finds the sign-in on its own, from
/.well-known/oauth-protected-resource at the server’s root. The person signs in to OnERP,
chooses a workspace if they belong to several, and approves the client. The token it receives
is bound to that one workspace and to /api/mcp; it opens no other route. The person can
disconnect the client at any time under Connected apps.
API key. A client configured with custom headers sends a service account’s key as
x-api-key, exactly as an HTTP integration does. The account’s roles
decide what the tools may do.
The tools
Section titled “The tools”| Tool | Does |
|---|---|
search_business_objects |
Finds kinds of business object by keyword |
describe_business_object |
The fields and actions of one kind of business object |
list_codes |
The codes of a code list a field names, such as countries or units |
list, get |
Read business objects. get also says which actions apply right now |
document_flow |
The documents one was created from and every follow-up, as a tree |
create, update |
Write business objects |
activate, archive, restore, delete |
Move a business object through its lifecycle |
run_action |
Runs an action on a business object |
describe_function, call_function |
Learn about and call a function |
run_script |
Runs a read-only script that reads many business objects and returns only its answer, with the caller’s own permissions |
The server also sends the client a short set of instructions: how values are formatted, what drafts and archiving mean, why status fields change only through actions, and which fields are computed from others.
Each tool call is saved on its own. A failure in one call undoes that call, not the calls before it. A call the person’s roles do not allow is refused before it runs.
When a call fails
Section titled “When a call fails”A refused call returns a tool result marked as an error, whose text is the same error body
the HTTP API sends, such as core.validation_failed with its issues. See
HTTP conventions for the codes.
MCP tools do not take revisions or idempotency keys. An AI client that retries a write after a lost answer may write twice.