Letting an AI agent deploy through an MCP server, without handing it everything.
An MCP server turns a hosting API into tools an agent can call: deploy, read the build log, set a variable, add a domain. Give the agent a token scoped to what it needs, with an expiry. Let it read freely, make it ask before deploys and config changes, and keep secrets, deletion and billing out of its reach.
Facts checked
What the agent actually gets
The Model Context Protocol defines how an agent discovers and calls tools on a server. A deploy MCP server is a thin layer over the host’s API: each tool is one API call, run with whatever credential you configured. So the agent can do exactly what that token can do. The tool list is a convenience, and the token is the real boundary.
Canner has two ways in. The remote server at https://api.canner.ca/mcp is for clients that connect by URL, including browser-based builders such as Lovable, Bolt and v0. The local @canner-ca/mcp package runs over stdio for desktop clients and proxies the same endpoint, so both expose the same tools. Setup for each client is on the MCP page.
# Claude Code: the remote server, with a token in a header
claude mcp add --transport http canner https://api.canner.ca/mcp \
--header "Authorization: Bearer cnr_your_token_here"
# Claude Desktop, Cursor: the local stdio server (proxies the same endpoint)
{
"mcpServers": {
"canner": {
"command": "npx",
"args": ["-y", "@canner-ca/mcp"],
"env": { "CANNER_TOKEN": "cnr_your_token_here" }
}
}
}What the MCP spec asks for, and what Canner does
| Topic | MCP spec (2025-06-18) | Canner |
|---|---|---|
| Transport † | Two standard transports: stdio and Streamable HTTP. | Remote: Streamable HTTP, JSON-RPC posted to /mcp. Local: stdio, proxying the remote endpoint. |
| Server-sent stream † | A GET to the endpoint opens an SSE stream, or the server returns 405. | 405. Every response comes back on the POST. |
| Authorization † | Optional. HTTP servers that support it should use the OAuth 2.1 flow; stdio servers take credentials from the environment. | A cnr_ API token as a Bearer header. No OAuth sign-in yet. The local server reads CANNER_TOKEN or the CLI’s stored login. |
| Errors † † | Invalid token: 401. Insufficient scope: 403. A tool that runs and fails returns isError: true. | 401 with WWW-Authenticate. A project-restricted token gets 403. A scoped token calling a tool outside its scope gets an isError result naming the missing scope. |
| Human in the loop † | There should always be a human able to deny tool calls; clients should ask before sensitive operations. | Restarts and memory changes need confirm: true. Everything else is up to your client’s approval settings. |
† Competitor details come from each vendor’s own published pages on the dates shown; prices and plans change, so check the vendor before you decide. Transport (2026-10-29) · Server-sent stream (2026-10-29) · Authorization (2026-10-29) · Errors (2026-10-29) · Errors (2026-10-29) · Human in the loop (2026-10-29)
The tools, grouped by the scope they need
Canner’s server has more than thirty tools. Each needs one scope, checked before the call runs and again by the API behind it, so a token behaves the same over MCP as over REST.
| Group | Tools | Scope |
|---|---|---|
| Account | canner_whoami | None |
| Projects | canner_list_projects, canner_get_project, canner_create_project | projects |
| Deploys | canner_list_deployments, canner_get_deployment (with the build log), canner_deploy (rebuild a GitHub project from HEAD), canner_save_app (deploy from source files sent by the agent) | deployments |
| Errors and logs | canner_list_errors, canner_find_error, canner_get_error, canner_search_logs, canner_deploy_history, canner_set_error_status, canner_explain_error | deployments |
| Environment variables | canner_list_env_vars, canner_set_env_var | env |
| Domains | canner_list_domains, canner_add_domain, canner_verify_domain | domains |
| Databases | List, details (credentials hidden unless asked), create, export, copy into an empty database, operations, backups (read-only), security check, role audit | databases |
| Dedicated instance | Instance and recovery window, tuning, extensions, replication, memory, query insights, upgrade check, restart | databases |
Pick the token before you pick the tools
A Canner token acts as the user who created it, in that user’s organization, and can never do more than that user can: its reach is the narrower of the user’s permissions and the token’s own scopes. Create it under Identity → API keys, give each agent its own named token, and set an expiry (30, 90 or 180 days, one year, or none).
- Full access: no scopes, everything the user can do. For your own CI and scripts, not for an agent.
- MCP connector: the dashboard preset for agents and AI builders. It grants
projects:write,deployments:write,env:writeanddomains:write: no databases, no billing, no token management, no project deletion, and environment variables it can set but not read back. - Custom scopes through the API:
POST /v1/tokensaccepts any list of scopes. A read-only agent needs onlyprojects:readanddeployments:readto read build logs, errors and request logs. - Project-restricted tokens don’t work with MCP. The server refuses them with 403
token_project_restricted, because the tools act across the organization. Use the REST API for single-project automation.
# A read-only token for an agent that diagnoses but never deploys.
# Run with a full-access token; the new token can read projects, deploys, errors and logs.
curl -X POST https://api.canner.ca/v1/tokens \
-H "Authorization: Bearer $CANNER_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"agent-readonly","scopes":["projects:read","deployments:read"],"expires_in_days":30}'What to let the agent do on its own
MCP clients decide which calls run without asking. In Claude Code, permission rules are checked deny first, then ask, then allow, and a rule names a server’s tools as mcp__<server>__<tool>. Allow rules accept a glob after the server prefix, so mcp__canner__canner_get_* covers every read tool that starts with get_.
- Reading is safe to automate: projects, deploys, build logs, errors, request logs, database metadata.
canner_get_databasehides the password and connection string unless the agent passesreveal: true. - Deploys should ask. Every production deploy stops the old process and starts the new one, a brief interruption. An agent retrying in a loop is an outage in slow motion.
- Environment variables should ask. A variable reaches the app only on the next deploy, and a key that already exists for that environment is skipped, not overwritten, so an agent can believe it fixed a value when it didn’t.
- Keep secrets out of the transcript. Deny
canner_list_env_vars; values come back in plain text and stay in the conversation history. - Restarts and memory changes are off by default. The tools refuse unless called with
confirm: true, and their own description tells the agent to get the owner’s go-ahead first.
// .claude/settings.json: reads run freely, changes ask, secrets and restarts are off
{
"permissions": {
"allow": [
"mcp__canner__canner_whoami",
"mcp__canner__canner_list_*",
"mcp__canner__canner_get_*",
"mcp__canner__canner_find_error",
"mcp__canner__canner_search_logs",
"mcp__canner__canner_deploy_history"
],
"ask": [
"mcp__canner__canner_deploy",
"mcp__canner__canner_save_app",
"mcp__canner__canner_set_env_var",
"mcp__canner__canner_add_domain",
"mcp__canner__canner_create_project"
],
"deny": [
"mcp__canner__canner_list_env_vars",
"mcp__canner__canner_restart_instance",
"mcp__canner__canner_set_replication",
"mcp__canner__canner_apply_instance_memory"
]
}
}A build-fix loop with a stopping point
The most useful thing an agent does with deploy access is fix a failed build: read the log, change the code, deploy again. It works if the loop has an end.
- 1.
canner_list_deployments, thencanner_get_deploymenton the failed one for the build log. - 2. Fix the cause in the repository. Common ones have their own guides: build failed, heap out of memory.
- 3. Push, then
canner_deployto rebuild from HEAD. Pollcanner_get_deploymentuntil it succeeds or fails. - 4. If the app starts but misbehaves:
canner_list_errors,canner_get_errorfor the stack and the commit it began under, andcanner_deploy_historyto confirm the fix removed it. - 5. Stop after two or three failed attempts and hand back a summary. Canner also limits
canner_save_appto 10 deploys an hour per account.
Know what the agent did
The API keys page shows when each token was last used, which is why one token per agent matters. With the Compliance add-on ($29/mo) or Enterprise, the audit log records deploys, secret reveals and token changes with actor_type set to token when an API token acted. Revoking a token stops it at once, and removing a user stops their tokens for that organization.
Where this falls short today
Canner’s remote server takes a pasted API token; it doesn’t run the OAuth sign-in flow the spec describes for HTTP servers. A client that only connects to remote servers through OAuth can’t use it yet, and a pasted token lives in that client’s settings until it expires or you revoke it. There is no read-only preset in the dashboard (use the API call above), and no server-side approval step beyond confirm: true. If you need per-call human approval enforced by the host, put it in the client.
Questions
Can Claude Code deploy my app through MCP?
Yes. Add Canner’s remote server with claude mcp add --transport http canner https://api.canner.ca/mcp and an Authorization: Bearer header holding a Canner API token. Claude Code can then create a project, deploy, read build logs and errors, set environment variables and attach domains, subject to the token’s scopes and your permission rules.
Which token should I give an AI agent?
The narrowest one that does the job, with an expiry. On Canner, the MCP connector token covers projects, deploys, environment variables and domains, with no databases, billing or token management. It can set variables but not read them back, and it can’t delete a project. For an agent that only diagnoses, create a token with projects:read and deployments:read through the API.
Can an agent delete my project through Canner’s MCP server?
No. No MCP tool deletes projects, databases or domains, and the REST API refuses a project delete unless the token names the projects:delete scope, which a connector token doesn’t. A leaked connector token could still change and redeploy your projects, so give it an expiry and keep it out of shared places.
Does Canner’s MCP server support OAuth?
Not yet. It authenticates with a cnr_ API token sent as a Bearer header. The MCP spec makes authorization optional and recommends OAuth 2.1 for HTTP servers that support it; clients that require OAuth can’t connect to Canner until that is added.
Let the agent deploy. Keep the keys.
Scoped tokens, more than thirty tools, and nothing destructive exposed. Set it up from the MCP page.