# cortex-mcp

Source: https://usecns.dev/cortex-cli-mcp/

[Start here](https://usecns.dev/manual-cortex/)
[CLI commands](https://usecns.dev/commands-cortex/)
[Configuration & integration](https://usecns.dev/cortex-topics/)

Usage: `cortex-mcp [--daemon-url <URL>] [--token <TOKEN>]`. Newline-delimited JSON-RPC on stdin/stdout, sequentially forwarded to daemon POST `/mcp`; it does not host durable state itself. URL otherwise `PI_DURABLE_DAEMON_URL`, then host/port environment (defaults 127.0.0.1:4319). Unlike operator CLI it does not discover `daemon.json` or load `.env`. Token otherwise `PI_DURABLE_API_TOKEN`. No other consumed options, no help/version/subcommands; unknown flags are ignored. Parser takes separate values, not operator-style equals syntax.

Retains returned `Mcp-Session-Id` for subsequent requests. Invalid JSON emits JSON-RPC parse error; malformed envelopes emit invalid request; request transport/decoding failures emit internal error. Notifications and 202/204 responses do not emit replies. Do not put logging on stdout in a host integration.

See [CLI conventions](https://usecns.dev/cortex-cli-usage/) for shared configuration and exit behavior, or [browse all commands](https://usecns.dev/commands-cortex/).