# MCP Commands

Switch the daemon's HTTP MCP endpoint on or off with `kura remote`, and serve MCP over stdio with `kura mcp`.

## Control the HTTP MCP endpoint

```bash
kura remote enable
kura remote disable
```

Both write the `remote` flag to `config.json` and print `remote MCP enabled (/mcp)` or `remote MCP disabled`. `/mcp` is unmounted unless the flag is true, so an unconfigured daemon answers 404 there while `/api/*` keeps working.

Routes are decided at startup, so each command restarts the daemon when one is running. When no daemon is running it only persists the flag. A missing or unknown argument prints usage and exits with status 2.

## Serve MCP over stdio

```bash
kura mcp
```

The command opens the registered databases in its own process, restores its vector cache from SQLite, and speaks JSON-RPC on stdin and stdout. It is meant to be spawned by an MCP client rather than run by hand; diagnostics go to stderr so they never corrupt the protocol stream. Closing stdin or sending `SIGINT`/`SIGTERM` ends the session with status 0.

It does not require the daemon to be running, registers no query-cache write hook, and starts no watcher or embedding loop. It still needs an OpenAI API key, because semantic queries are embedded on demand. See [Connect a Client](/mcp-server-connect) for client configuration and [MCP Tools](/mcp-server-tools) for the tool contract.
