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#
| Tool | What 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.
Configure your client#
The launch command is:
uvx --from 'agentserve[mcp]' agentserve-mcpMost clients take it as a command, an argument list and an optional env map. In the common
mcpServersJSON 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.
Add your API key (optional)#
Set
AGENTSERVE_API_KEYin the server's env to your account's key, starting withas_live_. Deploys then go straight into your account with no clock and no claim code.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.
How the claim link reaches you#
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--fromargument. - Relative paths deploy the wrong thing. They resolve from wherever your client started the server,
so
pathmust be absolute. - Timeouts on
deploy_stack. It waits until the build finishes, which can take minutes for a freshnpm install. Raise your client's tool timeout if it has one. - Connection errors.
https://agentserve.shisn't reachable. Check your network or proxy settings. deploy_errorin the result. The redeploy failed and the previous version is still serving. Readget_logs, fix, redeploy.
More: Connect your agent, Quickstart.