Build with / MCP

Any MCP client

Run the AgentServe MCP server over stdio and connect it to any client that speaks MCP.

AgentServe ships a standard MCP server that talks over stdio. Any client that can launch a local MCP server can use it: give it a command, some arguments and two environment variables.

What you get#

ToolWhat it does
deploy_stack(path, ttl?, name?, new?)Packs the directory and deploys it, or redeploys the stack already linked to it. Returns URLs and, for a new anonymous stack, the claim_url.
stack_status(path)Status, URLs and expiry.
get_logs(path, service?, build?, tail?)Runtime logs, or build logs with build=true.
extend_ttl(path, ttl)Pushes the expiry of an unclaimed stack out.
destroy_stack(path)Deletes the stack and its data.

The linked stack's id and manage token are saved in <path>/.agentserve/stack.json, the same file the CLI uses, and the token is kept out of tool results. Full reference: MCP tools.

Setup#

You need uv. The MCP server must run on the machine that has the project files, because it reads and packs them; it deploys to https://agentserve.sh.

  1. Configure your client#

    The launch command is:

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

    Most clients take it as a command, an argument list and an optional env map. In the common mcpServers JSON shape, that looks like:

    {
      "mcpServers": {
        "agentserve": {
          "command": "uvx",
          "args": ["--from", "agentserve[mcp]", "agentserve-mcp"]
        }
      }
    }

    Check your client's docs for where that goes and whether it uses the same keys.

  2. Add your API key (optional)#

    Set AGENTSERVE_API_KEY in the server's env to your account's key, starting with as_live_. Deploys then go straight into your account with no clock and no claim code.

  3. Test it by hand#

    If your client reports nothing useful, the MCP Inspector can launch the server and list its tools:

    npx @modelcontextprotocol/inspector uvx --from 'agentserve[mcp]' agentserve-mcp

A first prompt to try#

Write a static page that shows the current time in five cities, then deploy it with the
agentserve tools (use the project's absolute path) and give me the URL and the claim link.

A single index.html needs no manifest: AgentServe infers a static service. For multi-service apps, the agent writes an agentserve.yaml; see Manifest.

Clients don't know the manifest format or the $DATA_DIR rule unless you tell them. AgentServe publishes both at /skill.md. Put it wherever your client reads instructions from (a system prompt, a rules file), or paste it into the chat.

For a new anonymous stack, deploy_stack returns claim_url and a note asking the agent to give it to you. The stack runs for 1 hour. Open the link, sign up or sign in, and it moves into your account with the same URLs and data. If it expired first, claiming restores it from the kept snapshot. Details in Claiming.

The link is also stored as claim_url in .agentserve/stack.json, so it's never only in the transcript.

Troubleshooting#

  • "the MCP server needs the 'mcp' extra". Keep [mcp] in the --from argument.
  • Relative paths deploy the wrong thing. They resolve from wherever your client started the server, so path must be absolute.
  • Timeouts on deploy_stack. It waits until the build finishes, which can take minutes for a fresh npm install. Raise your client's tool timeout if it has one.
  • Connection errors. https://agentserve.sh isn't reachable. Check your network or proxy settings.
  • deploy_error in the result. The redeploy failed and the previous version is still serving. Read get_logs, fix, redeploy.

More: Connect your agent, Quickstart.

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