Tokay MCP
Connect an AI agent to Tokay so it can upload code, deploy apps, recover failures, inspect usage, and keep working on the same repository later.
Last updated
Connect
Add this remote Streamable HTTP endpoint to your MCP client.
https://mcp.tokay.io/mcp
Connecting opens a browser for OAuth approval. You do not paste an API token into the client. Every connection is listed separately under Connected apps and can be disconnected without affecting another installation.
| Client | Setup |
|---|---|
| Claude | Add a custom connector with the Tokay endpoint and complete OAuth |
| ChatGPT | A workspace admin adds a custom MCP app, scans the tools, and completes OAuth |
| VS Code | Add an HTTP server in mcp.json with the Tokay endpoint |
VS Code can use this workspace or user configuration.
{
"servers": {
"tokay": {
"type": "http",
"url": "https://mcp.tokay.io/mcp"
}
}
}
What an agent can do
- Deploy an app from a small inline project or a large repository archive.
- Return later, find the exact repository snapshot, search it, read files, make a conflict safe change, and deploy again.
- Follow Tokay's authoritative deployment readiness instead of guessing from time or logs.
- Resolve configuration, database, source, and release blockers through named tools.
- Diagnose a failed build or deployment with bounded evidence and logs.
- Report current VM capacity and the share used by a Project, Service, or managed database.
- Run a bounded read only query against a managed database when the connection has that permission.
- Use the rest of the public GraphQL surface through a read tool and a fail closed routine mutation tool.
MCP is the workflow surface
MCP carries decisions, metadata, bounded source text, and structured results. It does not carry repository archives, database dumps, or service file bytes through the model context.
Large bytes use short lived capability URLs. The agent asks Tokay for an upload or download URL, transfers the bytes over ordinary HTTP without an OAuth bearer, then continues the workflow with the returned handle. This keeps a large repository faithful without turning it into thousands of tool arguments.
The public GraphQL and REST API remains the full fidelity escape hatch. A client that needs arbitrary API calls should authorize the separate https://api.tokay.io resource and use the API directly. Tokay MCP tokens are accepted only at https://mcp.tokay.io/mcp.
Tokay MCP and an MCP hosted on Tokay
| Tokay MCP | An MCP app you deploy on Tokay |
|---|---|
| Manages Tokay Projects, repositories, Services, resources, and deployments | Exposes the tools your application owns |
| Uses a Platform OAuth token for the MCP audience | Uses Tokay Access OAuth or a Project machine token at the deployed app |
| Runs in Tokay's control plane | Runs as normal user code on your Tokay VM |
| Never passes its bearer to your app | Never receives authority to manage Tokay unless you deliberately add it |
See Deploy an MCP server when the product you are hosting is itself an MCP server.
Permissions
The first connection requests the bundle below. It covers everything from uploading source to recovering a failed deploy.
| Action | Why it is requested |
|---|---|
WORKSPACE_CREATE_REPO |
Create a managed repository for uploaded code |
WORKSPACE_CREATE_PROJECT |
Create the Project that owns the app |
REPO_WRITE |
Commit source changes |
PROJECT_WRITE |
Configure Services and nonsecret Project Config |
PROJECT_WRITE_SECRETS |
Store a secret value without reading it back |
PROJECT_DEPLOY |
Start or resume a deployment |
PROJECT_LOGS |
Diagnose and verify a failed deployment |
Logs can contain application data or personal information. Tokay includes PROJECT_LOGS because deployment and recovery are one workflow. Diagnosis returns state and explanation first and includes bounded log bodies only when requested.
Database queries, exports, service file writes, access policy changes, permanent deletion, and other elevated actions stay outside this initial bundle. When a tool needs one, it returns the exact missing PermissionActionType. A new OAuth approval creates another independent connection with the requested union of actions.
Core workflow tools
| Tool | Purpose |
|---|---|
get_tokay_context |
Find visible Workspaces, Projects, repositories, Services, and resources |
get_repository |
Read ownership mode, current snapshot, links, and capabilities |
list_repository_files |
Page exact snapshot metadata |
read_repository_files |
Read bounded text and ranges at one snapshot |
search_repository |
Search paths or text at one exact commit |
create_repository_download |
Create a raw, directory, or repository download URL |
begin_repository_upload |
Create a complete archive or large blob upload URL |
push_code |
Apply a sparse change or completed upload at an expected commit |
deploy_code |
Continue source, analysis, configuration, and deployment as one deterministic workflow |
get_deployment_status |
Read readiness, blockers, URLs, and review evidence |
set_project_secret |
Store a write only secret value |
set_project_config |
Store an explicitly nonsecret value |
select_logical_database |
Bind one coherent database connection and optional staged import |
resolve_delivery_conflict |
Remove one user controlled conflicting value source |
resolve_release_action_override |
Enable, edit, or dismiss a proposed release command |
apply_source_repair |
Apply a ready source repair proposal at its source commit |
deploy |
Deploy or resume one ready Project or Service with retry safety |
confirm_release |
Preview and confirm one parked release |
get_service_diagnosis |
Read the root diagnosis and optional bounded logs |
get_usage |
Read target attribution, shared VM headroom, and a deterministic recommendation |
query_database |
Run a bounded read only managed database query |
Platform, safety, and byte tools
| Tool | Purpose |
|---|---|
query_platform_graphql |
Run one bounded read only GraphQL query |
mutate_platform_graphql |
Run one routine mutation from the startup validated policy |
search_tokay_docs |
Search first party Tokay protocol and agent references |
confirm_database_import |
Preview and confirm replacement of managed data |
restore_database_snapshot |
Preview and confirm a snapshot restore |
purge_resource |
Use Tokay's existing permanent deletion confirmation contract |
delete_persistent_storage_data |
Preview and confirm a permanent storage wipe |
replace_project_value_kind |
Preview Config to Secret or Secret to Config replacement |
set_app_audience |
Preview and confirm public, private, or member access changes |
recover_maintenance_hold |
Resume only with a safety assertion supplied by the user |
set_release_safety |
Preview and confirm a standing release safety change |
create_service_file_download |
Create a Saved or exact Current file download URL |
begin_service_file_upload |
Create a Saved file upload URL |
create_database_export |
Create a native dump or CSV download URL |
begin_database_import_upload |
Create a target free database dump upload URL |
The routine mutation policy covers every public GraphQL mutation at server startup. An unknown mutation prevents startup. runServiceTask keeps its documented argv boundary and remains available with PROJECT_INVOKE. Interactive shells, credential minting, VM control, and account operations are either routed to a dedicated reviewed tool or unavailable through MCP.
Reviews and retry safety
Reviewed actions use two calls. The first call returns the exact impact and a ten minute receipt. Repeating the exact request with that receipt consumes it once. A changed request, changed target state, different OAuth connection, expired receipt, or replay fails.
Repository writes and deploys use caller stable idempotency keys where a lost response could duplicate durable work. Retrying the same source or readiness target returns the same repository, commit, or rollout. A diagnosed failed rollout becomes a new retry target and receives exactly one successor rollout under the same workflow key. Reusing the key for different input fails.
Unknown readiness actions and blocker kinds stop safely. An agent must never invent the safety assertion required to recover a maintenance hold.
Privacy and retention
- Tokay validates the live OAuth connection for every MCP request.
- Disconnecting the connection blocks the next tool call and any unused capability URL or queued source side effect.
- Secret values are accepted only by write only tools and are never returned.
- Tokay does not log OAuth bearers, source contents, database query text or results, application log bodies, release commands, capability tokens, or credentials shown once.
- Operational logs may record the tool name, principal and target IDs, support reference, result size, status, and duration.
- Platform OAuth connections expire after 30 days without use. Capability URLs and review receipts expire much sooner and are single use.
Read the privacy policy and security model. Email hello@tokay.io for support.
Troubleshooting
| You see | What to do |
|---|---|
| OAuth opens but consent is denied | Confirm the Tokay account is active and the callback shown belongs to the client you added |
401 invalid_token |
The connection expired or was disconnected. Authorize a new connection |
403 insufficient_scope |
Approve a new connection with the current actions plus the exact action named by Tokay |
| A tool says to wait | Keep the returned IDs and poll after the suggested interval |
| A repository write reports a conflict | Refresh the current snapshot, reconcile the change, and retry with a new expected commit |
| A capability URL expired | Ask for a new capability. Do not put the raw bytes into MCP JSON |
| A release asks for confirmation | Read the impact evidence and ask the user before confirming |