diff --git a/README.md b/README.md index f3a3282..35b441f 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,72 @@ codex ask "" # optional LLM Q&A via Ollama --- +## MCP Server (F-14) + +codex exposes its KB as read-only MCP tools for LLM clients (Claude Code, Claude Desktop, etc.). + +### Start (stdio) + +```bash +# directly +python -m codex.mcp_server + +# or via the installed script +codex-mcp +``` + +### Client registration + +**Claude Code** — add to `.mcp.json` in your project root: + +```json +{ + "mcpServers": { + "codex": { + "command": "uv", + "args": ["run", "codex-mcp"], + "cwd": "/path/to/codex-py" + } + } +} +``` + +**Claude Desktop** — add to `~/Library/Application Support/Claude/claude_desktop_config.json`: + +```json +{ + "mcpServers": { + "codex": { + "command": "uv", + "args": ["--directory", "/path/to/codex-py", "run", "codex-mcp"] + } + } +} +``` + +### HTTP transport (optional, config-gated) + +```bash +MCP_TRANSPORT=http MCP_AUTH_TOKEN= codex-mcp +``` + +HTTP transport requires `MCP_AUTH_TOKEN` — the server refuses to start without it. +Requests must carry `Authorization: Bearer `. + +### Available tools (read-only) + +| Tool | Description | +|---|---| +| `search` | Chunk-level hybrid search (dense BGE-M3) | +| `ask` | RAG answer (returns "not available" until implemented) | +| `wiki_read` | Compiled concept page (F-12) | +| `wiki_list` | All concept pages + freshness | +| `discover_leads` | Dangling-citation leads | +| `provenance_verify` | Scan C++ sources for @cite tags | +| `synthesis_browse` | Leads/conjectures from leads/ (F-13) | + +--- + ## Development ```bash