Build with / MCP, CLI + skill
Claude Code
Give Claude Code the AgentServe MCP tools or CLI, plus the skill, so it can deploy what it builds and hand you a claim link.
Claude Code can use AgentServe through MCP tools or the agentserve CLI, plus a skill file
that tells it when to deploy and what to tell you afterwards. Together they turn "it runs on my machine" into a live
URL and a claim link in the same conversation.
What you get#
- Five MCP tools:
deploy_stack,stack_status,get_logs,extend_ttlanddestroy_stack. Each takes the project directory aspath. - Or the
agentserveCLI, if you'd rather the agent run shell commands:deploy,status,logs,extendanddestroy. - The
agentserveskill, which Claude loads when you ask to see, share or test what it built. It covers the manifest,$DATA_DIR, what to do when a redeploy fails, and the rule that the claim URL goes to you. - Redeploys to the same URLs. The stack id and manage token are saved in
.agentserve/stack.jsonin the project, shared with the CLI, so you can switch between them.
Set up with MCP#
You need uv. The MCP server runs on your machine over stdio, because it
reads and packs your project directory; it deploys to https://agentserve.sh.
Add the MCP server#
Register it with
claude mcp add. Everything after--is the command Claude Code runs;uvxfetches the package on first use.claude mcp add agentserve -- uvx --from 'agentserve[mcp]' agentserve-mcpAdd
--scope userto make it available in every project, or--scope projectto write it to a.mcp.jsonyour team shares.Install the skill#
AgentServe serves the skill at
/skill.md. Save it where Claude Code looks for project skills:mkdir -p .claude/skills/agentserve curl -s https://agentserve.sh/skill.md -o .claude/skills/agentserve/SKILL.mdUse
~/.claude/skills/agentserve/SKILL.mdinstead to install it for all your projects.Check it#
Start
claudeand run/mcp.agentserveshould be listed as connected, with five tools.
Set up with the CLI#
Prefer shell commands to MCP? Claude Code can drive the agentserve CLI from its Bash tool; the skill's
examples are already CLI commands.
Install the CLI#
Put
agentserveon yourPATH, and check it installed:uv tool install agentserve agentserve --helpLet Claude run it#
Claude Code asks before each new shell command. Allow
agentserveonce in the project's settings:{ "permissions": { "allow": ["Bash(agentserve:*)"] } }Install the skill#
Same as step 2 above, if you haven't already. It tells Claude when to deploy, how to write the manifest and to hand you the claim URL.
The CLI and the MCP server share .agentserve/stack.json, so you can set up both and mix them: a stack
deployed with one is redeployed by the other, at the same URLs. Every command is in the CLI
reference.
A first prompt to try#
Build a small guestbook: a FastAPI backend that stores entries in SQLite under $DATA_DIR,
and a static Vite frontend that lists and adds entries. Deploy it with AgentServe and give
me the URLs and the claim link.
Claude should write an agentserve.yaml with two services, wire the frontend to the backend with
${api.url}, call deploy_stack, and reply with both URLs, the expiry time and the claim
link. Then ask for a change ("add a delete button") and watch it redeploy to the same URLs, with the entries still
there.
With the CLI, ask it to deploy "with the agentserve CLI" instead; it runs agentserve deploy and
reads the URLs and claim link from the output.
How the claim link reaches you#
The deploy_stack result contains claim_url, and the skill tells Claude to pass it on with
the expiry time. Anonymous stacks run for 1 hour. Open the link, enter an email and password, and the stack is yours:
the clock stops and the URLs stay the same. If you're late, the snapshot is kept after expiry and claiming restores it.
See Claiming.
With the CLI, agentserve deploy prints the claim URL with the expiry, and agentserve status
shows it again.
If the link scrolled away, it's also saved as claim_url in .agentserve/stack.json.
Want to skip claiming? Put your AGENTSERVE_API_KEY in the MCP server's environment (add
--env AGENTSERVE_API_KEY=as_live_… to the claude mcp add command), and deploys go straight into
your account with no clock.
Troubleshooting#
agentserveshows as failed in/mcp. Run the command by hand:uvx --from 'agentserve[mcp]' agentserve-mcp. Ifuvxisn't found, install uv and restart Claude Code.- Tool calls fail with a connection error. The MCP server can't reach
https://agentserve.sh. Check your network or proxy settings. - "no stack linked to …", or the wrong directory got deployed. A relative
pathis resolved from wherever the MCP server was started, which may not be your project. Ask Claude to pass the project's absolute path, and the same one every time. - The redeploy "failed" but the site still works. That's the rollback: the previous version keeps
serving and the result has
deploy_error. Ask Claude to readget_logswithbuild=true, or for a service, and fix it. - 429 on deploy. Too many unclaimed stacks are running from your network. Claim one or have Claude
call
destroy_stackon an old one.
More: Connect your agent, MCP tools, Manifest.