Connecting a Client
Once MCP_ENABLED=true the app serves one JSON-RPC endpoint at MCP_MOUNT_PATH — https://your-app.example.com/mcp unless you moved it. Any MCP-capable client can speak to it.
The Generic Configuration
Claude Desktop, Claude Code, Cursor and ChatGPT Dev Mode all read some form of an mcpServers block:
{
"mcpServers": {
"sovrium": {
"url": "https://your-app.example.com/mcp",
"transport": "http"
}
}
}Where that block lives differs per client — a settings file, a project config, a UI panel — but the two values it needs are always the same: the URL and the transport.
Authenticating
There is no mode to pick. The header you send decides which verifier runs, and both are live at once. See Auth, RBAC & Rate Limiting for what each grants.
API key. The simplest option for a script or a CI job. Sign in as the user whose role the client should inherit, mint a key, and send it on x-api-key. The key acts as its owner, so demoting or banning that user takes effect on the next call without re-issuing anything.
x-api-key: <your-api-key>An API key on Authorization: Bearer authenticates nothing. That header is the OAuth path; a key sent there is not a valid access token and answers 401. Check the header name before you check the key.
OAuth. For a client that can run a browser sign-in. Register it once by dynamic client registration and then run the ordinary authorization-code flow. Registration needs a session — run it signed in as an admin, with your login cookie in $SOVRIUM_SESSION:
curl -X POST 'https://your-app.example.com/api/auth/oauth2/register' \
--header 'Content-Type: application/json' \
--cookie "$SOVRIUM_SESSION" \
--data '{
"client_name": "Sovrium MCP — Claude",
"redirect_uris": ["https://your-app.example.com/oauth/callback"],
"grant_types": ["authorization_code", "refresh_token"],
"token_endpoint_auth_method": "client_secret_post"
}'Claude Desktop, Cursor and ChatGPT Dev Mode register themselves, before any browser session exists — so the cookie above is not an option for them. Set SOVRIUM_OAUTH_ANONYMOUS_CLIENT_REGISTRATION=true to let them. Registration then accepts any caller, capped at 20 per minute per IP. It is off by default because registration writes a client_name of the caller's choosing. A client that registers itself is marked Unverified on the consent screen, and the screen leads with the registered redirect origin rather than the name — see The Consent Screen.
A call to the MCP endpoint without a credential answers 401 with a WWW-Authenticate: Bearer discovery header, so a compliant client can start the flow without being told how.
Local IDE over stdio
For a local integration there is no HTTP at all. Set MCP_TRANSPORT=stdio and the client launches the Sovrium binary as a child process, speaking MCP over stdin and stdout.
{
"mcpServers": {
"sovrium": {
"command": "sovrium",
"args": ["start", "./app.ts"],
"env": { "MCP_ENABLED": "true", "MCP_TRANSPORT": "stdio" }
}
}
}The /mcp HTTP route is not mounted in this mode. They are alternatives, not layers — pick one per process.
Verifying the Connection
Do not trust the client's green dot. The smallest useful check is tools/list:
curl -X POST 'https://your-app.example.com/mcp' \
--header 'x-api-key: <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{ "jsonrpc": "2.0", "id": 1, "method": "tools/list" }'The response lists exactly the tools your credential can call — the tables, actions and automations you marked with aiAccess, filtered by the role behind the credential.
That last clause is what makes this worth running. Run it with a key owned by an admin and one owned by a viewer in turn: two different lists is the proof that role filtering is live. One identical list means something is wrong with your credentials, not with your schema.
An empty list is usually aiAccess, not auth. A 200 with no tools means you authenticated fine and nothing is eligible for exposure. A 401 means the credential is wrong. Check which one you got before editing the schema.
Related Pages
- MCP Overview — enabling the server.
- Server Mode — what appears in
tools/listand why. - Auth, RBAC & Rate Limiting — tokens, OAuth, and limits.
- Connect Claude via MCP — a worked end-to-end setup.
- OAuth Server — the OAuth plugin behind
oauth2mode.
Last updated September 1, 2026
This documentation was written with AI, so errors or outdated content are possible. Sovrium is in beta. Contributions and corrections are welcome.