# MCP keys

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

<a id="_top"></a>
An MCP key is a `gtmcp_…` token for clients that connect without a browser, such as servers, CI jobs and tools that do not support [OAuth sign-in](<https://docs.gptunnel.ru/en/mcp/oauth/>). Each key has its own permissions, spending limits and expiration.

<a id="creating-a-key"></a>
## Creating a Key

1. Open [Profile → MCP](<https://gptunnel.ru/profile/mcp>) and select **New**.
2. Give the key a clear name, for example `n8n production` or `Cursor on my laptop`.
3. Select the permissions, expiration and spending limits.
4. Copy the token and save it in a password manager or an environment variable.

> **Caution: Token is shown once**
>
> GPTunneL stores only a hash of the token. If you lose the token, reissue the key.

Send the token in the `Authorization` header with every request.

```plaintext
Authorization: Bearer gtmcp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```

<a id="rights"></a>
## Rights

Choose permissions for each section based on what the key needs to do. For example, select **Read** in **Gallery** to generate a gallery report.

| Section | Levels | What they allow |
| --- | --- | --- |
| **Workflow** | None / Read / Write / Full | **Read** (`workflow:read`) lists workflows and reads their graphs and run status. **Write** (`workflow:write`) creates, edits and deletes workflows, copies templates and uploads files. **Full** grants both |
| **Launch** (under **Workflow**) | Off / On | `workflow:execute` starts or cancels runs and retries or resets nodes. Starting runs and retrying nodes can **charge your balance** |
| **Creative Lab** | None / Read / Full | **Read** (`lab:read`) lists models, quotes prices and checks generation status. **Full** adds `lab:generate`, which can **charge your balance** when you generate media |
| **Gallery** | None / Read / Full | **Read** (`gallery:read`) views your generations and collections. **Full** adds `gallery:write` to manage them. Gallery operations are free |
| **Apps** | None / Read / Full | **Read** (`apps:read`) lists apps and prices, quotes costs and checks task status. **Full** adds `apps:run`, which can **charge your balance** when you run an app |

New keys default to **Full** for workflows with **Launch** off, and **Read** for Creative Lab. Enable the relevant execution permission to allow paid calls.

An agent sees only the tools its key can call. See the [permission identifiers](<https://docs.gptunnel.ru/en/mcp/oauth/#what-rights-are-granted-to-the-application>) and call `whoami` to check the active key’s permissions.

[Organization access settings](<https://docs.gptunnel.ru/en/mcp/tools/#organizational-access-settings>) may require `org:access` or `org:access:write`, depending on the user’s role and the operation. After issuing the key, use `whoami` to verify its permissions and `tools/list` to view the available tools.

 <a id="duration"></a>
 
<a id="key-lifetime"></a>
## Key lifetime

Choose a lifetime of 7, 30, 60, 90, or 365 days. The default is **30 days**. Site notifications remind you 60, 30, and 7 days before expiry and on the final day. An expired key returns `401 Unauthorized`.

To renew a key, select **Reissue** in its menu. The new token keeps the key’s name, permissions, and limits. The old token stops working immediately. Replace it in your client settings.

> **Note: Unused keys are revoked**
>
> Keys are revoked automatically after **90 days** without a request. You receive a warning 7 days beforehand. Make one request with the key to keep it active.

 <a id="expenditure-limites"></a>
 
<a id="spending-limits"></a>
## Spending limits

Select **Spending limits** in the key menu. Each key has a daily limit (1,000 ₽ by default), an optional monthly limit, and an option to pay from organization balances (off by default). See [Billing and limits](<https://docs.gptunnel.ru/en/mcp/billing/>).

 <a id="how-many-keys-can-you-create"></a>
 
<a id="how-many-keys-can-i-create"></a>
## How many keys can I create?

Each account can have up to **20** active keys. OAuth connections do not count toward this limit. If you have reached the limit, revoke a key you no longer use before creating a new one.

 <a id="withdrawal"></a>
 
<a id="revoke-a-key"></a>
## Revoke a key

Select **Revoke** in the key menu. Revocation takes effect immediately. Requests using that token return `401`. If a token may have been exposed, revoke it immediately and issue a new key.

<a id="security"></a>
## Security

- Store the token like a password, in an environment variable or secret manager. Keep it out of source code and repositories.
- Use a separate key for each client or environment. This helps you identify charges and revoke individual keys.
- Set a daily spending limit on keys that can start generation.
- Send the token only to `https://gptunnel.ru/mcp`. HTTPS protects the token in the request header.
