Build with / MCP or CLI
Windsurf
Connect AgentServe to Windsurf's Cascade agent over MCP or the CLI, so it can deploy your project and give you a claim link.
Windsurf's Cascade agent can use MCP servers or run terminal commands. Connect AgentServe either way and Cascade can deploy what it built to live URLs, check logs when a build fails, and pass you a claim link to keep the result.
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 stacks from an
agentserve.yaml, or one inferred service if there's no manifest. - Redeploys to the same URLs, tracked in
.agentserve/stack.jsonin the project and 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.
Open Windsurf's MCP config#
In Windsurf, open the MCP settings from the Cascade panel and choose to edit the raw config. The file is
~/.codeium/windsurf/mcp_config.json.Add AgentServe#
{ "mcpServers": { "agentserve": { "command": "uvx", "args": ["--from", "agentserve[mcp]", "agentserve-mcp"] } } }If the file already has other servers, add
agentservenext to them insidemcpServers.uvxfetches the package on first start.Refresh and check#
Refresh the MCP servers in Windsurf (or restart it).
agentserveshould show its five tools.
For the manifest format and the rules about $DATA_DIR, give Cascade the
AgentServe skill: curl -s https://agentserve.sh/skill.md -o AGENTSERVE.md, then add it to a rule
or mention it in chat.
Set up with the CLI#
Cascade can run terminal commands, so it can use the agentserve CLI instead of the MCP server.
Install the CLI#
Put
agentserveon yourPATH, and check it installed:uv tool install agentserve agentserve --helpGive Cascade the rules#
Save the AgentServe skill as a workspace rule, so Cascade knows the manifest format and to hand you the claim link:
mkdir -p .windsurf/rules curl -s https://agentserve.sh/skill.md -o .windsurf/rules/agentserve.mdSkip the approval prompt (optional)#
Cascade asks before running commands. Add
agentserveto the allow list for Cascade's terminal commands in Windsurf's settings to let it deploy without asking.
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#
Create a shared shopping list: a FastAPI backend with SQLite under $DATA_DIR and a static
Vite frontend. Deploy it with the agentserve tools using this project's absolute path,
then give me both URLs and the claim link.
Cascade should write an agentserve.yaml, wire the frontend to ${api.url}, call
deploy_stack and report back. Ask for a change and it redeploys to the same URLs, list items intact.
Using the CLI? Ask for it "with the agentserve CLI"; Cascade runs agentserve deploy and reads the URLs
and claim link from the output.
How the claim link reaches you#
The deploy_stack result includes claim_url, and Cascade passes it to you in chat.
Anonymous stacks run for 1 hour. Open the link, sign up or sign in, and the stack moves into your account with the same
URLs and data. Claiming after expiry still works while the snapshot is kept. See Claiming.
With the CLI, agentserve deploy prints the claim URL with the expiry, and agentserve status
shows it again.
The link is also in .agentserve/stack.json under claim_url.
To deploy straight into your account, add "env": { "AGENTSERVE_API_KEY": "as_live_…" } to the server entry. No claim
code, no clock.
Troubleshooting#
- The server shows an error. Run the command in a terminal:
uvx --from 'agentserve[mcp]' agentserve-mcp. Ifuvxisn't found, use its absolute path (which uvx) ascommand. - 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. Ask Cascade for the project's absolute path.
- 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. Have Cascade readget_logsand fix the cause.- 429 on deploy. Your network has too many unclaimed stacks running. Claim or destroy one.
More: Connect your agent, MCP tools, Manifest.