> Documentation index: https://metorial.com/llms.txt. Every page is available as Markdown by adding .md to its URL.

# Metorial error messages: what each one means and the fix
URL: https://metorial.com/docs/platform/troubleshooting/error-reference

Look up a Metorial error by its exact text. Covers MCP endpoint, OAuth, portal access, tool call, and CLI errors, each with its HTTP status, cause, and fix.

---

Search this page for the exact text of the error. Each entry gives the HTTP status or error code, the cause, and the fix. Errors from the SDKs are on [Error handling](https://metorial.com/docs/build/sdk/error-handling).

**What you'll learn**

* What each Metorial error message means
* The command or setting that fixes it
* Which errors are for the person and which for an admin

**Before you start**

* The CLI for your own account: `npm install -g @metorial/cli`, then `metorial login`
* For admin fixes, the admin CLI: `npm install -g @metorial/admin`, then `metorial-admin login`

## MCP endpoint errors

A client gets these when it connects to a Magic MCP URL. HTTP errors carry a JSON body with `code` and `message`.

### `Missing access token. Please provide a valid token in the "Authorization" header or as a "token" query parameter.`

Status `401`. The request carried no token. This is the normal first answer, and a client that supports OAuth starts the sign-in from it. If you see it as an error, sign in from the client, for example `claude mcp login metorial` or `codex mcp login metorial`.

### `Invalid magic MCP token`

Status `401`. Metorial does not accept the token. It was revoked or deleted, or it belongs to another portal. Sign in again from the client. For a client set up with `metorial install`, issue a new token:

```bash
metorial tokens list
metorial install <client-identifier> <integration-id>
```

### `Magic MCP token has expired`

Status `401`. The access token from an OAuth sign-in is past its 30 days and the client did not refresh it. Sign in again from the client.

### `Magic MCP token does not have access to this target`

Status `403`. The token was issued for another integration than the one in the URL, or your groups no longer allow the integration. Check your access, then use the URL and token that belong together. `metorial install custom` prints both:

```bash
metorial whoami
metorial list
metorial install custom <integration-id>
```

### `The magic MCP token is linked to a magic MCP server that is no longer active`

Status `401`. The integration behind the token was removed. Set it up again and connect the client to the new one:

```bash
metorial setup
metorial install <client-identifier> <integration-id>
```

### `Magic MCP token or API key is required`

Status `401`. A request to a Magic MCP server's URL carried no credential. Send the token in the `key` query parameter, or an API key as `Authorization: Bearer <api-key>`.

### `Instance-scoped API key required for MCP connections`

Status `403`. You connected with an organization-scoped API key. MCP connections need a key that belongs to one instance. List the instances and the keys of one:

```bash
metorial-admin instance list
metorial-admin api-keys list --instance-id <instance-id>
```

### `Invalid API key`

Status `401`. Metorial does not know the key. `API key is expired or has been revoked` means it did exist. Copy a current key from the dashboard, or sign in with `metorial login` for CLI use.

### `This API key is not allowed from your IP address`

Status `401`. The key has IP filters, and your address is not in them. Call from an allowed address, or have an admin change the key's IP filters.

### `Ingress network policy blocked this connection`

Status `403`, code `ingress_network_policy_blocked`. A network policy of the project does not allow connections from your IP address. Connect from an allowed network, or have an admin review the rules:

```bash
metorial-admin network policies list
```

### `Connection has expired`

Status `410`. The MCP connection is gone. `Connection has been disabled`, `Connection has been archived`, and `Session has been archived or deleted` are the same case. Reconnect the client so it opens a new connection: `/mcp` and **Reconnect** in Claude Code, a new session in Codex, off and on under **Customize** in Cursor.

### `Bad Request: Server not initialized`

Status `400`, JSON-RPC code `-32000`. A client that supports the 2026-07-28 MCP protocol sent a request without an initialize handshake, and sessionless MCP is off for the project. Such clients fall back to the standard handshake. If yours does not, reconnect it, or have an admin turn on **Allow sessionless MCP connections** under **Integrations and MCP**, **MCP Configuration**, **Sessionless MCP**.

### `No response produced for MCP request`

JSON-RPC code `-32603`. Metorial processed the request and had no answer to send. Retry the request. If it repeats, an admin looks for the session's errors:

```bash
metorial-admin sessions errors list --limit 20
```

## OAuth and sign-in errors

Metorial returns these while a client signs in. The body has `error` with the OAuth error code and `error_message` with the text.

### `redirect_uri is not allowed for this portal`

Status `400`. The portal does not allow the address the client returns to after the sign-in. Read it from the `redirect_uri` parameter of the authorize URL the client opened, then enable the one option that covers it.

| Redirect URI                                                                                    | Option                   | Pattern                  |
| ----------------------------------------------------------------------------------------------- | ------------------------ | ------------------------ |
| `http://localhost:<port>/…` or `http://127.0.0.1:<port>/…` (Claude Code, Codex, Cursor desktop) | **Localhost apps**       | `http://localhost:*/*`   |
| `http://<name>.localhost:<port>/…`                                                              | **Localhost subdomains** | `http://*.localhost:*/*` |
| `https://<host>/…` (ChatGPT, Claude, Cursor web)                                                | **Secure web apps**      | `https://*/*`            |
| A custom protocol such as `myapp://callback`                                                    | **Native app deeplinks** | `*://*`                  |

A portal admin enables the option under **Settings**, **Client Settings**, **Allowed OAuth Redirects**. From the CLI:

```bash
metorial-admin portals list
metorial-admin portals get <portal-id>
metorial-admin portals update <portal-id> \
  --allowed-redirect-url-filters '[{"url":"http://localhost:*/*"}]'
```

The command replaces the portal's whole list. Run `portals get` first and add the patterns your other clients still need.

### `Invalid redirect URI`

Status `400`. The callback in the request is not one the client registered. Remove the Metorial server from the client and add it again.

### `Invalid oauth client`

Status `401`, error `invalid_client`. Metorial does not know the client ID. The registration is for another portal, or it expired after three months without use. Remove the Metorial server from the client, add it again, and sign in.

### `Too many OAuth client registrations from this IP address`

Status `429`. More than 25 clients registered from one IP address within a minute, or more than 500 within an hour. Wait a minute and connect again.

### `Authorization code has expired`

Status `400`, error `invalid_grant`. The client took more than 10 minutes to exchange the code after you approved. `Authorization code has already been used` and `Invalid authorization code` have the same fix: start the sign-in again from the client.

### `Invalid refresh token`

Status `400`, error `invalid_grant`. The refresh token is unknown or was already used. Each one works once. Sign in again from the client.

### `The authorization has expired`

Status `400`, error `invalid_grant`. More than 30 days passed since the last refresh. `The linked magic MCP token is no longer active` means the token was revoked in Metorial. For both, sign in again from the client.

### `Only S256 PKCE challenges are supported`

Status `400`. The client sent a `code_challenge_method` other than `S256`. `code_challenge is required for public clients` means a client without a secret sent no PKCE challenge. Both are bugs in the client. If you build the client, send `code_challenge_method=S256` with a `code_challenge` on every authorization request.

### `Select at least one Magic MCP server before approving this OAuth authorization.`

Status `412`. You continued on the consent screen without an integration. Select one and continue. `This OAuth authorization is no longer pending.` means the request was already approved or rejected, so start the connection again from the client.

## Portal access errors

### `This email address is not allowed to access this portal.`

Status `403`. The portal limits sign-ins to listed addresses or domains, and yours is not listed. `This invite has expired.` and `This invite is no longer valid.` mean you have no open invitation. A portal admin invites you:

```bash
metorial-admin portals list
metorial-admin portals invites create <portal-id> --email <person@example.com> --name "<name>"
```

### `Portal SSO state is invalid or has expired.`

Status `401`. The SSO sign-in came back without the state Metorial stored in a cookie when it started. Start the sign-in again from the portal's own page, in the same browser, with cookies allowed.

### `Your organization does not have access to Metorial Portals.`

Status `402`. The organization's plan does not include portals. The organization's owner changes the plan. See [pricing](https://metorial.com/pricing).

## Tool call errors

Metorial returns these as JSON-RPC errors with code `-32000`. `data.code` holds the code named in each entry.

### `The credentials for this MCP server have expired and could not be refreshed. The connection needs to be re-authenticated.`

Code `provider_auth_expired`. The app refused to refresh your OAuth token. `The MCP server rejected the configured credentials. The connection needs to be re-authenticated.` has the code `provider_auth_failed` and the same fix. Connect your account again:

```bash
metorial list
metorial catalog list
metorial reconnect <catalog-item-id> <integration-id>
```

### `The MCP server could not be reached. It may be offline, or its URL or command may be misconfigured.`

Code `provider_unreachable`. The server refused the connection or answered `502`, `503`, or `504`. Retry later. Check whether it answers at all:

```bash
metorial tools <integration-id>
```

### `The MCP server did not respond to the request in time.`

Code `provider_request_timeout`. The app took too long. `The MCP server did not accept a connection in time. It may be offline, overloaded, or slow to start.` has the code `provider_connect_timeout`. Retry once, and check in the app first if the call was a write.

### `The MCP server is currently rejecting requests because it is overloaded.`

Code `provider_overloaded`. The app answered `429`, its own rate limit. Wait and retry.

### `The connection to the MCP server was closed before the request completed.`

Code `provider_closed`. The server dropped the connection during the call. Check in the app whether the action happened before you retry a write.

### `The connection to the MCP server was blocked by the configured network egress policy.`

Code `egress_policy_blocked`. A network egress policy does not let Metorial call this server. An admin reviews the policy and allows the server's host.

### `The MCP server returned a response that does not conform to the Model Context Protocol.`

Code `provider_protocol_error`. The server sent invalid MCP. `The MCP server reported an error.` has the code `provider_error` and carries the server's own text in parentheses.

### `The request exceeded the configured tenant timeout of <N>ms.`

Code `timeout`. The app did not answer within the project's limit of `<N>` milliseconds, 30000 by default. Ask for less data per call. An admin raises the limit under **Integrations and MCP**, **MCP Configuration**, **Tool Calling**, **Message processing timeout**, up to 10 minutes.

### `The tool calls rate limit for this project has been reached.`

Code `rate_limit_exceeded`. The project made more tool calls than its limit allows. The error's hint names the wait in seconds. Wait that long and retry.

### `Tool access not allowed`

A tool filter rejects this tool, and the client called it from an old tool list. Reconnect the client to refresh the list. An admin allows the tool in the integration's **Tool Filters**.

### `Tool requires scopes that have not been granted to this credential`

Your connected account has fewer OAuth scopes than the tool needs. Run `metorial reconnect <catalog-item-id> <integration-id>` and approve the scopes at the app.

### `Tool is not available for this authentication method`

The integration uses an authentication method this tool does not support. An admin configures the integration with a method that supports it.

### `Tool not callable (not discovered yet)`

Metorial has not finished reading this integration's tools. Retry in a minute.

### `Could not connect to the MCP server "<name>" because the connection timed out.`

JSON-RPC code `-32603`. Metorial could not connect to one integration. The sentence can also end with `the connection could not be established (<code>)`, `the provider returned an error (<code>)`, or `its capabilities could not be discovered`. An admin checks the server's URL and credentials, and lists the failures:

```bash
metorial-admin sessions errors list --type provider_discovery_failed --limit 20
```

## Metorial CLI errors

### `unknown command "integrations" for "metorial"`

Older guides show commands that start with `metorial integrations`. CLI 0.1.9 has no `integrations` group. Drop the word:

| Old command                     | Current command                                         |
| ------------------------------- | ------------------------------------------------------- |
| `metorial integrations setup`   | `metorial setup [catalog-item-id]`                      |
| `metorial integrations list`    | `metorial list`                                         |
| `metorial integrations tools`   | `metorial tools <integration-id>`                       |
| `metorial integrations schema`  | `metorial schema <integration-id> <tool-key>`           |
| `metorial integrations call`    | `metorial call <integration-id> <tool-key> -d '{}'`     |
| `metorial integrations install` | `metorial install <client-identifier> <integration-id>` |

`metorial client list` prints the client identifiers.

### `unknown command "agent-hooks" for "metorial"`

CLI 0.1.9 has no `agent-hooks` command. Upgrade the CLI and check which commands your version has:

```bash
metorial upgrade
metorial --help
```

### `Authentication Required`

The CLI has no saved profile. The message continues: "Sign in with `metorial login` to use your saved profile on this machine."

```bash
metorial login
metorial whoami
```

For a one-off request, pass `--api-key` or set `METORIAL_API_KEY`.

### `metorial: your portal session is no longer valid:`

The saved profile or the key was rejected. The reason follows the colon. `metorial: the current profile <name> has expired or was revoked.` is the same case for a saved profile. Sign in again:

```bash
metorial login
```

### `metorial: sign-in was cancelled. Run "metorial login" to try again`

The browser sign-in was denied or closed. The CLI signs you in to a portal. If the browser offered no portal to pick, an admin has to invite you to one first:

```bash
metorial-admin portals invites create <portal-id> --email <person@example.com> --name "<name>"
```

### `metorial: the login session expired before it was completed. Run "metorial login" to try again`

You did not finish the browser sign-in in time. `metorial: the login session is no longer valid. Run "metorial login" to start a new one` is the same case. Run `metorial login` and approve it in the browser right away.

### `metorial: CLI login is not enabled on this host`

The API host you are using does not offer CLI sign-in. Check the `--api-host` flag. The default is `api.metorial.com`.

### `metorial: unknown client`

`metorial install` does not know the client identifier you passed. The message lists the ones it knows. Print them with their install status:

```bash
metorial client list
metorial install claude-code <integration-id>
```

### `metorial: you don't have access to <name> yet. Run "metorial request-access <id>" to ask for it`

Your groups do not allow this catalog item. Ask your portal admins for it:

```bash
metorial request-access <catalog-item-id> -m "Need this for the support queue"
```

### `metorial: you have no integrations for <name> yet. Run "metorial setup <id>" to create one`

You have access to the catalog item and have not connected it. Run the command the message prints, then check with `metorial list`.

### `metorial: setup session <id> expired before it was completed`

You did not finish the app's sign-in in time. Run `metorial setup <catalog-item-id>` again.

## SSO, SCIM, and self-hosting errors

These have their own pages, with one entry per message:

| Messages                                                                                                                                                                                                         | Page                                                                                                      |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| `This email domain is not configured`, `Metorial could not authenticate you.`, `Metorial could not verify your SAML response.`, `SSO connection is not available.`, `You do not have access to this application` | [SSO and SCIM errors](https://metorial.com/docs/platform/troubleshooting/sso-and-scim-errors)             |
| `SCIM group display name is required`, `Every SCIM group member must have a value`, `SCIM group references unknown users:`                                                                                       | [SSO and SCIM errors](https://metorial.com/docs/platform/troubleshooting/sso-and-scim-errors#scim-errors) |
| `Host is required!`, `Secret is required!`, `Docker daemon is not running!`, `Failed to start backend services`                                                                                                  | [Self-hosting problems](https://metorial.com/docs/platform/troubleshooting/self-hosting)                  |

## Next steps

* [Symptom finder](https://metorial.com/docs/platform/troubleshooting): start from what you see instead of the error text
* [Tool calls fail](https://metorial.com/docs/platform/troubleshooting/tool-calls-fail): timeouts, limits, and how to find a call in the logs
* [Error handling in the SDKs](https://metorial.com/docs/build/sdk/error-handling): the error classes the SDKs raise