Local MCP for Claude Code
konsolity mcp starts a local MCP server on standard input and output (stdio). A Claude agent running on the same machine, Claude Code for example, uses it to list your hosts and run commands on them, with exactly the same rules as konsolity run. Nothing goes through the remote Claude connector: the agent talks directly to the CLI.
The machine must be activated with the mcp domain (and hosts, snippets for the matching tools).
Connect Claude Code
claude mcp add konsolity -- konsolity mcp
Check that the server is seen:
claude mcp list
Claude Code starts konsolity mcp for every session and stops it at the end. Each open MCP session shows in the list of CLI sessions of the account, and can be ended there.
Tools
| Tool | Domain | Role |
|---|---|---|
list_hosts |
hosts |
Hosts in the scope: identifier, label, address, user, group. No secret. |
list_snippets |
snippets |
Snippets in the scope: identifier, name, group. |
run_command |
hosts, full access |
Runs a command on a host in the scope, according to the command rules. |
run_snippet |
snippets + hosts, full access |
Runs a snippet on a host in the scope. |
list_sessions |
sessions |
CLI sessions running on the account. |
With read-only access, only the list tools are offered.
Same rules
- Host outside the scope, command matching no rule: refused, with a clear message for the agent and a line in the log.
- Destructive command: confirmation in the app or on the console before anything runs, even with "Any command".
- Timeout: capped by the maximum timeout of the machine (60 s by default, 1 h at most).
- Revocation or end of session: the running command is stopped in less than 5 seconds and the MCP server stops.
Limited output
A tool result returns the exit code, the duration, and the standard output and error output, limited to 64 KiB each. Beyond that, the output is truncated and the result says so. For the full output, use konsolity run in a terminal, whose output is not limited.
Three ways to connect Claude
konsolity mcp |
Claude connector | konsolity serve |
|
|---|---|---|---|
| Claude used | Claude Code (or an agent) on the same machine | claude.ai, Claude app | claude.ai, Claude app |
| Transport | local stdio | https://mcp.konsolity.com/mcp |
connector queue, picked up by the machine |
| Who runs it | the CLI on this machine | the open desktop app | the CLI as a service, without an interface |
| Approval | scope and rules of the machine | "Allow once" in the app | scope and rules of the machine |
| Documentation | this page | Claude connector | Service and storage |
In every case, destructive commands coming from a CLI machine wait for your confirmation.