setup/cursor 1.00

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

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

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.