Kapten
All guides

Agents & MCP

Connect Kapten to Claude Code, Cursor and Codex

Install the Kapten skill and MCP servers in your coding agent, log in, limit what it can do and run your first prompts.

Cover illustration for Connect Kapten to Claude Code, Cursor and Codex, beginner levelAgents & MCPBeginner · 80a6
On this page10 sections
  1. 01What you are connecting
  2. 02Before you start
  3. 03Claude Code: install the plugin
  4. 04Any agent: install with the CLI
  5. 05Other MCP clients: configure it by hand
  6. 06Limit what the agent can do
  7. 07Five first prompts
  8. 08What the tool calls look like
  9. 09Troubleshooting
  10. 10Next steps

What you are connecting

Kapten works with coding agents through the Model Context Protocol (MCP), an open standard for giving an AI assistant a structured set of tools. Once connected, your agent can list your projects and environments, read run logs, deploy, and search the Kapten docs, with the same rights as your own login.

Three pieces do the work:

  • The kapten skill teaches the agent Kapten’s resource model and how to use it: confirm the organization before changing anything, then verify the result.
  • The kapten MCP server, kapten mcp serve, gives the agent the CLI’s operations as tools. It runs on your machine, over stdio, with your CLI login. It has no network listener.
  • The kapten-docs MCP server, https://docs.kapten.io/mcp, lets the agent search and read the docs, so its answers come from the docs and not from memory.
Claude Code, Cursor or another MCP client starts the kapten MCP server on your machine over stdio. That server calls the Kapten Platform API with your CLI login. The client also reaches the kapten-docs MCP server over HTTP to search the documentation.Your machineKaptenCoding agentClaude Code · Cursor · Codexkapten mcp servestdio · your loginPlatform APIsame roles as your loginkapten-docsdocs.kapten.io/mcpstdiohttpshttp
  • Coding agent connects to kapten mcp serve (stdio).
  • kapten mcp serve connects to Platform API (https).
  • Coding agent connects to kapten-docs (http).
Figure 1. The kapten server runs locally with your login and calls the Kapten API; the docs server is remote and read-only.

Before you start

You will need:

  • A Kapten account. Request early access if you do not have one yet.
  • The kapten CLI, or Node.js to run it with npx. The CLI overview lists the install options (mise, npm, Homebrew or an archive).
  • At least one project to work on.

Log in once, and give the login a name so the MCP server can use it explicitly:

kapten login --name work

The CLI shows a code and opens a page in your browser. Check that the page shows the same code, approve it, and pick an organization.

Claude Code: install the plugin

The kapten-io/skills plugin bundles both skills (kapten and kapten-docs) and both MCP servers:

/plugin marketplace add kapten-io/skills
/plugin install kapten@kapten

Its kapten server runs the CLI with npx, so it needs Node.js and a login. Codex, Cursor and other clients of the Agent Plugins standard install the same plugin from the same repository.

Any agent: install with the CLI

kapten skills install writes the skill for your CLI version where your agents read skills. With --mcp, it also adds both MCP servers to their configuration:

# this project, every agent on this machine
kapten --context work skills install --mcp

# for your user, one agent
kapten skills install --global --mcp --agent codex

It knows Claude Code, Codex, Cursor, OpenCode and GitHub Copilot, leaves the rest of their configuration untouched, and updates its own entries when you run it again.

Other MCP clients: configure it by hand

Claude Desktop, VS Code and any other client that runs stdio servers take a configuration like this one:

{
  "mcpServers": {
    "kapten": {
      "command": "npx",
      "args": ["-y", "@kapten/cli@latest", "--context", "work", "mcp", "serve"]
    }
  }
}

The server picks its context when it starts and keeps it: kapten auth use does not change a running server. To work with several organizations, add one server per context, each with its own name.

$ kapten login --name work
Logged in to acme as [email protected] (context: work)
$ kapten --context work skills install --mcp
Installed the kapten skill and the kapten, kapten-docs MCP servers for Claude Code
$ claude
> List my Kapten projects and the environments of storefront.
listProjects() · listEnvironments(project: storefront)
storefront: development · staging · production
Figure 2. Log in, install the skill and servers, then a first read-only question.Illustrative session

Limit what the agent can do

The kapten server exposes every operation the CLI has, including deletes. The agent can do what your login can do, no more. Three controls narrow that:

  • Run it as an OAuth application. For narrower access than your own login, create an OAuth application with only the roles it needs, and start the server with its credentials.

  • Allowlist operations. --operations limits the tools to a list of operation IDs from the Platform API. A read-only setup looks like this:

    "args": ["--context", "work", "mcp", "serve", "--operations", "listProjects,listEnvironments,queryApplicationRunLogs"]
  • Let the client ask. Delete tools are marked destructive, so clients that ask before running such tools ask for them. Allow read tools automatically, and confirm the others yourself.

--request-timeout bounds each API request (30 seconds by default) and --max-result-bytes the size of a tool’s result (1 MiB by default). The guardrails guide covers the wider policy.

Five first prompts

The first three only read. The last two change something, so your client will show the call before it runs.

1. Get your bearings.

List my Kapten projects. For each one, list its environments
and the components running in each environment.

2. Read the logs.

The api in staging returned errors in the last hour. Read its run
logs and tell me what you think happened. Don't change anything.

3. Check usage.

Show the usage of each environment of storefront this month.

4. Add configuration.

Add a LOG_LEVEL=debug variable to the api component in staging,
then redeploy it.

5. Ask the docs.

Using the Kapten docs, explain how I would run a migration job
before the api and worker deploy, then draft the pipeline.

What the tool calls look like

Your client shows each Kapten tool call before it runs, with its arguments. Tools are named after the Platform API operation they call: listProjects, getEnvironment and queryApplicationRunLogs read; createEnvironmentVariable, deployApplication and runPipeline change something. The docs server adds search_docs, get_page and list_pages.

$ add LOG_LEVEL=debug to api in staging and redeploy
kapten: listEnvironmentComponents(environment: staging) · read
createComponentVariable(component: api, name: LOG_LEVEL) · allow?
$ yes
deployApplication(application: api) · allow?
$ yes
api redeployed in staging with LOG_LEVEL=debug.
Figure 3. Reads run on their own; the change waits for your confirmation.Illustrative session

Troubleshooting

  • The agent says it has no Kapten tools. Restart the client after installing, and check that the kapten server is enabled in its MCP settings.
  • The server fails to start. Check that Node.js is installed for the npx configuration, or that kapten and restish-mcp sit in the same directory if you installed from an archive.
  • The agent works in the wrong organization. The server keeps the context it started with. Name the context with --context and restart the client.
  • A tool returns a permission error. The login or OAuth application lacks the role for that operation. Grant it deliberately, or keep the agent on read tools.

Next steps

Build with Kapten

Start with one service.
Build from there.

Tell us what you want to deploy. We review each request and follow up about fit and onboarding on your preferred cloud.

Free during early access. No card required. Cloud usage billed separately.