ContextBridge
About
Local-first code retrieval for AI agents — cuts codebase context from tens of thousands of tokens to a few hundred, with zero hallucinated file paths.
Details
- Author
- tijuthomas5
- Downloads
- 308
- Categories
- Developer Tools, Knowledge Base
Jump to
- Keyword-first hybrid retrieval with guarded vector assist
- Optional local AI analysis that validates and re-ranks results
- Swappable profile plugins for project-specific ranking
- MCP tools: search_context_hybrid, find_code_locations, get_module_summary, record_outcome, and more
- Rerunnable safe setup that never overwrites existing configs
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
ContextBridgeCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Setup runs via platform-specific batch scripts (setup_context_bridge.bat on Windows, equivalents in setup/mac/ or setup/linux/). Edit the generated config.hybrid.json to point settings.discovery.* at your source folders, re-run setup, then start the server. By default ContextBridge runs SSE at http://127.0.0.1:8755/sse; set CONTEXT_BRIDGE_TRANSPORT=stdio for stdio transport. A dashboard is available at http://127.0.0.1:8795.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"contextbridge": {
"context_bridge": {
"url": "http://127.0.0.1:8755/sse"
}
}
}
}
McpServers
{
"context_bridge": {
"url": "http://127.0.0.1:8755/sse"
}
}
Without CB, an AI coding agent either guesses which files are relevant, or you paste entire source files into the chat — burning thousands of input tokens on code that isn't needed.
With CB, the AI calls a single MCP tool and gets back acompact, ranked result: the owner file, related files, key symbols, and a dependency summary — typically a few hundred tokens instead of tens of thousands of lines of raw source.
This isn't limited to bug investigations — the same tool answers general questions about how an existing feature or workflow is implemented.
The optional local AI analysis stage further compresses the result before it reaches your cloud AI — so you pay even less.
Scope note:ContextBridge is a codebase routing and retrieval tool, not a reasoning engine — it finds the right files, symbols, and connections, but does not prove causality or choose the fix for you. SeeIntended Scopefor the full boundary.
💡 New here?Don't want to read everything? Ask your AI assistant (Claude, ChatGPT, Gemini, etc.) to read thedocs/folder and guide you through setup for your OS and project.
A local-first code retrieval layer for AI coding agents. ContextBridge indexes your codebase (viaGraphifyoutput), then exposes MCP tools that any AI client (Claude Code, Codex, Cursor, Antigravity, …) can call to getranked files, symbols, and dependency chains— optionally validated and re-ranked by a local LLM before the answer reaches your cloud AI.
Your prompt ─► ContextBridge (keyword + vector retrieval) ─► Local AI (optional: validates, re-ranks, fills gaps) ─► Your AI agent (implements, grounded in real files)
The engine isgeneric. All project-specific ranking lives in a swappableprofile plugin, so the same tool works for any codebase.
How your code flows through ContextBridge to your AI agent:
ContextBridge ships with a local dashboard for monitoring retrieval quality, index health, and config — no cloud dependency.
Overview — retrieval quality, token savings, and search-mode breakdown
Settings — tune pipeline mode, RAG weights, and model config live
Token savings — per-query breakdown of what CB delivered vs. full-file cost
📖 Before you start — read the docs.Thedocs/folder contains everything you need for full setup, configuration, pipeline, and profile creation. Start withdocs/0. README.mdfor a guided index of all documentation.
:: 1. Install deps + build the index + scaffold config files context_bridge\setup\windows\setup_context_bridge.bat :: 2. Point the config at YOUR source folders :: edit config.hybrid.json -> settings.discovery. (replace your_backend / your_frontend) :: 3. Re-run setup to index your code context_bridge\setup\windows\setup_context_bridge.bat :: 4. Start the server + dashboard (pick Hybrid / Semantic / Keyword) context_bridge\setup\windows\1. start_Context_Bridge.bat
Mac/Linux:usecontext_bridge/setup/mac/orcontext_bridge/setup/linux/equivalents.
Setup isrerunnable and safe: it creates config/start files from the.exampletemplates only if missing (never overwrites your edits), and rebuilds the index each run. Runsetup_context_bridge.bat --forceto reset configs back to the templates.
The MCP server runs SSE by default athttp://127.0.0.1:8755/sse— point your AI client there. Stdio transport is also supported (setCONTEXT_BRIDGE_TRANSPORT=stdiobefore starting) for clients that don't support SSE; SSE is recommended since it lets multiple AI clients share one running server instead of each spawning its own process. Dashboard:http://127.0.0.1:8795. Live stats can lag up to ~15 seconds behind the latest activity, and history lists (recent events, missed files, failed queries) show the most recent 1000 entries rather than the full lifetime log — both are intentional performance tradeoffs, not data loss.
Chosen at startup (the start script picks the matching config file):
Which tools appear is controlled by config — if a tool is registered, it is safe to call.
The generic engine asks aprofilefor project-specific ranking at every step. With no profile (project_profile: "default") you get pure generic scoring.
- Copyrules/projects/example_profile.py→rules/projects/<yourapp>_profile.py
- Implement the hooks you need (every hook is optional — skipped hooks fall back to no-op)
- Activate it: setCONTEXT_BRIDGE_PROFILE=<yourapp>in your start script, orproject_profile: "<yourapp>"in your config
Seedocs/for extended guides on setup, pipeline, profile creation, and debug commands.
ContextBridge indexesGraphify output(graph.json,GRAPH_REPORT.md,source-files.txt,scope-summary.md,manifest.json) plus/behavior/docs — not raw source. Generate Graphify for your project, pointsettings.discovery.*at those folders, and run setup. Re-run setup after each Graphify update to refresh the index.
Configure a local model underpipeline.analysis_stage(providerollamaby default, oranthropic/openai/openrouter). When enabled, it validates and re-ranks CB results, decomposes multi-topic prompts, and triggers gap re-searches — then passes a compact, grounded result to your cloud AI. Swap models by changingmodelonly; the prompts are model-agnostic.
Licensed under theApache License, Version 2.0.
This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.
Create crafted UI components inspired by the best 21st.dev design engineers.
Bring agent evaluations, observability, and synthetic test set generation directly into your IDE for free with Galileo's new MCP server
An MCP server to help AI assistants to answer questions and generate AccelByte Extend SDK code more effectively .
MCP server for AI Diagram Maker — generate beautiful software engineering diagrams directly inside Cursor, Claude Desktop, Claude Code, or any MCP-compatible AI agent
ALAPI MCP Tools,Call hundreds of API interfaces via MCP
AI-powered SVG animation generator that transforms static files into animated SVG components using the Allyson platform
MCP server that gives AI assistants on-demand access to 1,500+ amCharts docs, ~300 code examples, and 1000+ class API references.
APIMatic MCP Server is used to validate OpenAPI specifications using APIMatic. The server processes OpenAPI files and returns validation summaries by leveraging APIMatic’s API.
One shared context layer for AI agents and humans — live API specs, DB schemas, and versioned contracts across repos so every agent and teammate works from the same source of truth.
Build and deploy full-stack Next.js apps with 98 tools for React, AWS, and MongoDB
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





