Docs/Candor Deploy

Deploy from Pi: connect the Candor MCP

Connect the Pi coding agent to Candor Deploy so you can say 'deploy this to Candor' — install the MCP adapter, add one server, sign in.

Candor Deploy runs an MCP server at https://api.candorhost.app/mcp. Pi reaches MCP servers through an extension, so it’s one install plus one config entry — then you can tell Pi to deploy an app and it does: detects the stack, provisions any databases, and hands back the live URL.

Connecting is a sign-in: Pi sends you to Candor, you sign in the way you do for the portal, pick the project the agent may deploy to, and approve.

Install the MCP adapter

pi install npm:pi-mcp-adapter

That adds an /mcp command to Pi (/pi-mcp if your setup already reserves /mcp).

Add the server

The adapter reads the same .mcp.json format Claude Code uses. Put it at the repo root for one project, or in ~/.config/mcp/mcp.json for everywhere:

{
  "mcpServers": {
    "candor": {
      "url": "https://api.candorhost.app/mcp",
      "auth": "oauth"
    }
  }
}

Then sign in from inside Pi:

/mcp-auth candor

Pi opens the Candor sign-in in your browser; approve, and the credential is stored in your OS keychain, bound to the server’s URL. /mcp tools lists what Candor exposes. Then: deploy this repo to Candor.

Running Pi on a remote machine (over SSH, in a container)? Pi shows the authorization URL first — open it in your local browser. After you approve, the browser is sent to a localhost callback that lives on the remote machine, so it will show “can’t connect”. That’s expected: copy the full URL from the address bar, choose Yes in Pi when it offers the callback input, and paste it there. Pi finishes the sign-in from that.

Using a token instead

For CI or a machine with no browser, an API token works in place of the sign-in. In the portal, open Account → API tokens → Create token (or a project’s own tokens page for a token confined to that project), copy it, and send it as a header — leaving auth out so the adapter doesn’t also try to sign in:

{
  "mcpServers": {
    "candor": {
      "url": "https://api.candorhost.app/mcp",
      "headers": { "Authorization": "Bearer YOUR_TOKEN" }
    }
  }
}

Keep a file with a token out of version control; the ~/.config/mcp/mcp.json location is the safer home for it.

What you can ask

  • Deploy a repo — “deploy github.com/me/myapp to Candor.” Push your latest commit first; Candor builds from your git remote.
  • Create a service in a project, set or list its environment variables, then redeploy so they apply.
  • Check a deploy — the phase, and the build logs if it failed.
  • List what you’ve deployed — projects, services and their URLs — and who you are: the account and plan limits the connection acts under.

What the connection can do, and revoking it

Approving gives Pi developer access to one project — the one you picked. It can deploy, configure and read logs there; it can’t touch other projects, members, or billing. Behind the scenes it holds a project API token, listed with that project’s tokens in the portal; revoke it there and the connection stops working immediately.

Something here wrong, unclear, or missing? Tell us — docs get fixed like bugs.