kx mcp
Runs a Model Context Protocol server on stdin/stdout, for an MCP client — Claude Code, an IDE, an agent framework — to start as a subprocess.
Thirteen tools: list_marks and mark for kx’s marks; list_resources to list a kind; diagnose and tree for a resource’s health and ownership; events and logs for what happened; top for current usage; describe for kubectl describe’s account of it; get_yaml for its manifest (Secrets redacted); rollout_history for a workload’s revisions; scan for image CVEs; and docs for kx’s own documentation, built into the binary.
Resources to attach, in a client that offers them with @: kx://listing, your current kx listing; kx://context, where the next call reaches; kx://marks; and one kx://docs/ page per documentation topic.
Prompts to run, in a client that offers them as commands: triage a namespace, explain one resource, check a workload’s latest rollout, and summarize a namespace’s image CVEs. Each is instructions for the agent, which then uses the tools above.
Every tool is read-only against the cluster. Resources are named by kind and name, by a mark, or by an index — a row number from your terminal’s current listing, read live. By default the one thing it writes is a new mark, and it refuses to move one you already set.
The server follows your kubeconfig live: switch context and the next call reads the new cluster, and says so in its result.
With --write-listings, what the agent lists — list_resources, a diagnose sweep, tree and top — is saved to your kx history as kx get, kx diag, kx tree and kx top would save it, and each row carries its index, so a number the agent quotes works in your terminal. Those listings are tagged: kx state says ‘via kx mcp’, and kx delete and kx drain say an index came from one before they act.
Usage
kx mcp [OPTIONS]Options
| Option | Description |
|---|---|
--write-listings | Save the agent’s listings to your kx history, tagged as agent-made, so their indexes work in your terminal |
Global options
| Option | Description |
|---|---|
--no-color | Disable styled output |
-h, --help | Show this message and exit |
Examples
claude mcp add kx -- kx mcp
claude mcp add kx -- kx mcp --write-listings