StabisoDocs

AI assistants (MCP)

Connect an AI assistant (MCP)

Both products also serve a Model Context Protocol endpoint, so that an AI assistant or agent can use them without writing HTTP. REST is the product: an MCP tool only does what a REST operation does, and CI checks it. This page says how to connect and how a tool maps to REST; the list of tools is generated from the code.

Connect

Product Endpoint Credential
Stabiso $ERP_URL/mcp The same API key as REST: Authorization: Bearer <key> or X-API-Key: <key>
data-vNext $DATAVNEXT_URL/mcp X-API-Key: <key> (none on a local server without authentication)

For Claude's apps and claude.ai, which sign in instead of sending a key, see Claude.

The transport is streamable HTTP, stateless (every request is independent; there is no session to keep). With Claude Code:

claude mcp add --transport http vnext-erp "$ERP_URL/mcp" --header "Authorization: Bearer $AGENT_KEY"
claude mcp add --transport http datavnext "$DATAVNEXT_URL/mcp" --header "X-API-Key: $DATAVNEXT_KEY"

Use an agent key (POST /v1/api-keys with "actor_type": "agent", scopes read, draft and optionally post) for an assistant: everything it prepares can wait for a person, and it can never approve, close periods or release payments. See agents for the guardrails and the built-in agents.

Claude

Claude's custom connectors (the Claude apps and claude.ai) sign in with the person's own account instead of a key (ADR-0082):

  1. In Claude, open Settings, Connectors, Add custom connector, and enter $ERP_URL/mcp (for example https://app.stabiso.com/mcp). Leave the OAuth client fields empty. A connector added with https://erp.grunte.com/mcp before the move on 29 October 2026 is added again with the new address.
  2. Claude opens the ERP's sign-in. Signed in, the page names the app, the organization it would work in and what it may do; tick "Also let it post routine entries" if it should, and click Allow.
  3. Claude works through the tools below as an agent key bound to you: read and draft (and post if ticked), never more than you hold, never approve. It is listed under Settings, API keys as "Claude (connected app)"; revoking it there disconnects Claude.
  4. The key acts for you: it stops working when you are disabled or your access ends. An external auditor connects the same way; their app can only read, and every tool it calls is in the auditor's access log.

ChatGPT connects the same way (Settings, Connectors, Create, with developer mode on; the address is the same and the authentication is OAuth). The same sign-in works for Claude Code (claude mcp add --transport http vnext-erp $ERP_URL/mcp, then /mcp in Claude Code to sign in), which returns to http://localhost.

Under the hood the ERP is the OAuth 2.1 authorization server of its MCP endpoint:

Endpoint Standard What it does
GET /.well-known/oauth-protected-resource/mcp RFC 9728 The resource ($ERP_URL/mcp) and its authorization server (the ERP). A request to /mcp without a credential answers 401 with WWW-Authenticate: Bearer resource_metadata="…" pointing here.
GET /.well-known/oauth-authorization-server RFC 8414 The endpoints below; code with PKCE S256 only; no refresh tokens.
POST /oauth/register RFC 7591 Dynamic registration. Nothing is stored: the client id carries the app's name and redirect addresses. A redirect address must be https on ERP_OAUTH_REDIRECT_HOSTS (default claude.ai, claude.com, chatgpt.com) or http://localhost / 127.0.0.1.
GET /oauth/authorize OAuth 2.1 Sends the person to the connect page (/app/connect), which signs them in first and asks them (GET and POST /v1/connectors/authorization).
POST /oauth/token OAuth 2.1, RFC 7636 The one-time code (ten minutes, good once) and PKCE verifier for the access token: the agent key.

How a tool maps to REST

  • A tool runs as the actor behind the key of the request: the same scopes, the same approval policy, the same tenant isolation, the same audit trail as the REST call. A tool the key has no scope for fails with forbidden.
  • Every ERP tool names the REST operations it mirrors in its tool metadata, _meta.rest, for example create_journal_entry has "rest": ["POST /v1/journal-entries"] and reconcile_bank_line lists POST /v1/bank-lines/{line_id}/match and POST /v1/bank-lines/{line_id}/post. The generated list links each of them to the operation in the reference, where the rules, errors and examples are. The tool's arguments are the operation's parameters, flattened.
  • Write tools take an idempotency_key argument, the equivalent of the Idempotency-Key header (conventions), and return the same policy decision as REST: posted, or pending_approval with the reason and the approval id.
  • Errors come back as a tool error whose text is <code>: <message> with the same codes as the REST error envelope.
  • A tool that REST does not offer cannot exist: tests/erp/test_rest_parity.py fails when a tool does not declare an existing operation, so the REST reference is the complete description of what an agent can do.

The data-vNext tools are read-only wrappers over the reference-data services; they name no REST operation, but each corresponds to the operations of the area it is named after (get_tax_rates to GET /v1/tax/indirect/rates, convert_fx to GET /v1/fx/convert, and so on).

The month-end close

An assistant can take a person through a whole month-end close (ADR-0083). month_end_close is the place to start and to come back to after each step: for a period it lists what is still open, in order, each item with who acts (assistant, person or both), the tools to use, what to ask the person and, for what only a person may do, a link into the web app. The close checklist decides what is done. Closing the period, approving, finalising a VAT return and recording its submission, marking a bank account reconciled and recording a close task stay the person's acts: the assistant hands over the link (request_period_close for the close itself). A link names the key's organization (?org=), so it opens in the right one, test copies included.

  • MCP tools: every tool, its arguments and the REST operations it mirrors (generated)
  • Agents: guardrails and the built-in agents
  • Conventions
Stabiso, the Enterprise System of Record · generated from the code and its guides · release 20b7dd5b0c4d