# MCP Token Management

To connect any AI agent platform to the hosted MCP server (mcp.apilayer.com), you need an MCP Access Token. This section explains how to create, manage, and revoke tokens — and what the rules are around each action.

<table><colgroup><col></colgroup><tbody><tr><td><p><strong>ℹ️ Authentication</strong></p><p>&nbsp;</p><p><strong>Bearer token -</strong><span> An opaque token with prefix apl_mcp_live_… minted from the IPstack portal, sent as Authorization: Bearer &lt;MCP_TOKEN&gt; on every request. Carries a required mcp:read scope and optional portal:&lt;IPSTACK&gt; scoping; never exposed to the model.</span></p><p>&nbsp;</p><p><span>The subscription is required to have features.mcp_access_enabled.</span></p></td></tr></tbody></table>

## **What is an MCP Access Token?**

An MCP Access Token is a scoped credential that grants an AI agent access to the hosted MCP server (mcp.apilayer.com). It is an opaque Bearer token with the prefix apl\_mcp\_live\_…. Unlike your standard API Key, which is tied to your APILayer subscription and works across the REST gateway, each MCP Access Token can be scoped to a specific APILayer product (e.g. portal:ipstack), given an expiry date, and labelled so you know which application is using it. Every MCP token also carries the required mcp:read scope.

| **Credential Type** | **Purpose & Behaviour** |
| --- | --- |
| MCP Access Token | Used against the hosted mcp.apilayer.com/mcp endpoint as Authorization: Bearer apl\_mcp\_live\_. Carries the required mcp:read scope, and optionally one or more portal:<IPStack> scopes pinning it to specific APILayer products. Has an expiry timestamp enforced server-side. One token per agent/application is recommended. |

## **Creating a Token**

### **Where to create tokens**

Log in to your IPstack dashboard and go to Account > MCP Access Tokens. This page lists all your tokens and provides a button to create a new one.

![](https://docs.apilayer.com/services/api/attachments/366a51b7-a14e-4cf9-831d-6c842da2c567)

### **Token limit**

Each account can hold a maximum of 10 active MCP Access Tokens at any one time (this depends on the subscription plan you have). This limit provides enough flexibility for separate tokens per environment (development, staging, production) and per agent application, while preventing unconstrained proliferation that would make access management unmanageable.

| **Plan** | **No. of Tokens** |
| --- | --- |
| Free Trial | 5 |
| Basic | 5 |
| Professional | 5 |
| Profession Plus | 10 |
| Custom Plans | 5 |

<table><colgroup><col></colgroup><tbody><tr><td><p><strong>💡 Recommended practice</strong></p><p><span>Use one token per agent application or environment. For example:</span></p><p><span>&nbsp;&nbsp;• claude-desktop-local&nbsp; (for personal Claude Desktop use)</span></p><p><span>&nbsp;&nbsp;• cursor-dev&nbsp; (for your Cursor development environment)</span></p><p><span>This makes it easy to revoke access for a single application without affecting the others.</span></p></td></tr></tbody></table>

### **Token creation fields**

| **Field** | **Description** |
| --- | --- |
| Name / Label | Required. A human-readable name so you can identify this token later (e.g., cursor-staging). This is the only field you can edit after creation. |
| Scope (Portals) | Required. Select which IPstack endpoints this token can access (e.g., ipstack\_lookup, ipstack\_bulk, all). Tokens cannot call tools outside their assigned scope. |
| Expiry Date | Required. Set a future date after which the token automatically becomes invalid. Choose an expiry appropriate to your use case — shorter for sensitive environments. |

### **Viewing the token value**

Immediately after creation, the token value is displayed once in a copy-to-clipboard dialog. This is the only time the full token string is shown. After you close this dialog, the token value is never displayed again — only its name, expiry, scope, and last-used date are visible in the dashboard.

<table><colgroup><col></colgroup><tbody><tr><td><p><strong>⚠️ Save your token now</strong></p><p><span>Copy the token immediately after creation and store it securely (for example, in your password manager or CI/CD secrets store).</span></p><p><span>If you lose it, you cannot retrieve it — you must revoke the old token and create a new one.</span></p><p><span>Never paste your token into source code, commit it to git, or share it in plain text.</span></p></td></tr></tbody></table>

![](https://docs.apilayer.com/services/api/attachments/ce5087bf-e77e-4aad-91fe-9bd684b83b51)

## **Token Lifecycle & States**

Each token exists in one of three states at any given time:

| **State** | **Cause** | **Available Actions** |
| --- | --- | --- |
| **✅  Active** | Token created and within its expiry window. | Edit name  •  Revoke  •  View usage & last-used date |
| **🚫  Revoked** | Manually revoked by the user. | 
View details (read-only)  •  Remove from list

*⚠ Revocation cannot be undone. Create a new token to restore access.*

 |
| **⏱  Expired** | Token passed its expiry date. | 

View details (read-only)  •  Remove from list

*⚠ Expiry cannot be extended on an expired token. Create a new token.*

 |

## **What You Can — and Cannot — Do with Tokens**

| **Action** | **Allowed?** |
| --- | --- |
| Edit the token's name/label | ✅  Yes — at any time while the token is Active. |
| Edit the token's scope (portals) | ❌  No — scope is set at creation and is immutable. Create a new token with the desired scope. |
| Extend the expiry date (before expiry) | ✅  Yes — you can extend the expiry of an Active token before it expires, from the token detail view. |
| Extend the expiry date (after expiry) | ❌  No — once a token has expired it cannot be reactivated. Create a new token. |
| Undo a revocation | ❌  No — revocation is permanent and irreversible. Create a new token to restore access. |
| See the token value again after creation | ❌  No — the token string is shown only once, at creation. Only name, expiry, scope, and last-used are visible afterwards. |
| Delete a token from the dashboard | ✅  Yes (soft remove) — removes it from your visible list. The audit record is retained for 90 days for compliance purposes. |
| Create more than 10 tokens | ❌  No — the per-account limit is 10 active tokens. Revoke or remove unused tokens before creating new ones. |

## **Revoking a Token**

Revoke a token immediately if you believe it has been compromised, shared accidentally, or is no longer needed. Any agent currently using the token will receive a 401 Unauthorized error and must be reconfigured with a new token.

**Step 1: Open MCP Access Tokens**

In your IPstack dashboard, go to Account > MCP Access Tokens.

**Step 2: Find the token to revoke**

Locate the token by name. The Last Used column helps you confirm which agents are actively using it.

**Step 3: Click Revoke**

Click the Revoke button next to the token. A confirmation dialog will appear asking you to confirm — this step is irreversible.

**Step 4: Confirm revocation**

Click Confirm Revoke. The token status changes to Revoked immediately. All API calls using this token will fail within seconds.

![](https://docs.apilayer.com/services/api/attachments/a5f42414-e12b-4136-a3b3-0e72145631a6)

**Step 5: Update your agent configuration**

Generate a new token and update the Authorization header or environment variable in every agent or application that was using the revoked token.

<table><colgroup><col></colgroup><tbody><tr><td><p><strong>⚠️ Revocation is immediate and permanent</strong></p><p><span>There is no grace period and no undo. Once confirmed, the token is invalid.</span></p><p><span>If you revoke a token by mistake, you must create a new one and reconfigure all agents that used it.</span></p><p><span>Always keep track of which applications use which token (the Name field is your reference).</span></p></td></tr></tbody></table>

## **Token Expiry — Best Practices**

Choosing the right expiry window is a balance between security and operational overhead:

| **Environment** | **Recommended Expiry** |
| --- | --- |
| Personal / development use | 90 days — long enough to avoid frequent renewal, short enough to limit exposure. |
| Staging / test environments | 30 days — rotate regularly as part of your sprint or release cycle. |
| Production agents | 90–180 days — set a calendar reminder 2 weeks before expiry so you can rotate without downtime. |
| CI/CD pipelines | Match your secret rotation policy (commonly 30 or 90 days). |

<table><colgroup><col></colgroup><tbody><tr><td><p><strong>💡 Expiry Reminder</strong></p><p><span>The dashboard highlights tokens expiring within 7 days with an amber warning badge.</span></p><p><span>When you see this, generate a new token, update your agent configuration, verify it works, then remove the old token — all before the expiry date to avoid downtime.</span></p></td></tr></tbody></table>

## **Token Dashboard — Field Reference**

Each token entry on the MCP Access Tokens page displays the following fields:

| **Field** | **Description** |
| --- | --- |
| Name | The label you gave the token at creation. This is the only editable field after creation. |
| Expiry | The date and time at which the token will automatically become invalid. |
| Scope | The IPstack endpoints this token is authorised to call. Displayed as a comma-separated list of product names. |
| Last Used | The timestamp of the most recent successful API call made using this token. Shows Never if the token has not been used yet. |
| Status | One of: Active, Revoked, or Expired. |

**Note**: the token string itself (the actual credential value) is never displayed in this table or anywhere in the dashboard after the initial creation dialog. This is by design — storing the value only in hashed form protects your account if the dashboard were ever accessed without authorisation.
