MCP server
The Ordainer MCP server runs on your computer over stdio and talks to the admin API with an admin key you give it. From Cursor, Claude Code, Claude Desktop, VS Code, Windsurf, or another MCP client, your agent can create a customer, a plan and a test key, check how close each key is to its cap, read would-denies, raise a cap, and switch a plan from shadow to enforce.
Test keys and test data only. Every change shows you a preview first and needs your accept. New key secrets are written to a local env file and are never shown to the model.
This page should take about two minutes once you have Node 20+ and an admin key.
Before you start
Section titled “Before you start”- Install Node 20 or later (
node -v). The server will not start on an older Node. - In the Ordainer console, create an admin key in Console → Keys, under Admin keys at the bottom, with only the scopes you want the agent to have.
usage:readalone is enough to watch; writes need the matching write scopes. The organization always comes from this key. There is no org argument. - There is nothing to install by hand. Your client starts the server with
npx -y ordainer-mcp@0.1.1, andnpxdownloads the package the first time it runs.0.1.1is the current version. Leave off@0.1.1to use the latest published version instead.
The admin key goes in the MCP client’s environment, never in a file the agent reads, and never in a committed project file.
Add it to your client
Section titled “Add it to your client”Project config is .cursor/mcp.json. User-wide config is ~/.cursor/mcp.json. Both use a top-level mcpServers object. Prefer the user-wide file so the admin key is not sitting in the repo.
{ "mcpServers": { "ordainer": { "command": "npx", "args": ["-y", "ordainer-mcp@0.1.1"], "env": { "ORDAINER_ADMIN_KEY": "${env:ORDAINER_ADMIN_KEY}" } } }}On Windows, if Cursor cannot start npx, see Windows and PowerShell.
Set ORDAINER_ADMIN_KEY in your environment, then restart Cursor. ${env:ORDAINER_ADMIN_KEY} is Cursor’s substitution for an environment variable — do not paste the key into the JSON if you can avoid it.
You can also add it with a Cursor deeplink. Build it from the server config without the admin key (a key in the link would be stored in browser history):
python3 -c "import json,base64,urllib.parse; c=json.dumps({'command':'npx','args':['-y','ordainer-mcp@0.1.1']},separators=(',',':')); print('cursor://anysphere.cursor-deeplink/mcp/install?name=ordainer&config='+urllib.parse.quote(base64.b64encode(c.encode()).decode(),safe=''))"# Works in PowerShell 7 (checked). It uses only .NET calls ([Convert], [Text.Encoding], [uri]) and Write-Output.$json = '{"command":"npx","args":["-y","ordainer-mcp@0.1.1"]}'$b64 = [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes($json))$enc = [uri]::EscapeDataString($b64)Write-Output "cursor://anysphere.cursor-deeplink/mcp/install?name=ordainer&config=$enc"Open the link, then add ORDAINER_ADMIN_KEY in Cursor’s MCP env for the server. Official docs: Cursor MCP.
Flags such as --env and --transport go before the server name. -- separates them from the command that starts the server. Do not put the server name immediately after --env.
read -rs -p "Paste your admin key: " ORDAINER_ADMIN_KEY && export ORDAINER_ADMIN_KEYclaude mcp add --env ORDAINER_ADMIN_KEY=$ORDAINER_ADMIN_KEY --transport stdio ordainer -- npx -y ordainer-mcp@0.1.1$env:ORDAINER_ADMIN_KEY = Read-Host "Paste your admin key"claude mcp add --env "ORDAINER_ADMIN_KEY=$env:ORDAINER_ADMIN_KEY" --transport stdio ordainer -- npx -y ordainer-mcp@0.1.1Both forms read the key at a prompt, so you do not type it on the command line. $env:ORDAINER_ADMIN_KEY = ... is the PowerShell form of export, and it lasts for that window only. You can also add the server and then put the key only in Claude Code’s server env. Official docs: Connect Claude Code to tools via MCP.
Open Settings → Developer → Edit Config, or edit claude_desktop_config.json directly:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
{ "mcpServers": { "ordainer": { "command": "npx", "args": ["-y", "ordainer-mcp@0.1.1"], "env": { "ORDAINER_ADMIN_KEY": "ord_admin_..." } } }}On Windows, if Claude Desktop cannot start npx, see Windows and PowerShell. Fully quit Claude Desktop (not just the window) and reopen it. Official paths: Connect to local MCP servers.
VS Code currently has two config shapes.
Editor-managed (workspace file .vscode/mcp.json), with an inputs prompt so the admin key is not stored in the file. This is the better shape for a secret. Top-level key is servers, not mcpServers:
{ "inputs": [ { "type": "promptString", "id": "ordainer-admin-key", "description": "Ordainer admin key (ord_admin_…)", "password": true } ], "servers": { "ordainer": { "type": "stdio", "command": "npx", "args": ["-y", "ordainer-mcp@0.1.1"], "cwd": "${workspaceFolder}", "env": { "ORDAINER_ADMIN_KEY": "${input:ordainer-admin-key}" } } }}cwd is the folder where create_key and rotate_key write env files, so set it to the project that should receive them. On Windows, if VS Code cannot start npx, see Windows and PowerShell.
Copilot portable (what Microsoft recommends for new Copilot configs): top-level mcpServers in the user file ~/.copilot/mcp-config.json (or $COPILOT_HOME/mcp-config.json) or, when you want to share a definition with the workspace, .mcp.json at the workspace root. That format does not support inputs. Use the user file and keep the key out of git:
{ "mcpServers": { "ordainer": { "type": "stdio", "command": "npx", "args": ["-y", "ordainer-mcp@0.1.1"], "env": { "ORDAINER_ADMIN_KEY": "ord_admin_..." } } }}Microsoft documents .vscode/mcp.json as the editor-managed Local harness format, still valid, and marks it deprecated for new Copilot harness configs. Official reference: MCP configuration.
In Cascade, open the MCP menu and choose Open MCP config file. That opens the Cortex-managed mcp_config.json:
- macOS and Linux:
~/.config/devin/mcp_config.json(or$XDG_CONFIG_HOME/devin/mcp_config.json) - Windows:
%AppData%\devin\mcp_config.json
Some editor builds also discover ~/.codeium/windsurf/mcp_config.json. Use the file Cascade actually opens. Top-level key is mcpServers. Refresh Cascade after you save.
{ "mcpServers": { "ordainer": { "command": "npx", "args": ["-y", "ordainer-mcp@0.1.1"], "env": { "ORDAINER_ADMIN_KEY": "ord_admin_..." } } }}On Windows, if Windsurf cannot start npx, see Windows and PowerShell. Official docs: Windsurf Cascade MCP configuration.
Check that it works
Section titled “Check that it works”Restart the client (or refresh its MCP list). Then ask:
List my Ordainer customers.The agent should call list_customers and return the customers in this organization, or a truthful empty list. When we started the published package with npx -y ordainer-mcp@0.1.1 on 24 Nov 2026, the server reported its name as ordainer-mcp, its title as Ordainer and its version as 0.1.1, and listed 12 tools. If it cannot see the server, or a tool returns auth_failed / config_invalid, see Troubleshooting.
Writes are not needed for this check. When you do ask for a change, you will see a preview and must accept it yourself. See Confirm and security.
Environment variables
Section titled “Environment variables”| Variable | Meaning |
|---|---|
ORDAINER_ADMIN_KEY |
Required. An ord_admin_ key from Console → Keys, under Admin keys. Its scopes decide what the agent can do. The organization always comes from this key. |
ORDAINER_MCP_READ_ONLY |
true, 1, yes, or on (any capitalisation; spaces around the value are ignored) hides every write tool: they are not registered, so the client does not list them. Reads still work. |
ORDAINER_BASE_URL |
Unset (or blank) means https://api.ordainer.dev. A blank value also writes one info line to stderr: [ordainer-mcp] info: ORDAINER_BASE_URL is blank, using default (https://api.ordainer.dev). Unset does not write that line. Otherwise it must be https://…, or http:// only for localhost, 127.0.0.1, or [::1], with no ?, #, or control character. Percent-encoded %3F and %23 in the path are allowed. A typo (including a trailing ? or #) is a configuration error: every tool answers config_invalid and no request is made. It never falls back to production. |
ORDAINER_CONSOLE_URL |
Only for the link in key results. If unset or blank, the server builds the link from the API URL. It keeps the scheme and port and drops the path: when the API host starts with api. followed by a name (for example api.ordainer.dev), that prefix is replaced with console. and /console is appended; any other host, including localhost, 127.0.0.1, and [::1], keeps the API origin and appends /console. Key results add /keys. With the default API URL, console_url in a key result is therefore https://console.ordainer.dev/console/keys, exactly as the tool returns it. That address is the console Keys page; a request without a session is sent to sign in (HTTP 303 to /login). If you set this variable, it must be https://…, or http:// only for localhost, 127.0.0.1, or [::1], with no user name, password, ?, #, space, backslash, invisible or control character, and at most 2,048 characters (a path such as /console is fine, and trailing slashes are removed). The link uses the address as parsed, so case and a default :443 are normalised. Any other value is a configuration error, handled like a bad ORDAINER_BASE_URL: it is logged at start, every tool answers config_invalid, and no request is made. It never falls back to the default. The tool message is ORDAINER_CONSOLE_URL is set, but it isn't a valid console address: it <reason>. To be safe, this server won't run any tool until it's fixed. No request was made and nothing was changed. The fix is Set ORDAINER_CONSOLE_URL to a full https:// address, such as https://console.ordainer.dev/console, or unset it to use the default console link for your API host. Then restart the MCP server. |
If ORDAINER_ADMIN_KEY is missing, the server still starts and every tool answers auth_failed with the fix.
The server’s working folder is the directory the client starts it in (often your project root). create_key and rotate_key write .env files inside that working folder. If your client has a cwd field, set it to the project that should receive the file.
What you get
Section titled “What you get”Reads (no confirm): list_customers, list_plans, list_keys, get_key_usage, list_decisions, list_changes.
Writes (preview, then you accept): create_customer, create_plan, set_cap, set_mode, create_key, rotate_key.
All 12 tools, with inputs and outputs.
Resources: ordainer://docs/concepts, ordainer://org/summary. Prompts you can pick in the client: onboard_integration, shadow_to_enforce_review, investigate_deny. See Example prompts.
Windows and PowerShell
Section titled “Windows and PowerShell”JSON config files (Cursor, Claude Desktop, VS Code, Windsurf). On Windows, npx is a batch file (npx.cmd), and some clients cannot start a batch file by its bare name. If your client shows spawn npx ENOENT or “Connection closed”, run npx through cmd /c. The MCP project’s own reference servers document the same wrapper:
{ "mcpServers": { "ordainer": { "command": "cmd", "args": ["/c", "npx", "-y", "ordainer-mcp@0.1.1"], "env": { "ORDAINER_ADMIN_KEY": "ord_admin_..." } } }}Use the same command and args in the other config shapes on this page, and keep each client’s own env form.
PowerShell. Set an environment variable for the current window with $env:NAME = "value", for example $env:ORDAINER_ADMIN_KEY = Read-Host "Paste your admin key". It is gone when you close the window. If PowerShell stops with “running scripts is disabled” when you type npx yourself, use npx.cmd instead, or allow local scripts for your account with Set-ExecutionPolicy -Scope CurrentUser RemoteSigned.
Where to find it
Section titled “Where to find it”- npm:
ordainer-mcp, version 0.1.1, with the executableordainer-mcp. - Official MCP Registry:
ai.ordainer/mcp, version 0.1.1, run as annpmpackage overstdio. See the listing.
The examples on this page name version 0.1.1. Leave off @0.1.1 to follow the latest published version.