
Ai Optimizer
io.github.shivam-app-developers由 GitHub 账号 shivam-app-developers 发布v0.1.0更新于 Oct 24, 2026
MCP server that cuts AI coding agent token usage via framework-aware context optimization
概览
本地 MCP 服务器,用框架感知的读取方式替代 AI 编程助手的文件、搜索与诊断调用,以减少 token 消耗。
- 可以做什么
- 按框架规则跳过生成文件与依赖目录,读取和列出项目文件,支持忽略规则、.gitignore 与行范围截取
- 在忽略过滤下搜索文件内容,并通过 LSP 读取单个符号而非整份文件
- 运行语言服务器诊断,只返回错误和一小段相关代码
- 清理 shell 输出中的 ANSI 控制符、构建工具进度和 JVM 警告
- 报告检测到的框架、已启用的包以及累计节省的 token
- 适用场景
- 当 AI 编程助手把上下文浪费在生成文件、依赖目录和构建产物上,或希望在大型、框架较多的代码库中做更省、更窄的读取时适用。面向支持 MCP 的助手,如 Claude Code、Cursor、Cline、Zed 等。
- 运行要求
- 以本地 stdio 进程运行,需通过 npm 安装 @ai-optimizer/core(Node.js)。可选的 AI_OPTIMIZER_LICENSE 密钥用于解锁 Pro/Team 包,免费版无需密钥。语言服务器诊断需要本机安装对应的 LSP。许可证校验是唯一的网络请求。
安装
在 SourceWeft 中
- 打开 控制台中的 Ai Optimizer,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
AI Token Optimizer
An MCP server that cuts AI coding-agent token usage by 60–80% via framework-aware context optimization.
[CI] [CodeQL] [npm] [License: MIT]
AI coding agents read whole files when they need 15 lines. They load *.g.dart,
R.java, node_modules/, and dist/ into context — then do it again next turn.
AI Token Optimizer is a Model Context Protocol
server that intercepts those tool calls and strips framework noise before it
reaches the model.
Works with anything that speaks MCP: Claude Code, Cursor, Cline, Continue, Zed, JetBrains AI, GitHub Copilot agent mode, Antigravity, Windsurf, OpenAI Codex CLI.
Quickstart
Then point your agent at the ai-optimizer stdio server. For Claude Code, add to
~/.claude/settings.json:
Or scaffold the config and preview your savings automatically:
Full per-agent setup (Cursor, others), LSP install, and verification steps live in
packages/core/README.md.
What it does
It registers tools the agent uses instead of its built-in file/dir/error reads:
When a project type is detected (e.g. Python via pyproject.toml), the matching
pack's ignore rules activate automatically. .gitignore is respected on top.
Tiers
See PRICING.md. Behavior-changing or data-sharing features
(scheduler, work-stealing, telemetry) are off by default and require explicit
opt-in. Display-only features (dollar-value savings) default on.
Monorepo layout
Architecture details: ARCHITECTURE.md.
Development
Security
Local-only by design — license validation is the only network call. Report
vulnerabilities per SECURITY.md.
License
Core engine is MIT — see LICENSE. Pro/Team packs are proprietary.
来源:README.md,提交 ef0a56a
工具
0版本历史
1- v0.1.0最新Sep 16, 2026
评分
已满足适用检查项的 40%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
请在仓库或注册中心条目中声明许可证。