MCP Access Tokens
MCP Access Tokens (PATs) let you authenticate against the AgentArea MCP proxy from any MCP client — Cursor, Claude Desktop, or your own tooling — without exposing your primary credentials.
Overview
AgentArea’s MCP proxy sits in front of every managed MCP server instance in your workspace. To connect an external client, you need a Personal Access Token (PAT) — a long-lived, revocable credential scoped to your workspace.Workspace-Scoped
A single token grants access to every MCP instance in your workspace
Hash-Only Storage
Raw tokens are shown once at creation. Only a SHA-256 hash is ever persisted
Instant Revocation
Revoke a token immediately from the API or dashboard — no propagation delay
Token Format
Every PAT follows a predictable, identifiable structure:| Part | Value | Description |
|---|---|---|
| Prefix | aat_ | AgentArea Token — identifies token type at a glance |
| Body | 43 characters | 32 random bytes encoded as URL-safe base64 |
| Total length | 47 characters | Fixed-length, suitable for validation |
The first 12 characters after
aat_ (e.g. aat_AbCdEfGh) are stored as token_prefix and displayed in the dashboard so you can identify tokens without storing the raw value.Lifecycle
API Reference
Base path:/v1/mcp-access-tokens
- Create Token
- List Tokens
- Get Token
- Revoke Token
Using Tokens with MCP Clients
- Cursor
- Claude Desktop
- HTTP / curl
Add the following to your Cursor MCP configuration (
~/.cursor/mcp.json or the project-level .cursor/mcp.json):Creating Your First Token
Open the MCP Servers dashboard
Navigate to MCP Servers in the AgentArea dashboard and select the instance you want to connect to.
Name and configure the token
Give the token a descriptive name that identifies the client or machine it will be used on (e.g.
cursor-laptop, ci-pipeline). Set an expiry appropriate for the use case.Copy the raw token
The dashboard displays the full token value exactly once. Copy it now and store it in a password manager or secrets vault.
Configure your MCP client
Paste the token into your client’s configuration as shown in the Using Tokens section above.
Token Fields Reference
| Field | Type | Description |
|---|---|---|
id | UUID | Unique identifier for the token record |
name | string | Human-readable label you provide at creation |
token_prefix | string | First 12 characters (e.g. aat_AbCdEfGh) for visual identification |
token_hash | string | SHA-256 hex digest of the raw token — never exposed via API |
is_active | boolean | false immediately after revocation |
expires_at | datetime (nullable) | UTC expiry; null means no expiry |
access_count | integer | Total number of validated requests |
last_accessed_at | datetime (nullable) | Timestamp of the most recent validated request |
Security Best Practices
One token per client
Issue a separate token for each machine or integration. This lets you revoke access for a specific client without affecting others.
Set expiry dates
Prefer short-lived tokens (30-90 days) over non-expiring ones. Rotate tokens regularly, especially after team member changes.
Store in secrets managers
Never commit tokens to source control. Use environment variables, a password manager, or a secrets manager (Infisical, AWS Secrets Manager, HashiCorp Vault).
Monitor access counts
Unexpected spikes in
access_count or activity from an unexpected last_accessed_at timestamp may indicate a compromised token. Revoke immediately if suspicious.Revoke unused tokens
Periodically audit your token list and revoke any tokens that are no longer in active use or belong to departed team members.
Prefer short names
Use names like
cursor-alice-laptop or ci-github-actions so you can identify the token’s origin at a glance when auditing.Validation Logic
When the MCP proxy receives a request, it validates the Bearer token through the following checks in order:- Format check — token must start with
aat_ - Hash lookup — SHA-256 of the token is computed and matched against stored hashes
- Active check —
is_activemust betrue - Expiry check —
expires_atmust benullor in the future - Access recording —
access_countincremented andlast_accessed_atupdated
401 Unauthorized. The raw token is never logged.