# Troubleshoot MCP errors

Source: [Troubleshoot MCP errors](<https://docs.gptunnel.ru/en/mcp/troubleshooting/>)

<a id="_top"></a>
If the client can see gallery collections but cannot find `lab_quote`, check the server URL and `tools/list`. The catalog endpoint `/mcp/claude` provides access to the media library. Quotes require the main endpoint `/mcp` and `lab:read`. On a `401` response, the `WWW-Authenticate` header links to metadata for the resource you requested.

<a id="connectivity"></a>
## Connectivity

| Symptom | Cause | What to do |
| --- | --- | --- |
| `401 Unauthorized` | The key is incorrect, revoked or expired, or the OAuth connection was revoked | Create or reissue a key in [Profile → MCP](<https://gptunnel.ru/profile/mcp>). For OAuth, reconnect the server in your client and sign in again |
| `403 Forbidden`, or “No access to MCP” on the sign-in screen | MCP is unavailable to the account, the account is blocked, or your organization membership is inactive | Check whether your profile has an **MCP** tab. A missing tab means MCP access is unavailable |
| The sign-in browser window does not open | The client does not support OAuth or the browser blocked sign-in | Use an [MCP key](<https://docs.gptunnel.ru/en/mcp/keys/>) in the `Authorization` header |
| The client reports an issue with `sse` or `stdio` | The client is using a different transport | Select **HTTP / Streamable HTTP**. For clients that support only `stdio`, use `mcp-remote`. See [Connect MCP clients](<https://docs.gptunnel.ru/en/mcp/connect/>) |
| `405 Method Not Allowed` | The client is trying to open a GET stream | The server accepts `POST`. Update the client or select Streamable HTTP |
| `429 Too Many Requests` | The request rate limit was exceeded | Wait for the number of seconds in `Retry-After`. See [Request rate limits](<https://docs.gptunnel.ru/en/mcp/billing/#request-frequency-limits>) |
| `413` | The request is larger than 16 MB | Use a URL (`url`) for large files in `upload_media` |

<a id="agent-cant-see-the-tool"></a>
## Agent can’t see the tool

Tools are visible only if the connection has the required permissions. Ask the agent to call `whoami` and compare its permissions with the [tools reference](<https://docs.gptunnel.ru/en/mcp/tools/>).

- Missing `lab_generate`, `app_run` or `run_workflow` means the key lacks execution permissions. New keys do not have these by default.
- Missing `gallery_*` or `apps_*` means the key lacks permissions for that part of the API.

Permissions on an issued key are fixed. Reissuing a key retains its permissions. Create a key with the permissions you need, revoke the old key and reconnect the server in the client. Clients often cache the tool list.

<a id="errors-in-tools"></a>
## Errors in tools

Tool errors use the format `[CODE] description`.

| Code | Meaning | What to do |
| --- | --- | --- |
| `MAX_COST_EXCEEDED` | The price exceeds `max_cost_rub` | No charge was made. Get the price using `lab_quote` or read it in the error. Retry with a new cap if the user agrees |
| `MCP_BUDGET_EXCEEDED` | The task would exceed the connection’s daily or monthly spending limit | No charge was made. Wait until the limit resets at 00:00 Moscow time or increase it in your profile |
| `MCP_ORG_BALANCE_NOT_ALLOWED` | The connection cannot spend from the organization’s balance | Omit `org_id` to use the personal balance or allow organization spending in the connection’s limits |
| `LOW_BALANCE`, `ORG_LOW_BALANCE` | The available balance is too low | Add funds on the website |
| `FREE_CAMPAIGN_ONLY` | The model is available only through a free campaign, and today’s quota has been used | Try again tomorrow or choose another model |
| `RATE_LIMITED` <a id="mcp-rate-limited"></a> | Too many consecutive paid calls or uploads | Wait for the time shown in the error |
| `PROMPT_TOO_LONG` | The prompt exceeds the model’s limit | Shorten it. Use `lab_get_model` to check the limit |
| `FILE_TOO_LARGE` | The file exceeds 50 MB when passed by URL or 10 MB in base64 | Compress the file or pass it by URL |
| `MEDIA_URL_NOT_ALLOWED`, `MEDIA_URL_INVALID`, `MEDIA_URL_UNRESOLVABLE`, `MEDIA_URL_FETCH_FAILED` | `upload_media` could not fetch the file. The URL may be private, use another protocol, have an invalid domain or fail to return the file | Provide a direct public HTTP or HTTPS URL, or send the file as base64 |
| `NOT_FOUND` | The requested object does not exist or is outside your account | Check its ID with the relevant `list_*` tool |
| `FORBIDDEN` | The connection lacks access to the object | Use objects accessible to you or your organization |
| `FEATURE_DISABLED` | The feature is unavailable to the account | — |

 <a id="генерация-или-прогон"></a>
 <a id="generation-or-launch-of-a-wrcflow"></a>
 
<a id="generation-or-workflow-run"></a>
## Generation or workflow run

| Symptom | What to do |
| --- | --- |
| A generation stays in `queued` | Keep polling. The provider may have a queue. Video generation can take 5–15 minutes |
| A generation returns `failed` | Read the `error` field from `lab_get_generation`. Common causes include moderation of the prompt or image by the provider and an unsupported input file format. The refund appears in **Spending history** |
| A workflow node returns `failed` | Read the error from `get_execution`, fix the graph and run `run_workflow` with `from_node_id`. For a one-off failure, use `retry_node` |
| A node stays in `running` for more than 15 minutes | Call `cancel_execution`, then `run_workflow` with `from_node_id` |
| An uploaded file link stops working | Files uploaded without `workflow_id` expire after 48 hours. Pass `workflow_id` for files used in a workflow |
| A generation was charged twice | Check the key’s **Spending history**. A retry with a new `request_id` starts a new task. If a charge is incorrect, email [support@gptunnel.ai](<mailto:support@gptunnel.ai>) with the generation ID |

If you still need help, email [support@gptunnel.ai](<mailto:support@gptunnel.ai>) with the time of the request, the tool name and the error message. Keep the token out of the message.
