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_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.
  • 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.json in 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.

  1. Add the server to Cursor#

    Create .cursor/mcp.json in your project, or ~/.cursor/mcp.json to have it in every project:

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

    uvx fetches the package on first start.

  2. Check it#

    Open Cursor's settings, find the MCP section and make sure agentserve is enabled and lists its tools. Restart Cursor if it doesn't pick up a new file.

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

    Then 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.

  1. Install the CLI#

    Put agentserve on your PATH, and check it installed:

    uv tool install agentserve
    agentserve --help
  2. Give the agent the rules#

    Save the AgentServe skill as a project rule. Its description tells 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.mdc
  3. Skip the approval prompt (optional)#

    The agent asks before running a command. To let it deploy without asking, add agentserve to 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.

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. If uvx isn't found, use its absolute path as command (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.sh isn'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 call get_logs (with build: true for build failures) and fix the cause.
  • The tool call seems to hang. deploy_stack waits for the build, which can take a couple of minutes for a fresh npm install. That's normal.

More: Connect your agent, MCP tools, Manifest.

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