# Open Context Engine

> Open Context Engine is an open-source MCP server for developer tools. Local code search for AI assistants, with AST-aware chunking and no cloud. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, self-hosted, vscode, Linux, macOS, Windows
- **Repository:** https://github.com/dhaxor/open-context-engine
- **MCP Registry name:** io.github.Dhaxor/open-context-engine
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools), [knowledge and memory](https://ai-powered.com/categories/knowledge-and-memory)
- **Listing updated:** 2026-11-18

## About

The engine builds its index by splitting source files along function, class and method boundaries with Tree-sitter, then stores chunks and vectors in a local SQLite database. Search blends cosine similarity with BM25 keyword matching, and a code graph of import, call and definition edges pulls in callers and callees alongside the top hits.

Embeddings run on-device by default with a small local model, so a first index needs no API key. Ollama is supported, and a Voyage key can be added for stronger code retrieval. The README says the engine falls back to keyword-only search when no sqlite-vec build exists for your platform.

Beyond the MCP server, the same package ships a command line, a browser and terminal workspace called Trace, a VS Code extension, policy controls and a hash-chained audit log. It runs over stdio or Streamable HTTP with bearer auth.

## Features

- **Hybrid retrieval:** Combines vector similarity with BM25 keyword search using reciprocal rank fusion.
- **AST-aware chunks:** Tree-sitter splits code by function and class across 13 listed languages.
- **Code graph expansion:** Search results include callers and callees through import and call edges.
- **Local embeddings:** On-device ONNX embeddings by default; Ollama and Voyage are options.
- **Team index sync:** Build an index in CI and let teammates pull it, re-embedding only their local diff.
- **Audit log:** Hash-chained record of agent runs and tool calls that can be verified from the CLI.

## Good for

- Let a coding assistant answer questions about a private codebase
- Give Claude Desktop or Cursor semantic search without sending code to a cloud service
- Share a prebuilt index across a team through CI
- Review pull requests with retrieved context from the whole repository

## Install

### Claude Code (Terminal)

```sh
claude mcp add open-context-engine -- npx -y @dhaxor/open-context
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "open-context-engine": {
      "command": "npx",
      "args": [
        "-y",
        "@dhaxor/open-context"
      ]
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "open-context-engine": {
      "command": "npx",
      "args": [
        "-y",
        "@dhaxor/open-context"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "open-context-engine": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@dhaxor/open-context"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "open-context-engine": {
      "command": "npx",
      "args": [
        "-y",
        "@dhaxor/open-context"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "open-context-engine": {
      "command": "npx",
      "args": [
        "-y",
        "@dhaxor/open-context"
      ]
    }
  }
}
```

## FAQ

### What do I need to install it?

The README gives npm install -g @dhaxor/open-context and says it needs Node 22 or newer.

### Does my code leave my machine?

The README says no code leaves your machine with the default local embeddings; Voyage or Cohere are optional upgrades.

### Which clients can connect?

Claude Desktop, Cursor and any MCP-compatible client, over stdio or Streamable HTTP.

### What if sqlite-vec is unavailable?

It runs keyword-only BM25 search instead of failing, and says which mode is active.

### Is Open Context Engine free?

Yes. Open Context Engine is open source, so you can use and self-host it for free.

### How do I add Open Context Engine to Claude Code?

Run this command in your terminal: claude mcp add open-context-engine -- npx -y @dhaxor/open-context

### What are the best alternatives to Open Context Engine?

The closest alternatives to Open Context Engine are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Context7](https://ai-powered.com/mcp/context7): Context7 is a freemium MCP server for developer tools.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): Chrome DevTools MCP is an open-source MCP server for browser automation.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [awesome-mcp-servers](https://ai-powered.com/mcp/awesome-mcp-servers-2): awesome-mcp-servers is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.

---
Source: https://ai-powered.com/mcp/open-context-engine
