ContextBridge

MCP开发工具

提供方 tijuthomas5

开发工具 未标注 会话登录 社区 / 第三方 ClaudeCursorGemini CLICodex

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.

一句话选型结论

按资料字段整理

ContextBridge 属于开发工具类 MCP 服务器,传输方式未标注,会话登录,可直接接入 Claude、Cursor、Gemini CLI 等,没有现成安装命令,需按官方文档接入。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类开发工具 传输方式未标注 鉴权会话登录 部署方式未标注
GitHub 星标 未标注 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

开发工具
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量未标注暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

code search retrieval context management token optimization codebase indexing local first rag

支持客户端

适用场景

code searchretrievalcontext management

安装与配置

未标注 会话登录
上游未给出传输方式
  1. 1
    准备运行环境

    按官方文档确认运行环境(常见为 Node.js 或 Python),装好后再执行安装命令。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后随便调一个只读工具,确认能返回结果,再接入正式流程。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
代码与仓库操作

在对话里直接查代码、提 issue、走 PR,省掉来回切工具。

本地命令与脚本

把构建、测试、格式化这类重复命令交给模型执行。

接口联调与测试

让模型调你的接口、跑一遍用例,快速定位问题。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 已适配 Claude、Cursor、Gemini CLI,换客户端不用重新研究配置。

先想清楚的地方

  • 没有现成安装命令,需要按官方文档自己填启动命令和参数。
  • 使用前要准备好会话登录对应的凭据,并按最小权限配置。
  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在开发工具场景里让模型直接调用外部能力的人。
  • 已经在用 Claude、Cursor 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
ContextBridge当前 未标注 未标注 未标注 无 未标注
Git 838e2ec1 12 stdio · 本地进程 本地部署 有 2026-05-17
Markitdown MCP 2c653a5f 1 stdio · 本地进程 本地部署 有 2026-05-17
JavaGuide 未标注 stdio · 本地进程 本地部署 有 2026-04-11
awesome-claude-skills 未标注 stdio · 本地进程 本地部署 有 2026-04-26
Context7 831acf40 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

开发工具
字段来自项目仓库与公开索引,中文说明由本站标注
提供方tijuthomas5上游标注的维护方 tijuthomas5
分类开发工具本站按上游分类展示
连接方式未标注上游未给出传输方式
鉴权方式会话登录远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · python本地安装时用到的包标识与运行时
部署类型未标注上游给出的部署形态
最近核验未标注上游最后核验时间

详细介绍

7.7 KB
来自项目仓库与上游目录的原文,未做删改

ContextBridge

Why ContextBridge?

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 a compact, 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.

Without CB With CB
Paste 10–50 raw files into context CB returns the 3–5 files that actually matter
AI guesses which code is relevant Result is grounded in your real codebase structure
High token cost, noisy context Low token cost, focused context
Hallucinated file paths and method names Exact file paths, symbols, and line hints

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. See Intended Scope for the
full boundary.


> 💡 New here? Don't want to read everything? Ask your AI assistant (Claude, ChatGPT, Gemini, etc.) to read the docs/ 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 (via Graphify output), then exposes MCP tools that any AI client
(Claude Code, Codex, Cursor, Antigravity, …) can call to get ranked 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 is **generic**. All project-specific ranking lives in a swappable
**profile plugin**, so the same tool works for any codebase.

---

## Architecture

How your code flows through ContextBridge to your AI agent:

---

## Dashboard

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.**
> The `docs/` folder contains everything you need for full setup, configuration, pipeline, and profile creation. Start with `docs/0. README.md` for a guided index of all documentation.

---

## Quick start```bat
:: 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: use context_bridge/setup/mac/ or context_bridge/setup/linux/ equivalents.

Setup is rerunnable and safe: it creates config/start files from the *.example
templates only if missing (never overwrites your edits), and rebuilds the index each run.
Run setup_context_bridge.bat --force to reset configs back to the templates.

The MCP server runs SSE by default at http://127.0.0.1:8755/sse — point your AI client
there. Stdio transport is also supported (set CONTEXT_BRIDGE_TRANSPORT=stdio before
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.


Retrieval modes

Chosen at startup (the start script picks the matching config file):

Mode Config What it does
Hybrid config.hybrid.json Keyword-first + guarded vector assist (recommended)
Semantic config.semantic.json Vector-only (needs sentence-transformers)
Keyword config.json Pure keyword, no vectors

MCP tools

Tool Use
search_context_hybrid() Primary — broad file + context discovery (runs analysis automatically)
find_code_locations() Exact owner file / symbol / line for a method or class
get_module_summary() Overview of a module/service
get_graphify_pack() All files in a feature pack
record_outcome() Log whether a result helped
health_check(), get_usage_summary(), search_context(), find_related_files() Utility

Which tools appear is controlled by config — if a tool is registered, it is safe to call.


Writing your own profile

The generic engine asks a profile for project-specific ranking at every step.
With no profile (project_profile: "default") you get pure generic scoring.

  1. Copy rules/projects/example_profile.py → rules/projects/_profile.py
  2. Implement the hooks you need (every hook is optional — skipped hooks fall back to no-op)
  3. Activate it: set CONTEXT_BRIDGE_PROFILE= in your start script,
    or project_profile: "" in your config

Profile hooks (all optional)

Hook Purpose
expand_query_tokens(query, tokens) Add extra search tokens
module_intent_tokens() Map module name → vocabulary
pinned_owner_files(query_tokens) Force specific files to the top
adjust_document_score(...) Boost/penalize a candidate document
adjust_owner_score(...) Boost/penalize an owner file by name
adjust_primary_owner_score(...) Nudge the single primary owner
adjust_scoped_score(...) Prefer files under the dominant module/pack
extra_owner_file_patterns() Extra high-priority filename patterns
infer_module_from_path(path) Path → module name (fusion scoping)
low_signal_terms() Module/domain words to treat as low-signal
noise_files() Filenames to de-prioritize (ui/support/root)
gap_queries() Trigger words → clean re-search query
analysis_prompt_override() Full system prompt for the local AI
pack_files_for_intents(...) Map intents → Graphify pack files (advanced)

See docs/ for extended guides on setup, pipeline, profile creation, and debug commands.


Indexing

ContextBridge indexes Graphify 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, point settings.discovery.* at those folders,
and run setup. Re-run setup after each Graphify update to refresh the index.


Local AI (optional)

Configure a local model under pipeline.analysis_stage (provider ollama by default,
or anthropic/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 changing model only; the prompts are
model-agnostic.


License

Copyright 2026 Tiju Thomas

Licensed under the Apache License, Version 2.0.

常见问题

7 问
答案由本站依据条目字段整理,不引用上游原文
ContextBridge 怎么安装?

资料没有给出安装命令,请到官方仓库或文档按说明接入;这类条目多数是生态应用,或尚未发布可安装包。

ContextBridge 怎么在 Claude、Cursor、Gemini CLI 里配置?

它的传输方式未标注,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

ContextBridge 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

ContextBridge 需要 API Key 吗?

资料标注需要会话登录认证,使用前准备好对应凭据,并按最小权限配置。

ContextBridge 支持哪些客户端?

资料标注支持 Claude、Cursor、Gemini CLI、Codex、Zed;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

ContextBridge 能提供哪些能力?

资料显示能力标签包括 code search、retrieval、context management、token optimization、codebase indexing、local first。具体工具清单以官方文档为准。

ContextBridge 需要什么运行环境?

运行时为 python。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 未标注。