ctx speaks the Model Context Protocol over stdio — JSON-RPC 2.0, one message per line. There is no daemon and no network port. The client spawns ctx mcp as a child process, and all logs go to stderr so stdout stays protocol-clean.
{
"mcpServers": {
"ctx": {
"command": "ctx",
"args": ["mcp", "-R", "/path/to/project"]
}
}
}If you don't want a global install, npx will fetch the package on first use:
{
"mcpServers": {
"ctx": {
"command": "npx",
"args": ["-y", "ctxai-cli", "mcp", "-R", "/path/to/project"]
}
}
}{
"mcpServers": {
"ctx": {
"command": "npx",
"args": ["-y", "ctxai-cli", "mcp", "-R", "/path/to/project"]
}
}
}{
"mcpServers": {
"ctx": {
"command": "npx",
"args": ["-y", "ctxai-cli", "mcp", "-R", "/path/to/project"]
}
}
}Once connected, the agent can call:
| Tool | Purpose |
|---|---|
| ctx_project | Project overview: root, git status, index counts. |
| ctx_search | Find symbols or files by name, with kind and file filters. |
| ctx_skeleton | Body-less structural skeleton of a file. |
| ctx_symbol | Definition, references, and dependencies of a symbol. |
| ctx_dependencies | What a file imports. |
| ctx_dependents | What imports a file. |
| ctx_impact | What would break if a symbol or file changed. |
| ctx_context | Relevance-ranked context package for a task. |
| ctx_changed | Symbols changed in the working tree or since a ref. |
| ctx_diff | Symbol-level diff between two refs. |
The server negotiates the 2025-06-18 protocol version. Failures surface as isError: true in tool results rather than unhandled exceptions, so the client keeps running. Stdout is reserved for protocol frames — everything else goes to stderr.