Tenant MCP
MCP (the Model Context Protocol) is how AI agents and assistants like Claude Code, Codex and Cursor talk to external tools. A tenant MCP token lets one of your customers point their own AI agent at their own services — so the agent can list them, check their status, and restart / stop / start them on the customer's behalf, and nothing else.
Tokens are managed entirely in the UI (Portal → MCP Tokens). There is no terminal step.
Two MCP surfaces, hard-split
The panel serves two completely separate MCP servers on the same domain. This is a deliberate security boundary, not a configuration detail:
Admin MCP (/mcp) | Tenant MCP (/mcp/tenant) | |
|---|---|---|
| Who | the operator | a customer's AI agent |
| Auth | an admin API key, or sign-in as a platform admin (OAuth) | an mcp-scoped customer token, or sign-in as a member (OAuth) |
| Tools | operator-wide (list customers, all services, deploy…) | customer-scoped tools listed below, plus health |
| Gated by | the mcp.enabled server setting | the MCPTenant capability |
They are separate server instances with separate tool registries. An admin key is rejected on /mcp/tenant; a tenant token is rejected on the admin /mcp. The tenant registry does not mount operator tools. Authentication and customer-scoped lookups are still required for each exposed tenant operation. (The operator-facing admin MCP server is documented separately under MCP Server.)
On the admin server, every tool that deletes something, overwrites data the panel cannot give back, hands a service to another customer or changes files inside a service never runs straight away: the agent's call waits until a platform admin approves it in the panel, then runs as the API key's owner. delete_service is one of them. The panel decides this by the tool's name, not by anything the agent sends, and preview_tool_call shows an agent what a call would act on without running it. The tenant server has no such tools. See Calls that wait for approval.
Connect my agent
When MCP is part of the customer's plan, the portal dashboard shows a Connect my agent row. Its dialog first asks Which app do you want to connect?: Claude and ChatGPT as two large cards, then More apps (Cursor, VS Code, Goose, LM Studio, Replit, Claude Code, Codex, Gemini CLI, Windsurf, Any MCP client), a Not listed? list of apps with their own guide, and the server URL. The second screen shows only the chosen app's setup, all pointing at https://<your-panel>/mcp/tenant; All apps goes back. Portal → MCP Tokens shows the same two steps in a card.
Only an app that needs a token asks for one (Claude Code, Codex, Gemini CLI, Windsurf, LM Studio, Replit, and the API key JSON): Create a token now makes an MCP token through the same path as the MCP Tokens page (shown once, expiring after 90 days) and fills it into the setup. For example:
claude mcp add --transport http my-apps https://your-panel.example.com/mcp/tenant \
--header "Authorization: Bearer YOUR_MCP_TOKEN"
[mcp_servers.my-apps]
url = "https://your-panel.example.com/mcp/tenant"
bearer_token_env_var = "AAP_API_KEY"
The row is hidden when MCP is not in the plan. A customer can never switch the panel's own (admin) MCP server on; that switch belongs to the operator.
Signing in instead of a token (customer)
claude.ai, Claude Desktop and ChatGPT do not need a token. In Connect my agent or on Portal → MCP Tokens, choose the app:
- Add to Claude: opens Claude's Add custom connector dialog with the name your portal shows at the top of its menu and
https://<your-panel>/mcp/tenantfilled in. By hand: add a custom connector with that URL and leave its OAuth settings empty. - ChatGPT: five guided steps (Plugins → + → Add custom MCP server, a name, the URL, OAuth, Create) with copy buttons; ChatGPT has no link that fills them in.
- Add to Cursor, VS Code, Goose, LM Studio and Replit, links to the guides of Cline, Zed, JetBrains, Warp, Amazon Q, Augment and LibreChat (Not listed?), and Any MCP client with the JSON as OAuth (no key) or API key. LM Studio and Replit get
<YOUR_API_KEY>where the token goes: replace it in the app. No link ever contains a token.
Every link uses /mcp/tenant, never the operator's /mcp. An app that cannot work is marked Unavailable, and its link is greyed out with the reason: the panel is not on HTTPS, or sign-in for AI apps is not set up on this panel (ask your provider). Then sign in with your panel account and approve the request. Sign in to the panel in a browser once first. The app acts for your organization's customer with your role's permissions, each access lasts 5 minutes and renews on its own. A signed-in app cannot list your tokens or API keys (list_mcp_tokens, list_api_keys): those lists show only keys no stronger than the token that asks, and a sign-in has no token role. See Sign in instead of a key for what the panel checks.
Creating and using a token (customer)
- Open Portal → MCP Tokens.
- Click Create token, give it a name (e.g. "Claude Desktop"), and pick an expiry: 30 days, 90 days (the default), 1 year or never. Never shows a warning: a token that never expires keeps working until you revoke it, even if it leaks or is forgotten.
- The full token is shown once, in the format
aap_XXXXXXXX_YYYYYYYYYYYYYYYY. Copy it now — for security it is not shown again automatically. - Configure your MCP client's Streamable HTTP connection to the endpoint shown on the page:
https://<your-panel>/mcp/tenant. - Supply the token in an
Authorization: Bearer <tenant-token>header. Use a client that supports this authentication method; do not select an unauthenticated connection without also supplying that header.
claude.ai, Claude Desktop and ChatGPT do not need a token: they sign in instead (see Signing in instead of a token).
If you lose a token, you can Reveal it again from the same page (this is recorded in the audit log), or Revoke it — any client using it stops working immediately. You can always revoke, even if the operator has since turned the capability off.
Who can create and see tokens
The MCP Tokens page follows the same rule as the API Keys page: view secrets on the customer's organization to see the list, manage secrets to create, reveal or revoke a token. The default customer login has both; a read-only or project-only member has neither. As on the API Keys page, a token is listed, revealed or revoked only for someone who holds every permission of the token's role in the organization.
An API key with a deny list cannot see, reveal or revoke a token that may do something the key is denied: POST /api/v1/portal/mcp/tokens/{id}/reveal answers 404, as for a missing token, and returns no secret (AI-1271). For portal visibility and reveal checks, an MCP token counts with its full Customer role, including permissions restricted by that token's own deny list. A key denied any permission of the Customer role cannot see or reveal MCP tokens. A browser session or a key without a deny list can. Separately, MCP tool execution enforces the token's own deny list (see What a token is refused).
A token works on the MCP endpoint for the customer it is bound to whoever created it and whatever that person's role is now, except for the tools its deny list excludes (see What a token is refused). When upgrading from a version that let any member create tokens, review the existing ones with the query in Upgrading.
What a token can do
A tenant token is scoped to the customer's account by construction — every tool only ever sees and acts on that customer's own services. The v1 toolset is:
list_services— list the customer's servicesget_service_status— check one service's statusget_logs— read a bounded snapshot of one service's recent container logsrestart_service— restart a servicelist_service_containers— list the containers of one of the customer's services: each container's Compose service name, status, health, image, restart count and exposed ports (asGET /api/v1/services/{id}/containers)restart_service_container— restart one container of a Compose app while its other containers keep running;containeris the Compose service name, the container ID or an ID prefix of at least 12 characters (asPOST /api/v1/services/{id}/containers/{containerId}/restart). A container of another service answers not found and nothing restartsstop_service/start_service— stop or start a serviceredeploy_service— re-pull the latest images and recreate one service's containers. A Git-deployed service is recreated from the image of its last build and the answer says so ("mode": "recreate"): nothing is cloned or built. It is rebuilt by a push to its repository or by a platform operator's Redeploy in the panel, see Git deploydeploy_template— deploy a catalog template as a new service the customer owns (quota-checked)get_usage— the customer's resource/usage snapshotget_service_metrics/get_services_metrics_summary— CPU, memory and network figures for one of the customer's services, or a summary across all of themcheck_deploy— check a deployment before running it, as the portal's pre-deploy check does; it changes nothinglist_plan_ai_models— the panel AI models the customer's own plan allows, each marked gateway (metered AI) or local and whether the panel serves it now (asGET /api/v1/portal/ai-models). It takes no arguments: the plan is always the token's own customer's, see AI models per planget_backup_capabilities— safe plan, policy and readiness metadata for an owned service; physical usage stays unknown and every execution action is unavailable. A machine key does not qualify a current human backup administrator.list_local_backups— the owned service's restorable LOCAL backup points and recent backup or restore requests. Read-only: backing up or restoring needs a signed-in customer administrator in the portal.list_backup_destinations— the customer's own backup storage this service may use, with non-secret settings only. Read-only: connecting or removing storage needs a signed-in customer administrator in the portal.get_capabilities— what the customer's plan allows, the same list as Portal capabilities (GET /api/v1/portal/capabilities):byok_ai,metered_ai,api_keysandmcp, each withenabledand thesourcethat decided it (plan_default,customer_override,global_offorsuspended). It always reads the key's own customer; it takes no customer argument.list_github_connections— the GitHub accounts connected to the key's own customer: account, owner, whether the whole organization or one user may use it, suspension. The same scoped list asGET /api/v1/github/connections; it takes no customer argument.list_github_repos/list_github_branches— the repositories (and a repository's branches) of a GitHub connection the key's customer owns and shares with the whole organization; an "only me" connection is not usable by a key. Any other connection answersnot_foundbefore GitHub is asked. The same asGET /api/v1/github/connections/{id}/reposand…/branches; they take no customer argument.get_ai_config— the customer's own AI provider settings, as Portal → AI shows them (GET /api/v1/portal/ai-config): provider, base URL, model, whether a key is stored and whether deployments use it. The key itself is never returned.get_ai_gateway— the customer's metered AI gateway (GET /api/v1/portal/ai-gateway): whether it is on and why, its endpoint, whether a key exists, this month's spend and the budget, in cents of the namedcurrency(USD). Key material is never returned.list_api_keys/list_mcp_tokens— the API keys and the MCP tokens of the token's own organization (GET /api/v1/portal/api-keys,GET /api/v1/portal/mcp): name, prefix, role, expiry, last use, revocation, and whether the plan allows them. Never key material. A token lists only keys that cannot do more than it: keys of its own role whose deny list includes every permission on the token's deny list. An MCP token counts its whole role, so a token with a deny list sees no MCP tokens, itself included. Creating, revealing and revoking keys stays in the portal.export_customer_data— the customer's data export (GET /api/v1/portal/export): profile, plan name, services and the last 30 days of usage, as JSON. No credentials.deploy_git/update_git_source— deploy a new service from a repository of one of the customer's GitHub connections, or point one of its Git services at such a repository and rebuild it. Needs the provider's Customers may deploy from Git switch; only connections shared with the whole organization can be used through a key; the service is always the key's customer's. See Connect GitHub
Asking about a service the customer doesn't own returns the same "not found" as a service that doesn't exist in the service ownership checks. This is not a guarantee against every possible information leak. A deploy_template always creates the service under the calling customer's account (ownership by construction) and is subject to their per-template quota.
Not in v1: live log streaming (
get_logsreturns a bounded snapshot, not a live tail) is the last deferred tool. Secrets reveal, minting or revoking keys, making a service public, service delete, billing, and any cross-tenant or operator tool are not in the shipped tenant registry.
What a token is refused
Each tool needs one permission of the Customer role. A token carries a deny list, the same one the REST API subtracts: permissions the token was created without, and permissions the upgrade that introduced the key-creation rule took away from tokens of weaker or departed creators (see API Keys). A tool whose permission is on the list answers an error starting with permission_denied and does nothing: no job is queued and no service or deployment is created.
| Tool | Needs |
|---|---|
list_services, get_service_status, get_capabilities, list_plan_ai_models, list_service_containers, get_service_metrics, get_services_metrics_summary | services.view |
get_logs | services.view_logs |
restart_service, stop_service, start_service, restart_service_container | services.start_stop |
redeploy_service, deploy_template, list_github_repos, list_github_branches, deploy_git, update_git_source, check_deploy | services.deploy |
get_usage | metering.view |
get_backup_capabilities, list_local_backups, list_backup_destinations | backups.view |
list_github_connections | git_connections.view |
get_ai_config, get_ai_gateway, list_api_keys, list_mcp_tokens | secrets.view |
export_customer_data | services.manage |
health | nothing |
Tokens created on Portal → MCP Tokens have an empty deny list, so they keep every tool. The deny list applies whoever created the token and whether or not that person is still a member of the organization: a token whose creator left is not given back what it was denied. A token refused every tool is usually one whose creator had already left when the upgrade ran; revoke it and have a member create a new one. The token's creator's current role is not checked on the MCP endpoint; revoke a token to cut it completely.
While the customer is suspended
A token of a suspended customer is refused on /mcp/tenant with 403 and the message "the customer is suspended", on every request, so no tool runs. A start, restart, redeploy or template deploy that a tool queued before the suspension is cancelled when the panel gets to it, and it is not run later. The token is blocked, not revoked: after the operator reactivates the customer the same token works again. See Suspend and reactivate.
Why the page might be locked
If your provider hasn't included MCP in your plan, the page shows a locked card explaining why:
- "disabled by your administrator" — the operator turned the capability off globally or suspended the account.
- "not included in your plan" — MCP isn't part of your current plan; ask your provider to enable it.
Any tokens you created earlier stay visible so you can still revoke them.
Enabling tenant MCP (operator)
MCPTenant is a capability, resolved through the same cascade as the other customer capabilities (see Secrets Manager for the wider story):
- Global switch — Settings → AI → Capabilities. Off beats everything.
- Plan default — a plan may include MCP tenant access (a plain on/off; no limit).
- Per-customer override — enable or disable it for one customer.
The resolution order is: active subscription → global switch (off wins) → per-customer override → plan default → default off. Because the capability is checked at every connection, turning it off invalidates the customer's live tokens on the next request — no redeploy, no restart (off means off now). A denied connection gets a plain 401/403.
MCP is independent of API keys. A customer with MCP on but programmatic API keys off can still mint and use MCP tokens, and vice-versa — the two are separate capabilities gating separate surfaces.
What's recorded
Creating, revealing, and revoking a token each write an audit-log entry (api_key.create / api_key.reveal / api_key.revoke, tagged kind: mcp) with the token's name and prefix — never the token material itself. The full value is returned at creation and authorized Reveal, and is also held by clients configured to use it. Protect those copies as well as the vault. MCP tokens are API keys carrying the mcp scope, so they share the same vault-backed reveal and revoke machinery.
Beyond the token lifecycle, every tool a token invokes is recorded, too. Each successful tool call an agent makes through the tenant surface writes an audit-log entry named mcp.<tool> (for example mcp.restart_service), scoped to the calling customer and — when the call targets one service — tagged with that service's id. Reads (list_services, get_usage, …) are logged alongside actions. On the admin surface, every call that changes something writes an mcp.<tool> entry with the key's owner as actor and whether it worked (result: ok or error), and with the service's id and its customer when the call names one; argument values are never written. Audit records help review calls; they are not a complete transcript of the external agent or proof that all downstream work succeeded.