MCP server

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.

Global install (Claude Desktop, opencode)

opencode / Claude Desktop
{
  "mcpServers": {
    "ctx": {
      "command": "ctx",
      "args": ["mcp", "-R", "/path/to/project"]
    }
  }
}

No install needed (npx)

If you don't want a global install, npx will fetch the package on first use:

opencode / Claude Desktop
{
  "mcpServers": {
    "ctx": {
      "command": "npx",
      "args": ["-y", "ctxai-cli", "mcp", "-R", "/path/to/project"]
    }
  }
}

Cursor

.cursor/mcp.json
{
  "mcpServers": {
    "ctx": {
      "command": "npx",
      "args": ["-y", "ctxai-cli", "mcp", "-R", "/path/to/project"]
    }
  }
}

VS Code / Cline / Roo

mcp.json
{
  "mcpServers": {
    "ctx": {
      "command": "npx",
      "args": ["-y", "ctxai-cli", "mcp", "-R", "/path/to/project"]
    }
  }
}

The ten tools

Once connected, the agent can call:

ToolPurpose
ctx_projectProject overview: root, git status, index counts.
ctx_searchFind symbols or files by name, with kind and file filters.
ctx_skeletonBody-less structural skeleton of a file.
ctx_symbolDefinition, references, and dependencies of a symbol.
ctx_dependenciesWhat a file imports.
ctx_dependentsWhat imports a file.
ctx_impactWhat would break if a symbol or file changed.
ctx_contextRelevance-ranked context package for a task.
ctx_changedSymbols changed in the working tree or since a ref.
ctx_diffSymbol-level diff between two refs.

Protocol notes

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.

The server reads source code only through its index. It does not execute project code, does not open network connections, and never uploads anything.