> ## Documentation Index
> Fetch the complete documentation index at: https://docs.monolex.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Kernel CLI and MCP

> Expose the full Kernel CLI surface as typed MCP tools, or use its computer_use compatibility facade when a client expects one capture-and-action loop.

Kernel CLI runs as a stdio MCP server. MCP is an access path over the same OS
capabilities as the CLI, not a second automation engine.

<Card title="Canonical MCP reference" icon="plug" href="/kernel-cli/reference#mcp-server">
  The current setup command, safety boundary, raw-tool model, and
  `computer_use` facade are maintained in the Kernel CLI reference.
</Card>

## Start the Server

Use the `mcp` subcommand:

```bash theme={null}
kernel-cli mcp
```

Client configuration:

```json theme={null}
{
  "mcpServers": {
    "kernel-cli": {
      "command": "kernel-cli",
      "args": ["mcp"]
    }
  }
}
```

<Warning>
  Direct `kernel-cli mcp` is raw capability. Mutating tools do not inherit the
  NIIA OTP gate merely because they are called through MCP.
</Warning>

## Two Tool Shapes

| Shape           | Best for                                                                      |
| --------------- | ----------------------------------------------------------------------------- |
| Raw typed tools | Full OS observation, control, telemetry, exact diagnostics, and named actions |
| `computer_use`  | Clients built around one capture/action loop and reusable element handles     |

Start with MCP `health_report` to inspect the live permission and capability
state. Use raw `targets` and `act` when precise Kernel CLI handles are the right
contract.

The `computer_use` facade can return structured elements alongside image
content and can reuse element handles across actions. It is a compatibility
surface over Kernel CLI's capabilities: the usage shape may be familiar, but
the underlying architecture remains Kernel CLI's own.

## CLI, MCP, and connector.json

```text theme={null}
Direct terminal client ──→ Kernel CLI commands
MCP client             ──→ raw typed tools or computer_use
connector.json         ──→ composed Kernel CLI command steps
NIIA                   ──→ human-gated observe/control harness
```

`connector.json` can pass command results and guards between phases. The MCP
facade owns MCP-specific element tokens. NIIA owns human authorization. These
contracts complement one another; they are not interchangeable.

## Recording

Kernel CLI can record mutating MCP tool calls for audit and controlled replay.
That trajectory is not a video. Add a visual recorder separately when the proof
must include on-screen pixels.

## Continue Reading

<CardGroup cols={2}>
  <Card title="Kernel CLI Reference" icon="book" href="/kernel-cli/reference#mcp-server">
    MCP setup, tool shapes, health reporting, recording, and raw-capability
    safety.
  </Card>

  <Card title="Kernel CLI Workflows" icon="route" href="/kernel-cli/workflows#8-connect-an-mcp-client">
    Configure a client and choose between raw tools and the compatibility
    facade.
  </Card>
</CardGroup>
