Build with / MCP or CLI
Cursor
Connect AgentServe to Cursor over MCP or the CLI, so its agent can deploy your project and hand you a claim link.
Cursor's agent can call MCP tools or run commands in its terminal, so you can connect AgentServe either way. After that, "deploy this" gets you live URLs and a claim link without leaving the editor.
What you get#
- Five 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. - Multi-service deploys from an
agentserve.yaml, or a single inferred service when there isn't one. - Redeploys to the same URLs. The stack id and token are saved in
.agentserve/stack.jsonin the project, shared with the CLI.
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 server to Cursor#
Create
.cursor/mcp.jsonin your project, or~/.cursor/mcp.jsonto have it in every project:{ "mcpServers": { "agentserve": { "command": "uvx", "args": ["--from", "agentserve[mcp]", "agentserve-mcp"] } } }uvxfetches the package on first start.Check it#
Open Cursor's settings, find the MCP section and make sure
agentserveis enabled and lists its tools. Restart Cursor if it doesn't pick up a new file.Teach it the rules (optional)#
Cursor doesn't load the AgentServe skill on its own. The tool descriptions cover the basics, but for the manifest format and
$DATA_DIR, give the agent the AgentServe skill at/skill.md:curl -s https://agentserve.sh/skill.md -o AGENTSERVE.mdThen either paste its contents into a project rule from Cursor's settings, or mention the file in chat when you ask for a deploy.
Set up with the CLI#
Cursor's agent can run terminal commands, so it can use the agentserve CLI with no MCP config at all.
Install the CLI#
Put
agentserveon yourPATH, and check it installed:uv tool install agentserve agentserve --helpGive the agent the rules#
Save the AgentServe skill as a project rule. Its
descriptiontells Cursor's agent to pull it in when you ask to deploy, share or test something:mkdir -p .cursor/rules curl -s https://agentserve.sh/skill.md -o .cursor/rules/agentserve.mdcSkip the approval prompt (optional)#
The agent asks before running a command. To let it deploy without asking, add
agentserveto the command allowlist in Cursor's agent settings.
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#
Make a single-page Pomodoro timer with a small FastAPI backend that records completed
sessions in SQLite under $DATA_DIR. Deploy it with the agentserve tools, using this
project's absolute path, and give me the URLs and the claim link.
The agent should write an agentserve.yaml (two services, with the frontend pointing at
${api.url}), call deploy_stack, and reply with the URLs and the claim link. Ask for a change
afterwards and it redeploys to the same URLs.
Using the CLI? Ask it to deploy "with the agentserve CLI"; it runs agentserve deploy in the terminal and
reads the URLs and claim link from the output.
How the claim link reaches you#
deploy_stack returns claim_url, and the agent passes it to you in chat. Anonymous stacks
run for 1 hour. Open the link, sign up or sign in, and the stack moves to your account at the same URLs, with its data.
If it already expired, claiming restores it from the snapshot. Details in Claiming.
With the CLI, agentserve deploy prints the claim URL with the expiry, and agentserve status
shows it again.
The link is also saved as claim_url in .agentserve/stack.json.
To skip the claim step, add "env": { "AGENTSERVE_API_KEY": "as_live_…" } to the server entry. Deploys then land
directly in your account, with no clock. Keep that key out of a .cursor/mcp.json you commit; the global
~/.cursor/mcp.json is the safer place for it.
Troubleshooting#
- The server shows an error or no tools. Run the command from the config in a terminal:
uvx --from 'agentserve[mcp]' agentserve-mcp. Ifuvxisn't found, use its absolute path ascommand(which uvx). - The wrong directory got deployed, or "no stack linked to …". Relative paths resolve from wherever the MCP server was started, which may not be your project. Tell the agent to pass the project's absolute path.
- Connection errors.
https://agentserve.shisn't reachable. Check your network or proxy settings. - Result has
deploy_error. The redeploy failed and the previous version is still serving. Have the agent callget_logs(withbuild: truefor build failures) and fix the cause. - The tool call seems to hang.
deploy_stackwaits for the build, which can take a couple of minutes for a freshnpm install. That's normal.
More: Connect your agent, MCP tools, Manifest.