Codebase context for AI coding agents.
Local, open source, over MCP.
Open Context Engine indexes your repo on your machine — AST-aware chunks, hybrid semantic + keyword search, a code graph — and serves it to Claude Code, Cursor, VS Code, Windsurf and Claude Desktop over MCP, and to its own agent. MIT core, works with free models, and nothing leaves the machine.
Open Context · code-native agent index 12,481 chunks · hybrid approvals suggest › where do we validate webhook signatures? ✓ codebase-retrieval webhook signature validation · 0.3s ✓ read-file billing/src/verify.ts:41-63 · 0.1s Signatures are verified in verifySignature() — HMAC-SHA256 over id.timestamp.payload with a constant-time compare. Called from the webhook route before any parsing: ╭── ts billing/src/verify.ts │ export function verifySignature(sig, raw) { │ const mac = hmac(secret, raw); │ return timingSafeEqual(mac, sig); ╰── 1 step · 2 tools · 4,120→96 tok · 3.8s › ▍
Retrieval that ranks like it means it
One query fans out across dense vectors and BM25, fuses with reciprocal-rank fusion, reranks, then expands along the code graph — so callers and callees ride along with every hit.
Hybrid search
Vector similarity and porter-stemmed keyword search run together and fuse — semantically relevant and lexically precise, in one ranking.
0.963 ext.AST-aware chunking
Tree-sitter splits code along real boundaries — functions, classes, methods — across TypeScript, Python, Go, Rust, Java, C#, C, C++, Ruby, PHP, Kotlin, and Swift.
13 langsCode graph expansion
Import, call, and inheritance edges are extracted at index time. Top results pull in their callers and definitions automatically.
3 edge kindsStreaming stages
Keyword hits stream back before the query embedding round-trip even starts. UIs paint first results in milliseconds and refine as stages land.
<5ms firstMeasured, not guessed
A committed gold set scores every ranking change: recall, MRR, nDCG, context-recall — with before/after deltas in CI. Run oce eval on your own repo.
An agent that shows you what it knew
Every coding agent shows you what it did. oce trace also shows what it knew: the ranked evidence in the model's context window, with the score and the graph edge behind every chunk — and lets you pin it or throw it out. Bare oce opens the same workspace in your terminal.
The evidence rail
What is in the window right now, ranked by fusion score, with a budget split by what is using it. Pin a chunk and it survives compaction; evict one and it is genuinely gone from the next request.
context · 23% of 200k ████████████████████░░░░░░ retrieval 21k · files 12k · history 8k 0.94 ◆ retriever.ts:118-160 ← called by search.ts 0.91 sqlite-store.ts:64-102 0.62 diagnostics.ts:41-60 0.38 ✕ embedder.ts:203-240
Rewind, review, land
Every turn is a checkpoint on the audit hash chain — rewind rolls back the conversation and the files, and leaves your own edits alone. Parallel sessions each run in their own git worktree: review the diff, then land it.
9b02 › why does search fall back? ⟐ retrieved 5 · top 0.94 · graph +2 · 251ms ┌─ edit native-binding-error.ts · risk 0.34 │ - log.warn("vec unavailable"); │ + log.warn(`vec unavailable: ${reason}`); └ apply? y · always · n sessions main fix-auth upgrade +
Fully local, provably
Air-gapped is a supported mode, not a degraded one. Every stage of the stack has an in-process or self-hosted option — no API key anywhere in the loop.
| stage | cloud option | fully local option | |
|---|---|---|---|
| Embeddings | Voyage · OpenAI | in-process ONNX or Ollama | ✓ offline |
| Keyword search | — | SQLite FTS5, always local | ✓ offline |
| Reranking | Voyage · Cohere | in-process cross-encoder | ✓ offline |
| Agent LLM | Anthropic · OpenAI · free tiers: Gemini, Groq, Cerebras, OpenRouter | Ollama / any OpenAI-compatible | ✓ offline |
| Index storage | — | local SQLite + sqlite-vec | ✓ offline |
One embedding bill for the whole team
Index once in CI, publish the artifact to storage you control — S3, GCS, a shared drive — and every teammate pulls it. Only their local diff re-embeds. A content-hash cache means identical code never bills twice.
Push from CI
$ oce push-index s3://acme/oce/main.db.gz Published: 12,481 chunks · 1,904 files · commit ab12cd34
Pull everywhere
$ oce pull-index s3://acme/oce/main.db.gz Installed team index. Reconciled: 3 files re-embedded, 1,901 reused from the artifact
Built to pass procurement
Org-signed policies your developers can't loosen. A hash-chained audit log where tampering is detectable, not deniable. Offline Ed25519 licenses that verify without phoning home.
Policy locks
Commit a policy file: disable shell, pin command allowlists, force local-only embeddings, exclude paths. Team orgs get Ed25519-signed locks that flags can't override.
Tamper-evident audit
Every run, tool call, and MCP invocation appends to a hash chain. oce audit --verify pinpoints any alteration, deletion, or reorder. Local file — your data stays yours.
Sandboxed by default
Workspace containment on every file surface, scrubbed environments for shell commands, credential files blocked from the index outright. Zero telemetry — verifiable in the MIT source.
Speaks MCP natively
Retrieval, symbol, repo-map and memory tools for any MCP client, over stdio — or one shared Streamable-HTTP endpoint with bearer auth for a whole team. One command writes your client's config. Prefer an editor? The VS Code extension runs the same engine with an agent you can follow.
One command per client
$ oce mcp install claude-code Added "open-context" in .mcp.json also: cursor · vscode · windsurf · claude-desktop
Setup guides: Claude Code · Cursor · Copilot · Windsurf · Claude Desktop
VS Code extension
An agent in the sidebar with a live plan, approvals, a changes tray, checkpoints you can rewind, and memory you can edit — grounded in the same local index.
Team endpoint
$ oce mcp --http --auth-token $TOKEN listening on http://127.0.0.1:8940 bearer auth · /health · watching
Free for individuals. $25 per seat for teams.
The engine is MIT — index, search, MCP, and the agent are free forever. Teams pay for shared indexes, the embedding cache, policy locks, and multi-repo search.
Agentic workflow FAQ
What is an agentic workflow?
Software where an LLM plans, calls tools, observes results, and loops until a goal is met — instead of answering once. Read the full guide. For connecting agents to your code over MCP, see the MCP server guide.
Why is code retrieval the bottleneck?
The agent's context window is smaller than your codebase. Hybrid retrieval over an AST-aware index decides what the model actually sees — and acts on.
How do I ground Claude Code or Cursor?
Install, then one command: oce mcp install claude-code (or cursor, vscode, windsurf, claude-desktop). Step by step for Claude Code and Cursor.
Does it work offline?
Yes — local MiniLM embeddings in-process, local SQLite storage, keyword-only fallback. Nothing is sent anywhere.
Is it an alternative to Augment's context engine?
For giving agents codebase context over MCP, yes — MIT-licensed and indexed on your machine. What differs, and how it compares with Cursor, Copilot and other MCP servers.
Can agents remember things across sessions?
Yes — durable, local memory over MCP that you can read and correct. See agent memory.