I gave my AI agent a Tugport key that sees one project: Tugport's MCP server, tested
Tugport 0.1.31 runs as an MCP server over stdio with 32 tools. I tested it with the key my own agent uses, which sees one project, can't read secrets and can't delete anything.
Tugport 0.1.31 can now run as an MCP server over stdio. An agent starts tugport mcp locally and gets 32 tools for projects, deploys, logs, env vars, domains, backups and the audit log, all forwarded to your panel with the agent's own API key. I tested it on 8 November 2026 against the panel that runs most of my sites using the key my own AI agent uses every day. The best part is how little that key can see: one project, with the operator role, and nothing else.
What tugport mcp does
MCP clients like Claude Code and Codex either talk to a URL or spawn a command over stdin and stdout. Tugport already had the URL side via POST /mcp on the panel. Version 0.1.31 (released 29 October) added the stdio command (commit 6af9168). It's roughly thirty lines in src/cli.rs: read one JSON-RPC message per line, post it to the panel's /mcp with your saved bearer key, and write the reply back on one line. Notifications get a 202 and stay silent, matching what the MCP stdio transport expects.
You wire it up to a panel like the rest of the CLI, either with tugport login https://panel.example.com --token tpk_... or by putting TUGPORT_URL and TUGPORT_TOKEN right in the client's config:
{ "mcpServers": { "tugport": { "command": "tugport", "args": ["mcp"],
"env": { "TUGPORT_URL": "https://panel.example.com", "TUGPORT_TOKEN": "tpk_..." } } } }The release binary is a single file with no extra dependencies, so the agent doesn't need to run on the server it deploys to.
What I ran, and what came back
First I tried it without a panel at all. I grabbed tugport-linux-x86_64 from the v0.1.31 release, ran tugport mcp logged out, and piped in the three startup messages a client sends: initialize, the initialized notification and tools/list. Back came protocol version 2025-06-18, server name tugport, version 0.1.31 and all 32 tools. When I actually tried calling list_projects, it returned a plain error telling me I wasn't connected to a panel and showing how to log in. That offline mode is on purpose: the commit notes it lets MCP directories inspect the server without credentials.
Next I tested against my live panel by sending tools/list and a few tool calls straight to https://admin.borodutch.com/mcp with the agent's key (the exact endpoint the stdio wrapper forwards to). The panel reported version 0.1.31 (commit 6af9168) and Docker 29.9.2. I didn't run the stdio wrapper directly against production; I checked what it forwards in the source.
list_projects returned just one project, marketing, showing my agent's role as operator with seven services (six running, one stopped). Calling get_service on marketing.kuma-test, the test service my agent uses for guides, returned its domain, port 3001, the louislam/uptime-kuma:2 image, and the last deploy's actor (radiant) and trigger (agent).
list_env came back with "values_visible": false because this key lacks the secrets:read grant, so it sees variable names and never values. Asking get_project for default or borodutch returned project not found for both. Whether those projects exist on my server or not, they look identical to missing ones from this key's side, so an agent can't even probe for names. /api/me sums up the whole identity in one line: kind agent, no all-projects role, no grants, one project role.
The 32 tools, grouped
There's more in the list than you'd expect from a deploy tool. Broken down by area:
- Projects and services:
list_projects,get_project,create_project,create_service,get_service,update_service,delete_service,list_services. - Deploys:
deploy(waits for the result unless you tell it not to),list_deploys,get_deploywith the full log,cancel_deploy,rollback. - Running services:
restart,stop,start,get_logs,exec,list_env,set_env,add_domain,remove_domain. - Servers and metrics:
list_servers,server_status,metrics. - Databases and backups:
list_replicas,add_replica,promote_replica,list_backups,run_backup,backup_run. - Audit:
audit_log, who did what, newest first.
Handing an agent delete_service and exec sounds sketchy until you check how permissions work. Everyone gets the same tool list, while the API roles gate every call: a viewer reads status, logs and env var names; a deployer deploys, restarts and rolls back; an operator changes settings and creates services; an admin deletes things. Deleting also requires a separate destroy grant, and reading env values requires secrets:read. My agent has the operator role with neither grant, so it can create, deploy and stop its own test service, and I don't have to rely on prompts to keep it from deleting anything.
Why I prefer a key that sees one project
Usually giving an agent server access means handing it a shell, which is all or nothing. With a scoped Tugport key, the agent sees one project, stays inside its role, and leaves every action in the audit log stamped with its name and key. If it goes sideways, I revoke that key with DELETE /api/keys/{id} and nothing else moves. To put a second agent on a different project, run tugport agent <name> --project <project>:<role> on the panel to print a one-time key, and tack on --expires-days if you want it to die automatically.
Since any MCP client can talk to it, one setup works across tools: command-based clients run tugport mcp, URL-based ones hit /mcp, scripts call the REST API, and all three obey the exact same roles.
What I did not test
I didn't touch delete_service, exec, add_replica or any backup tool, since those touch production and my agent has no business running them here. I skipped latency numbers too: every request crossed the internet and went through a key-holding proxy, so timing them would only measure that round trip.
Try it
Install Tugport on a VPS with curl -fsSL https://tugport.com/install | sh, open the one-time link to set up the owner account, add an agent user scoped to one project, and hand its key to your client. Every endpoint and the MCP setup live in the API reference, and the full source is in the repository. Tugport is still at 0.1.x, so expect rough edges and tell me what breaks.
Tested on 8 November 2026 with Tugport 0.1.31 (linux x86_64 client and the panel at 0.1.31, commit 6af9168).