Smart Context MCP
概览
作者提供的说明(英文原文)
Reduces AI agent token usage by 90% via context compression and task checkpoint persistence.
PopNx MCP 的三大支柱
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
- 用户评价i暂无评价评价功能将在后续阶段与账户功能一起开放
- 我们的基础检查i1 项中通过 1 项依据公开信息检查;尚未扫描代码
- 使用情况i非常新↓ 92/周 · ★ –
它能帮你做什么
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
- 连接方式: 在你的电脑上运行
- 传输方式: stdio
- 分类: 文档、表格与办公
安装
选择你使用的 AI 应用,然后复制设置。
安装之前
- 基础检查:1 项中通过 1 项
- 在你的电脑上运行,拥有你的用户账户的权限(文件、网络、应用)。
- 注册中心没有列出需要填写的密钥。
你需要
- npm已安装 Node.js(用于 npx 命令)
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json
{
"mcpServers": {
"smart-context": {
"command": "npx",
"args": [
"-y",
"smart-context-mcp"
]
}
}
}在终端中运行这条命令
claude mcp add smart-context -- npx -y smart-context-mcp或者自己复制设置
粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"smart-context": {
"command": "npx",
"args": [
"-y",
"smart-context-mcp"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
或者自己复制设置
粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"smart-context": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"smart-context-mcp"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。
你的选择通过 Cookie 保存在这台设备上,无需账户。
这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
它能做什么
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
基础检查i
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月9日
- ✓ 通过
作者与仓库一致
注册名称已通过 GitHub 账户 Arrayo 验证,该账户拥有此仓库
- … 尚未检查
仍在维护
我们还没有从 GitHub 读取这个仓库
- … 尚未检查
有许可证
我们还没有从 GitHub 读取这个仓库
- – 不适用
端点有响应
它在你的电脑上运行,没有互联网端点
- – 不适用
使用 OAuth 登录
在你的电脑上运行,改用本地设置
- … 尚未检查
工具描述中没有隐藏指令
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与“文档、表格与办公”中的其他服务器比较i
- 星标数多于此分类中其他 3603 个服务器的 0%
- 发布到注册中心的时间比此分类中其他 3603 个服务器的 37% 更新
- 基础检查结果等于或优于此分类中其他 3603 个服务器的 100%
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
常见问题
Smart Context MCP 安全吗?
它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
它需要哪些密钥或代码?
注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。
它在我的电脑上运行还是在云端?
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
它还在维护吗?
GitHub 仓库最后更新于–,最新版本(1.21.0)于2个月前进入注册中心。
哪些应用可以使用它?
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Node.js。
有什么可以替代它?
同一分类中有:Agent-Native Calendar, Excel MCP Server, MCP Server for Excel
替代选择
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:↓ 每周下载量i★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
Excel MCP Server
Create and edit Excel files with AI: charts, PivotTables, formulas. No Excel needed.
MCP Server for Excel
Excel automation for AI - Sheets, Power Query, DAX, VBA, Tables, Ranges and more. Windows only.
作者的 README
打开 README
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
smart-context-mcp
MCP server that reduces AI agent token usage by up to 90% through intelligent context compression (measured on this project).
What it is
An MCP (Model Context Protocol) server that provides specialized tools for reading, searching, and managing code context efficiently. Instead of loading full files or returning massive search results, it compresses information while preserving what matters for the task.
Real metrics from production use:
- ~7M tokens → ~800K tokens (approximately 89% reduction)
- 1,500+ operations tracked across development
- Compression ratios: 3x to 46x depending on tool
- Context overhead is tracked separately so reports can show gross and net savings
Workflow-level savings:
- Debugging: ~85-90% token reduction
- Code Review: ~85-90% token reduction
- Refactoring: ~85-90% token reduction
- Testing: ~85-90% token reduction
- Architecture: ~85-90% token reduction
Real adoption in non-trivial tasks:
- Approximately 70-75% of complex tasks use devctx tools
- Most used:
smart_read(850+ uses),smart_search(280+ uses),smart_shell(220+ uses) - Primary reasons for non-usage: task too simple, no index built, native tools preferred
See Workflow Metrics and Adoption Metrics for details.
Latest Release: 1.21.0
Minor release built around a semantic engine. MCP grows from 20 → 22 tools (smart_code + smart_output). SQLite schema bumps 8 → 9 (new outputs table; auto-migrates on first run). Zero new runtime dependencies — the TypeScript LanguageService comes from the typescript package you already have, and degrades to a fallback provider when it isn't there.
- `smart_code` (new tool). Semantic code navigation for JS/TS via the TypeScript LanguageService, resolving by symbol name (plus optional
filePath) instead of forcing you to know a line and column. Actions:definition,references,implementations,diagnostics,impact,rename. Returns compact locations (file + 1-based start/end), never full file bodies.includeTests=falsedrops test paths;maxResultscaps the payload. - Impact analysis.
smart_code(action='impact')splits direct hits (semantic: definitions, references, implementations) from transitive files (import graph,maxHopsdefault 2) and related tests, plus coverage flags.risk.levelis labelledbasis: 'heuristic'and says so in its ownnote— it is a ranking aid, not semantic certainty. - Scope-aware rename, dry run by default.
smart_code(action='rename')usesfindRenameLocationsand `dryRun: true` is the default: the first call returns the planned per-file diff hunks (before/afterper line) and writes nothing. Error conflicts (invalid or reservednewName, same name, unresolved target, path escape, missing file, blast radius overmaxFiles) always block the write.name-collisionis a heuristic warning that only blocks withstrict: true, because the check doesn't verify scope overlap. After a real write,diagnosticsAfterreports remaining TypeScript errors in the touched files.smart_editremains the tool for non-semantic textual replacements. - `smart_output` (new tool). Persistent output/artifact store (
shell,test,build,lint,diff) so a stack trace from twenty turns ago is recoverable without rerunning the command. Actions:save,search,excerpt,summary,list,stats,prune. Content is scrubbed for likely secrets before persistence and truncated head+tail aboveDEVCTX_OUTPUT_MAX_BYTES(256KB) so the failing tail always survives. Retention viaDEVCTX_OUTPUT_RETENTION_DAYS(14) andDEVCTX_OUTPUT_MAX_PER_KIND(50). Identical output for the samekind+commandis deduped intorepeat_count. Automatic capture fromsmart_shell/smart_testis opt-in viaDEVCTX_OUTPUT_STORE=true(thensmart_shellreturns anoutputRef); explicitsave/searchalways work. Degrades withdegraded: trueinstead of throwing when SQLite is unavailable or locked. - Opt-in semantic expansion in `smart_context`.
include: ['semantic']expands context through real definitions, references and implementations rather than text similarity, and every item gains awhyIncludedexplanation. Off by default until the precision@5 benchmark justifies otherwise. - Richer ADR/spec awareness and graph paths carried over from the same roadmap: ADR sections are indexed as
kind='adr'/'adr-section', andsmart_contextcan return graph paths between two files or symbols.
- Shared `tokenBudget` across tools.
smart_read,smart_read_batch,smart_context,smart_turn(start+end) andsmart_resumenow accepttokenBudget: number | { id?, maxTokens, shared? }. Whenshared:true(oridset), the budget is reused across calls inside the same task — so a multi-step agent flow can stay under a hard token ceiling without per-call bookkeeping. Responses includetaskBudget,remainingBudget, andbudgetDetails(scope,actions, degraded mode) when the budget actually changed the output. - `smart_search` search modes. New
mode: 'needle' | 'balanced' | 'semantic'(defaultbalanced).needle= literal exact only (no regex / no term expansion) — kills noise on debug queries.balanced= exact + regex + term expansion.semantic= exact-first plus the local semantic block only when exact signal is weak. The previoussemantic: trueflag remains as a legacy alias formode: 'semantic'. DefaultmaxFilestightened 15 → 5. NewmaxTokenscaps the whole response and compacts intelligently (matches first, then diagnostics, then semantic block). Per-file ranking is now inspectable viamatchedBy,boostSource,scoreBreakdown,whyRanked. Response also returnshasMore/totalFiles/nextSuggestedMaxFilesand actionablesuggestionswhen the query is too broad or empty. - `smart_read` persistent cache + budget-aware `full` degradation. New SQLite
read_cachetable keyed by(filePath, mode, selector, content_hash). Second read of an unchanged file is virtually free. Modefullis now an explicit last resort: if atokenBudget/maxTokensis set, it degrades to lighter modes first (outline → signatures → truncated) and reports the real mode used infullMode+budgetDetails. NewclearReadCachePersistent+ GC integration inrunStorageMaintenance. - `smart_turn` simple-task skip heuristic. When the prompt is short (≤ 40 chars after normalization), classified as a simple task, and no session/task is pinned,
smart_turn(start)now returnsskipSmartTurn: truewithrecommendedPath.mode='simple_task_skip'instead of paying the full orchestration cost. Saves continuity-resolution overhead on trivial prompts.minimalverbosity additionally compacts summary/refreshedContext to the fields agents actually consume. - `global_memory` noise hints. Per-project, scrubbed noise telemetry persisted to
~/.devctx/global.db(noise_hintstable). New actionsnoise_statsandnoise_reset(full or viaquery). Letssmart_searchlearn which queries the agent already discovered to be noisy in a given repo and adjust ranking, without ever leaking content. - KPI baseline infrastructure. New scripts
evals/kpi-baseline.js+evals/kpi-utils.jsaggregateharness.jsandrealworld-eval.jsruns into a single JSON snapshot with top-5 precision, recall, reread task/call rate, and per-task-size buckets (short / long). Persistskpi-baseline-latest.jsonfor regression detection across releases. New test suitetests/eval-kpis.test.js.
Highlights from 1.20.0 (still current)
Same tool count as 1.19.0, but several tools gained hard token-budget control, search-mode discipline and second-read cache reuse.
- Shared `tokenBudget` across tools.
smart_read,smart_read_batch,smart_context,smart_turnandsmart_resumeaccepttokenBudget: number | { id?, maxTokens, shared? }, reusable across calls inside one task so a multi-step flow stays under a hard ceiling. - `smart_search` modes.
mode: 'needle' | 'balanced' | 'semantic'(defaultbalanced),maxTokenscapping the whole response, and inspectable ranking viamatchedBy/scoreBreakdown/whyRanked. - `smart_read` persistent cache. SQLite
read_cachekeyed by(filePath, mode, selector, content_hash); a second read of an unchanged file is virtually free. Modefulldegrades to lighter modes under a budget and reports the real mode used. - `smart_turn` simple-task skip on short trivial prompts, and `global_memory` noise hints that let
smart_searchlearn which queries proved noisy per repo. - KPI baseline infrastructure (
evals/kpi-baseline.js) snapshotting precision@5, recall, reread rate and latency for regression detection.
Highlights from 1.19.0
Five-step quality jump executed as sequential commits with full dogfooding. MCP grew from 18 → 20 tools, +68 tests, zero new dependencies.
- `smart_playbook` (new tool). Declarative composite workflows that run multiple
smart_*tools in a single MCP call. Five built-in playbooks ship with the package:preflight-merge(review + affected tests + checkpoint),debug-flake(last failure + curated debug context + affected),refactor-safe(curated context + affected + checkpoint),doc-sync(ADR search + docs context),ramp-up(status + doctor + ADR overview). Project-level overrides via.devctx/playbooks/*.{yaml,json}with{{args.X}}interpolation,when/label/stopOnFail/dryRun. Tool allowlist restricted tosmart_*. Zero deps: built-in minimal YAML parser. - Reactive FS watcher for the index.
fs.watch(native, recursive, debounced 600ms + batch flush every 2s) keeps the symbol index hot between calls. Filters.git,node_modules,.devctx,dist,build, lockfiles,.min.*,.map,.snap, and non-indexable extensions. Stats surface insmart_status(enabled,flushes,eventsObserved,filesReindexed,filesRemoved,errors,lastFlushAt,pending). Opt-out viaDEVCTX_WATCH_INDEX=false. Wired to MCP shutdown for clean close + final flush. - Richer Python / Go parsers + pluggable parser registry. Python now captures decorators (
decorators: ["dataclass", ...]),async def(kindsasync-function/async-method),TypeAliasandTypeVar/NewType/ParamSpec/TypeVarTupleaskind="type", and respects class indent for accurate scope. Go now captures methods with receiver type asparent, interfaces askind="interface", top-levelconst/var.src/parsers/registry.jsexposesregisterParser/getParserso future tree-sitter parsers can plug in without touchingindex.js.INDEX_VERSIONbumped 6 → 7 (auto-reindex). - Local semantic re-rank on `smart_search`. Opt-in
semantic: true(withsemanticLimit) returns asemantic: { embedder, symbols[], files[] }block ranked by hashing/TF-IDF embeddings (256-dim, FNV-1a buckets, L2-normalized, cosine similarity, <5ms). Default behavior unchanged. Pluggable embedder interface (id,dimensions,embed,similarity) ready to swap in ONNX/transformers without touching callers. - `global_memory` (new tool, opt-in). Cross-project memory persisted to
~/.devctx/global.db(override viaDEVCTX_GLOBAL_DB, gated byDEVCTX_GLOBAL_MEMORY=true). St
只显示了开头部分;其余内容请在仓库中阅读