原型 · 预览版:收录官方注册中心里的全部服务器,每 30 分钟同步一次。评价和账户功能将在后续阶段推出。
PopNx MCP为使用 AI 的人准备的 MCP 服务器 · 用大白话讲清楚

ContextSmith

作者:RahulSankhla312版本 0.1.1i★ –i在你的电脑上运行
注册名称io.github.RahulSankhla312/contextsmith

安装

概览

作者提供的说明(英文原文)

Give your coding agent the right code: graph + hybrid search, packed into a token budget. Local.

PopNx MCP 的三大支柱

这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。

它能帮你做什么

我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。

  • 连接方式: 在你的电脑上运行
  • 传输方式: stdio
  • 分类: 搜索与 AI 记忆

安装

选择你使用的 AI 应用,然后复制设置。

安装之前

你需要

  • PyPI已安装 Python 的 uv(用于 uvx 命令)

你用的是哪个应用?

在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。

打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json

{
  "mcpServers": {
    "contextsmith": {
      "command": "uvx",
      "args": [
        "contextsmith"
      ],
      "env": {
        "CTXSMITH_ROOT": "your-value"
      }
    }
  }
}

在终端中运行这条命令

claude mcp add contextsmith --env CTXSMITH_ROOT=your-value -- uvx contextsmith

运行前请先填写空着的值。

在 Cursor 中打开

或者自己复制设置

粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json

{
  "mcpServers": {
    "contextsmith": {
      "command": "uvx",
      "args": [
        "contextsmith"
      ],
      "env": {
        "CTXSMITH_ROOT": "your-value"
      }
    }
  }
}

浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。

在 VS Code 中打开

或者自己复制设置

粘贴到项目中的 .vscode/mcp.json

{
  "servers": {
    "contextsmith": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "contextsmith"
      ],
      "env": {
        "CTXSMITH_ROOT": "your-value"
      }
    }
  }
}

浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。

这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。

你的选择通过 Cookie 保存在这台设备上,无需账户。

需要你填写的值

  • CTXSMITH_ROOT env
    Repository to index and answer from (default: the working directory)

这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。

它能做什么

它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。

基础检查i

我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月7日

  • ✓ 通过

    作者与仓库一致

    注册名称已通过 GitHub 账户 RahulSankhla312 验证,该账户拥有此仓库

  • … 尚未检查

    仍在维护

    我们还没有从 GitHub 读取这个仓库

  • … 尚未检查

    有许可证

    我们还没有从 GitHub 读取这个仓库

  • – 不适用

    端点有响应

    它在你的电脑上运行,没有互联网端点

  • – 不适用

    使用 OAuth 登录

    在你的电脑上运行,改用本地设置

  • … 尚未检查

    工具描述中没有隐藏指令

    它在你的电脑上运行;我们只能读取互联网端点的工具列表

与“搜索与 AI 记忆”中的其他服务器比较i

  • 星标数多于此分类中其他 7251 个服务器的 0%
  • 发布到注册中心的时间比此分类中其他 7251 个服务器的 74% 更新
  • 基础检查结果等于或优于此分类中其他 7251 个服务器的 100%

与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。

常见问题

ContextSmith 安全吗?

它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。

它需要哪些密钥或代码?

注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。

它在我的电脑上运行还是在云端?

它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。

它还在维护吗?

GitHub 仓库最后更新于–,最新版本(0.1.1)于12天前进入注册中心。

哪些应用可以使用它?

支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Python (uv)。

有什么可以替代它?

同一分类中有:Context7, Codebase Memory, Exa

替代选择

同一分类中其他作者的服务器,按星标数排序。

如何看卡片:★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i

Context7

作者:upstash

Up-to-date docs for AI agents

电脑或云端★ 64,224MIT今天更新
安装

Codebase Memory

作者:DeusData

Codebase knowledge graph for AI agents — 162 languages, sub-ms queries, 99% fewer tokens.

在你的电脑上运行★ 48,148MIT20天前更新
安装

Exa

作者:exa-labs

Connect AI agents to Exa for web search, content fetching, and multi-step research.

在云端运行★ 5,213MIT上个月更新
安装

作者的 README

打开 README

按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。

ContextSmith

Give your coding agent the right code, not more code.

A local context engine for Claude Code, Cursor, Codex and any MCP agent. It indexes your repository into a code graph, hybrid search and git history, and answers every task with the code that matters, packed into a token budget you choose.

▶ Watch the 60-second video : indexing, context packing, live MCP calls and the benchmark.

Coding agents spend their context window on the wrong code. They grep, open whole files, and run out of room before they reach the function that needs the fix, and you pay for every token they read. ContextSmith answers one question as well as possible: given this task and N tokens, what code should the agent read?

92% of real bug fixes had the right file inside a 4,000-token context vs 29% for search + whole files 1.7x more often the exact lines to change are shown 48% vs 29%, same budget 100% local no API keys, no cloud, code never leaves the machine

Measured on 114 Django issues from SWE-bench Lite that no tuning step ever saw. Method and full results .

Quickstart (60 seconds)

pipx install "contextsmith[semantic]"      # or: pip install "contextsmith[semantic]"

cd your-repo ctxsmith index # once; afterwards only changed files are re-read ctxsmith context "Coupons are applied twice at checkout" --budget 4000

Connect it to your agent (the command prints the exact line for your machine):

ctxsmith mcp-config claude    # or: cursor, windsurf, codex

claude mcp add contextsmith -- ctxsmith serve --path /path/to/your-repo

From then on the agent calls get_context itself and gets ranked, budgeted code instead of grepping. Without the [semantic] extra everything still works, using keyword search only.

Who it's for

Developers
  • Faster, better agent sessions on big repos. The agent starts from the right functions instead of exploring; fewer wrong edits and "I couldn't find it" loops.
  • Understand unfamiliar code. ctxsmith context "where are payment retries handled?" returns the relevant functions with their file and line numbers.
  • Change safely. ctxsmith impact charge_card lists everything that calls it, transitively: what a change could break, before you make it.
  • Remember the gotchas. ctxsmith note add "never call without the account lock" --symbol charge_card pins a note to the code; it shows up in every future context for that code, for you and for the agent.
Teams and companies
NeedHow ContextSmith covers it
Code that must not leave the building (finance, health, government, enterprise IP)Runs entirely on the developer's machine. Parsing, search and embeddings are local; the only network use is a one-time download of two small open models, which you can mirror internally for air-gapped machines
Predictable AI spendEvery answer has a hard token budget you set, so context cost per task is fixed instead of "whatever the agent opened"
Works with the agents you already pay forStandard MCP server: Claude Code, Cursor, Windsurf, Codex, Copilot agents and in-house agents use the same index
OnboardingNew engineers and their agents ask questions in plain language and land on the right code
Code review and CIctxsmith context "$PR_TITLE" -b 6000 gives a review bot the code a PR touches and depends on; ctxsmith impact NAME shows the blast radius
Team knowledgeDecisions and invariants live next to the code as notes, not in someone's head
No lock-in, no procurementMIT licence (commercial use is fine), a single SQLite file per repository, no server to run, no account

Typical rollout: each developer installs it with pipx, runs ctxsmith index in the repositories they work on, and adds one MCP line to their agent. There is nothing to host. See Using it at a company for CI and offline setups.

Builders of AI tools

ContextSmith is also a Python library. Use it as the retrieval layer of your own agent, review bot or internal assistant:

from contextsmith import Engine

eng = Engine("path/to/repo") eng.index() pack = eng.context("Fix the race when two users book the last seat", budget=6000) prompt = f"{pack.text}\n\nTask: fix the race when two users book the last seat."

Results

The test: take a real GitHub issue from SWE-bench Lite, check the repository out at the issue's own commit (so no future code or history leaks in), give the issue text to the tool, and check whether the code the real fix changed comes back.

Final test on Django: 114 issues that no tuning step ever saw.

BM25, whole filesContextSmith
The fix's file is ranked 1st / in the top 3 / top 550.9% / 70.2% / 77.2%51.8% / 79.8% / 85.1%
The fix's file is inside a 4,000-token context28.9%92.1% (3.2x)
The exact lines the fix changes are shown in 4,000 tokens28.9%48.1% (1.7x)
Query time (median, laptop CPU, 2,800-file repository)145 ms238 ms

The baseline pastes BM25-ranked files whole until the budget runs out, which is what "search the repo and open files" agents do. ContextSmith spends the same tokens on the functions that matter and outlines of the rest, so the right file almost always makes it in.

All strategies and ablations

strategyR@1R@3R@5R@10file in 4kfile in 8klines in 4klines in 8kms
BM25, whole files50.970.277.284.228.949.128.949.1145
lexical (no embeddings)48.274.678.986.086.089.542.346.2145
embeddings only48.269.378.986.8––––249
ContextSmith (default)51.879.885.188.692.196.548.150.7238
+ cross-encoder re-rank34.273.781.691.2––––1824
without git history56.178.984.290.4––––249

Full numbers: bench/results-django/summary.md.

What the ablations say, including what didn't work:

  • Embeddings earn their place: adding them to the lexical ranker lifts top-5 from 79% to 85% and exact-line coverage from 42% to 48%.
  • The cross-encoder re-rank hurts the top result (52% → 34%) at 8x the latency, so it is off by default and marked experimental. A general web-search re-ranker doesn't understand issue-to-code relevance; a code-trained one is on the roadmap.
  • Git commit history is mixed: it helped on the tuning repositories, but on Django removing it *raises* recall@1 by 4 points. It stays on because the default was fixed before the Django run; changing it now would be tuning on the test set.
  • At 8,000 tokens whole files catch up on exact lines (49% vs 51%): every Django fix here touches one file, and at that budget it often fits whole.

Method. Weights were chosen by grid search on 89 issues from 8 other repositories (pytest, requests, flask, sphinx, pylint, xarray, astropy, seaborn) with bench/tune.py and bench/tune_pack.py, then frozen before Django was run once. Reproduce it with ctxsmith bench --repos django/django (first run: about two hours on a laptop).

How it works

flowchart LR

subgraph Index["ctxsmith index (incremental)"] TS["tree-sitter 7 languages"] --> SYM["symbols · calls · imports"] SYM --> G["call graph PageRank"] SYM --> FTS["FTS5 BM25 files · symbols · bodies"] SYM --> EMB["ONNX embeddings symbol summaries"] EMB --> VEC["sqlite-vec cosine index"] GIT["git log"] --> H["commit-message index co-change pairs"] end subgraph Query["get_context(task, budget)"] Q["task text"] --> S1["file BM25"] & S2["semantic kNN"] & S3["paths in task"] & S4["history BM25"] S1 & S2 & S3 & S4 --> RRF["reciprocal-rank fusion"] RRF --> KS["knapsack packer value per token"] KS --> OUT["≤ N tokens of code"] end Index -. one SQLite file .-> Query

One SQLite file per repository holds everything: files, symbols, call and import edges, three FTS5 indexes, git statistics, team notes, and the vector index (a vec0 virtual table from sqlite-vec; a numpy fallback runs where SQLite can't load extensions).

Retrieval (RAG). Each signal produces its own ranked list of files; reciprocal-rank fusion combines them, so no single noisy signal dominates:

SignalWhat it catches
BM25 over whole files (camelCase/snake_case split, paths weighted up)exact vocabulary
Semantic kNN over symbol summaries (BAAI/bge-small-en-v1.5, ONNX, CPU)the same idea in different words
Paths named in the task (tracebacks, "in foo/bar.py")explicit pointers
BM25 over each file's commit messages"this was touched for a similar bug before"
Co-change, call-graph neighbours, PageRank, exact-name mentionsavailable as weights; off by default because the benchmark showed they hurt *file* ranking

The weights come from a grid search (bench/tune.py) on 89 SWE-bench Lite issues from 8 repositories and were then checked on Django, which tuning never saw.

What gets embedded, and why. Not whole files and not raw chunks: one short summary per function or class — path, qualified name, signature, first docstring sentence. On a laptop CPU this is ~30x cheaper than embedding bodies, and it is what identifies "which function is this about". Vectors are cached by content hash, so a function that didn't change is never embedded twice — across re-indexes and across git checkouts. Test files are skipped.

Experimental re-rank. ctxsmith context --rerank re-scores the top 20 files with a cross-encoder (ms-marco-MiniLM-L-6-v2). It is off by default because the benchmark shows it hurts (see Results).

Packing. Candidates are function bodies (matched by name, docstring and body text), class outlines and file outlines. A greedy knapsack takes the best value per token, discounts repeats from one file, and enforces the budget on the final rendered text, so the answer is never over budget.

Always fresh. Re-indexing compares file size and mtime before reading anything and only re-parses and re-embeds what changed; checking an unchanged 2,800-file repository takes about half a s

只显示了开头部分;其余内容请在仓库中阅读

问 PopNx