Skip to content

Error results are a tool result, not a protocol failure. The text is:

<code>: <message> Fix: <fix>
{…the same body as JSON…}

There is no structuredContent on an error, so a client that validates results against the success schema still shows the refusal instead of a schema error. Codes are stable; messages may change. request_id is present when the admin API returned one. retryable tells you whether a later retry of the same call is reasonable (it is not, for writes that already ran).

The server does not appear, or every tool fails at once

Section titled “The server does not appear, or every tool fails at once”

The client has no Ordainer tools. Check that the client’s command is npx with the arguments -y and ordainer-mcp@0.1.1, that npx --version works in a terminal, and that you are on Node 20+ (node -v). On Windows, see Windows and PowerShell. Fully quit and reopen Claude Desktop. Refresh Cascade after editing Windsurf’s config. In Cursor, open MCP Logs from the Output panel. The process writes diagnostics to stderr ([ordainer-mcp] …).

Every tool returns auth_failed. ORDAINER_ADMIN_KEY is missing, malformed, refused, or revoked. The server still starts without a key.

When message fix
No key in the environment No admin key is set. Set ORDAINER_ADMIN_KEY; the account owner creates it in Console → Admin keys.
Wrong shape (not ord_admin_ plus 43 characters). This includes an agent key (ord_test_…) pasted in by mistake: it is refused here, and nothing is sent to the API ORDAINER_ADMIN_KEY is not shaped like an admin key (ord_admin_ followed by 43 characters). Check ORDAINER_ADMIN_KEY: it must be the ord_admin_ key the account owner created in Console → Admin keys. Nothing was changed.
The API returned 401 missing_key No admin key was sent. Same as the missing-key fix
The API returned 401 otherwise The admin key was refused. This admin key no longer works (unknown, past 90 days, or revoked). Ask the owner for a new one; nothing was changed.

The fix strings in that table are what ordainer-mcp@0.1.1 returns today. The form itself is on Console → Keys, under Admin keys at the bottom.

Every tool returns config_invalid. This happens when ORDAINER_BASE_URL is set to a non-empty invalid value, or when ORDAINER_CONSOLE_URL is set to a non-empty invalid value. In both cases the server fails closed: no request is made, and the value is never replaced with the default.

When it is ORDAINER_BASE_URL, the value is not a valid https:// URL, or an http:// URL for localhost, 127.0.0.1, or [::1]. User names, passwords, a query string (?), a # fragment, and control characters are rejected, including a trailing bare ? or # (for example https://host.example?). Percent-encoded %3F and %23 in the path are allowed. The server does not fall back to production.

message looks like ORDAINER_BASE_URL <reason>. No request was made.

For a ?, #, or control character, that message is:

ORDAINER_BASE_URL must not contain a query string, a #fragment, or a control character. No request was made.

The other <reason> strings from src/config.js:66-84 are: must start with https:// (http:// is allowed only for localhost, 127.0.0.1 or [::1]); must not contain a user name or password; must not contain a query string or a #fragment (a second check after the URL is parsed); has no host name; is not a valid URL (expected something like https://api.ordainer.dev).

fix:

Fix ORDAINER_BASE_URL in the server's environment (or remove it to use https://api.ordainer.dev) and restart the server. Nothing was changed.

A blank or whitespace-only ORDAINER_BASE_URL is not config_invalid. It uses the production default and writes exactly one stderr line (unset does not write this line):

[ordainer-mcp] info: ORDAINER_BASE_URL is blank, using default (https://api.ordainer.dev).

When the value is invalid, stderr also has:

[ordainer-mcp] error: ORDAINER_BASE_URL is not usable; every tool will answer config_invalid and no request will be made until it is fixed.

When it is ORDAINER_CONSOLE_URL, a set value must be a valid https:// address, or http:// only for localhost, 127.0.0.1, or [::1]. User names, passwords, a query string (?), a # fragment, spaces, backslashes, control or invisible characters, and values longer than 2,048 characters are refused. 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. Unset or blank is not config_invalid: the server derives the default from the API URL and does not write an extra stderr line.

message:

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 <reason> strings from src/config.js:36-47 are: must not contain a query string, a #fragment, or a control character; is longer than 2,048 characters; must not contain spaces, backslashes or invisible characters; is not a valid URL (expected something like https://console.ordainer.dev/console); must start with https:// (http:// is allowed only for localhost, 127.0.0.1 or [::1]); must not contain a user name or password; must not contain a query string or a #fragment; has no host name.

fix:

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.

When the value is invalid, stderr has:

[ordainer-mcp] error: ORDAINER_CONSOLE_URL is set, but it isn't a valid console address: it <reason>. Every tool will answer config_invalid and make no request until you fix it. Set it to a full https:// address (such as https://console.ordainer.dev/console), or unset it to use the default console link, then restart the MCP server.

wrong_key_type. You will normally not see this code. An agent key (ord_test_…) in ORDAINER_ADMIN_KEY does not have the ord_admin_ shape, so the server refuses it before any request and the result is auth_failed with the wrong-shape message in the table above. wrong_key_type appears only if the Ordainer API itself answers 403 agent_key_forbidden to a key the server sent. In a live check, an agent key sent straight to the admin API (not through this server) got 403 agent_key_forbidden with the message This is an agent key. Admin routes need an admin key (ord_admin_…).; through the server, the same key in ORDAINER_ADMIN_KEY gave auth_failed with the wrong-shape message and no request was sent.

If it does appear: message: An agent key was used where an admin key is needed. fix: That is an agent key (ord_test_). This server needs an ord_admin_ key.

The write tools are missing. The server was started with ORDAINER_MCP_READ_ONLY set to true (or 1, yes, on). Write tools are not registered at all in this mode, so your client lists only the six read tools (list_customers, list_plans, list_keys, get_key_usage, list_decisions, list_changes). If you or the agent ask for one by name anyway, the client itself reports that the tool is not available or was not found (the MCP SDK client over stdio printed Tool create_customer not found; other clients may word it differently). That is a client message, not an Ordainer error code. Reads still work. At start-up the server writes one stderr line, [ordainer-mcp] info: read-only: write tools are not registered. Restart with the variable unset to see the write tools again.

missing_scope. The admin key does not include a scope this tool needs. Nothing was changed, and a preview is not shown. plans:write is not enough for set_mode (needs plans:mode). rotate_key needs keys:write and keys:revoke.

message (typical): This admin key lacks <scope> [and <scope>].

fix (typical): Ask the account owner for an admin key that includes <scope> (plans:write is not enough), or keep this agent read-only. Nothing was changed, and reads still work.

confirm_unsupported. This client cannot show a confirmation form. The write tools are still listed; they change nothing. There is no “type this code” fallback.

message: This app can't show a confirmation, so changes are off here. Nothing was changed.

fix: This app can't show a confirmation, so changes are off here. Use the console or an app that supports MCP elicitation.

Nothing in this table changes the account.

Code message fix
confirm_declined The person declined, so nothing changed. Nothing changed. Ask the person what they would like to change.
confirm_expired The confirmation expired, so nothing changed. Call <tool> again for a fresh preview.
confirm_used This confirmation was already used, so nothing changed. Call <tool> again for a fresh preview.
confirm_invalid The confirmation could not be verified, so nothing changed. / The confirmation does not match this request, so nothing changed. / No answer to the confirmation arrived, so nothing changed. Call <tool> again for a fresh preview.
stale_preview This changed since you saw the preview, so nothing changed. Show the new preview and call <tool> again. The new preview is included on the result.

The form expires after 15 minutes (CONFIRM_TTL_SECONDS in src/confirm.js).

The confirm_declined message above (decline, cancel, and an unticked box all gave it) and the confirm_unsupported message in the previous section were checked in a live run. The other messages in this table come from the source code, not from a live run: confirm_expired and confirm_used were not run (they need a 15-minute wait and a replayed confirmation), and confirm_invalid and stale_preview were not captured.

These are returned by create_key and rotate_key. Unless the message says the key was already created or rotated, nothing was changed.

Code When Typical message Typical fix
env_label_invalid env_label sanitises to nothing, or starts with ADMIN That label can't be used for a variable name. That label can't be used for a variable name (empty, or starts with ADMIN). Choose another env_label.
env_file_invalid Path outside the working folder, not an env-looking name, a symlink, the file holds ORDAINER_ADMIN_KEY, or the name (including the real path resolved through a symlink) has a control or invisible character. The refusal happens before any key is created. The env file name has a control or invisible character in it. / The env file must be a path inside the working folder. / The env file must be inside the working folder. / The env file name must be .env, .env.<name>, or end in .env. / That env file is a symbolic link; this server does not write through links. / That file holds ORDAINER_ADMIN_KEY; this server never writes an agent key into it. Name an env file inside the working folder, such as .env or .env.email-send. (or the more specific fix on the result)
env_key_exists create_key and the variable already exists in that file That file already has <VAR>, so nothing was created. That file already has <VAR>, so nothing was created. Name a new file with env_file (e.g. .env.email-send), pass env_label for a second key in this file, or rotate the existing key with rotate_key.
env_key_mismatch rotate_key and the file does not hold exactly this key That file does not hold this key, so nothing was rotated. / That file holds this key more than once, so nothing was rotated. That file's key is a different one (or the file does not hold this key), so nothing was rotated. Name the file that holds this key, or a new file.
env_write_failed Permissions or a missing folder, before the admin call The folder for that env file does not exist, so nothing was created. / That env file can't be written, so nothing was created. Create the folder or name a file in an existing folder, then try again. / Fix the path or permissions, or name another file with env_file, then try again.
env_write_failed The key was created or rotated, but the file could not be written The key was created but its env file could not be written. The secret was discarded and is never shown. (or the rotate wording) Fix the path or permissions, then call rotate_key on this key id to get a new key into a file, or revoke it in the console. The secret was not shown. On rotate, the old key is already revoked: call rotate_key on the new key id. The result includes key_id.
Code When Typical message Typical fix retryable
invalid_input Bad arguments, a bad cursor, would_deny_only combined with a conflicting filter, a cap or mode that is already set, a plan that belongs to a different customer, a revoked key passed to rotate_key Depends on the check (for a cursor: That cursor is not valid.) The result names the field or the next tool. For a cursor: Pass the next_cursor from the previous page of the same tool and filters, or leave cursor out to start again. no
not_found Unknown id in this organization No <customer/plan/key> with that id in this organization. Check the id with list_customers / list_plans / list_keys. no
conflict The API returned 409 for another reason The API message, or That conflicts with the current state. Re-read with the matching list tool, then try again. no
live_key_refused The plan has a live key, or a live-key request was refused This plan has a live key. (or the API message) This plan has a live key, so it can't be changed through the admin API during the beta. Nothing changed. no
internal_idempotency The request id clashed with an earlier, different change, or was not accepted The request id clashed with an earlier, different change. / The request id was not accepted. Start again from a new preview. Report this with the request_id. no
too_many_failed_auth Too many failed admin sign-ins from this address (HTTP 429) Too many failed admin sign-ins from this address. Fix the admin key first, then wait a minute. no
rate_limited This admin key made too many calls this minute (HTTP 429) Ordainer is rate-limiting this admin key. Too many calls this minute. Wait [<n> seconds] and try again; reads still work. May include retry_after_s. yes
api_unavailable Timeout, network error, 5xx, or an unexpected body on a read; or a decisions read timed out Ordainer did not answer in time. / Ordainer answered with a server error. / The decisions read timed out. / Ordainer did not return usage for a key. Try again shortly. This is not an empty result. For decisions: Wait, then retry with a narrower filter or a smaller page. Usage is never reported as zero when it could not be read. yes
write_outcome_unknown Timeout, network error, or 5xx on a write The server did not get an answer, so the change may or may not have applied. / Ordainer answered with a server error, so the change may or may not have applied. The change may or may not have applied. Call list_changes before trying again. Do not retry the same confirmation. no
internal_error An unexpected failure in the server The server hit an unexpected problem. Nothing was changed by this tool call that it knows of. Try again; if it repeats, report it. For a write, next_tool is list_changes. no
api_error Any other HTTP answer Ordainer answered <status>. or the API message Report this with the request_id. no
  • Windows: the client cannot start npx. If it shows spawn npx ENOENT or “Connection closed”, use "command": "cmd" with "args": ["/c", "npx", "-y", "ordainer-mcp@0.1.1"]. See Windows and PowerShell.
  • .env was written in the wrong folder. The file is created in the server process’s working directory, which is whatever the client started it in. Set cwd if the client supports it, or pass env_file carefully.
  • npx -y ordainer-mcp@0.1.1 fails. Check that the name is spelled ordainer-mcp, that Node is 20 or later, and that the machine can reach the npm registry: npx downloads the package the first time it runs. See the quickstart.
  • A write looks like it hung after you accepted. Do not click accept again. Call list_changes. If the result is write_outcome_unknown, start from a new preview only after you have looked at the log.