Give Cursor your whole codebase
One command adds Open Context Engine to Cursor as an MCP server: hybrid code search, symbol lookups and a repo map over a local index of your project — for Cursor's agent to call before it edits.
Updated
step 1 · 1 minInstall
npm install -g @dhaxor/open-context # Node 22+
No API key is needed: the default embeddings run in-process (MiniLM), and with none at all the engine runs keyword-only and says so.
step 2 · 30 sAdd it to Cursor
From the root of the project:
oce mcp install cursor
That writes (or merges into) .cursor/mcp.json:
{
"mcpServers": {
"open-context": {
"command": "oce",
"args": ["mcp", "--workspace", "${workspaceFolder}"]
}
}
}
Servers already in the file are kept, and a file it can't parse is left alone. Add --print to see the change first, --remove to undo it, or --scope user to write ~/.cursor/mcp.json instead (pinned to this project's path). If oce isn't on your PATH, the entry uses npx -y @dhaxor/open-context.
step 3 · 1 minIndex, then verify
oce index # optional: the server also indexes on first start
Open Cursor's settings, find the MCP section, and check that open-context is enabled with its tools listed. Then ask the agent something only the code can answer — "where do we validate webhook signatures, and who calls it?" — and it should call codebase-retrieval before it answers.
What Cursor's agent gets
codebase-retrieval— hybrid search (BM25 + vectors, fused and reranked) over AST-aware chunks, with callers and callees pulled in along the code graph.repo-map— the codebase's structure in a few thousand tokens, for broad questions.find-symbol-definition/find-symbol-references— compiler-grade when a language server is installed.read-file,list-files,index-status, and memory tools (memory_remember,memory_recall) that persist across sessions.
One index for Cursor and everything else
The same command sets up Claude Code, VS Code, Windsurf and Claude Desktop, and they all read the project's one index. A team can serve it once over HTTP instead:
oce mcp --http --port 8940 --auth-token "$OCE_MCP_AUTH_TOKEN"
// .cursor/mcp.json
{ "mcpServers": { "open-context": {
"url": "http://127.0.0.1:8940/mcp",
"headers": { "Authorization": "Bearer <the same token>" } } } }
Troubleshooting
- The server shows an error in Cursor — run
oce mcp --workspace .in a terminal: it prints the same startup error Cursor sees. oce: command not found — Cursor started without your shell's PATH. Re-runoce mcp install cursor --npx, or install Node sooceis on the system PATH.- Answers feel keyword-only —
oce statusshows the search mode;oce setup --embeddings localturns on in-process semantic search. - Several projects — keep the project-level config; each window gets its own index through
${workspaceFolder}.
Frequently asked questions
Doesn't Cursor already index my codebase?
It has its own indexing. Open Context Engine adds a local index you control — hybrid search, a code graph, symbol tools and a repo map — that Cursor's agent calls as MCP tools, and that your other tools can share. The comparison covers the differences.
Where does the index live?
In .open-context/ inside the project, as SQLite. Indexing and the default embeddings run on your machine; Open Context Engine uploads nothing.
Can one setup serve every project?
The project-level config does, via ${workspaceFolder}. The user-level one is pinned to a single path.