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_ttl and destroy_stack. Each takes the project directory as path.
  • Or the agentserve CLI, if you'd rather the agent run shell commands: deploy, status, logs, extend and destroy.
  • The agentserve skill, 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.json in 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.

  1. Add the MCP server#

    Register it with claude mcp add. Everything after -- is the command Claude Code runs; uvx fetches the package on first use.

    claude mcp add agentserve -- uvx --from 'agentserve[mcp]' agentserve-mcp

    Add --scope user to make it available in every project, or --scope project to write it to a .mcp.json your team shares.

  2. 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.md

    Use ~/.claude/skills/agentserve/SKILL.md instead to install it for all your projects.

  3. Check it#

    Start claude and run /mcp. agentserve should 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.

  1. Install the CLI#

    Put agentserve on your PATH, and check it installed:

    uv tool install agentserve
    agentserve --help
  2. Let Claude run it#

    Claude Code asks before each new shell command. Allow agentserve once in the project's settings:

    {
      "permissions": { "allow": ["Bash(agentserve:*)"] }
    }
  3. 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.

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#

  • agentserve shows as failed in /mcp. Run the command by hand: uvx --from 'agentserve[mcp]' agentserve-mcp. If uvx isn'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 path is 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 read get_logs with build=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_stack on an old one.

More: Connect your agent, MCP tools, Manifest.

Stuck? Your agent can read /skill.md, or connect it over MCP.