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.
On this page10 sections
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.
Clients covered
Three pieces do the work:
- The
kaptenskill teaches the agent Kapten’s resource model and how to use it: confirm the organization before changing anything, then verify the result. - The
kaptenMCP 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-docsMCP 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.
- Coding agent connects to kapten mcp serve (stdio).
- kapten mcp serve connects to Platform API (https).
- Coding agent connects to kapten-docs (http).
Before you start
You will need:
- A Kapten account. Request early access if you do not have one yet.
- The
kaptenCLI, or Node.js to run it withnpx. 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.
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.
--operationslimits 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.
Troubleshooting
- The agent says it has no Kapten tools. Restart the client after installing, and check that the
kaptenserver is enabled in its MCP settings. - The server fails to start. Check that Node.js is installed for the
npxconfiguration, or thatkaptenandrestish-mcpsit 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
--contextand 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
- The docs page on coding agents is the reference for everything above, and
kapten mcp servelists every flag. - Read Guardrails for agents that touch production before giving an agent write access to production.
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.