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

已驗證STDIO僅桌面開發者工具AI 與機器學習

概覽

AI 產生的概覽

本機 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。授權驗證是唯一的網路呼叫。
安裝前請注意
Pro 與 Team 為付費訂閱,授權金鑰透過 AI_OPTIMIZER_LICENSE 傳入。會改變行為或分享資料的選用功能(排程器、work-stealing、透過 AI_OPTIMIZER_TELEMETRY 開啟的遙測)預設關閉,需明確開啟。此伺服器會介入檔案與 shell 讀取,在敏感程式庫使用前應確認其回傳內容。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Ai Optimizer,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

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

bash
npm install -g @ai-optimizer/core

Then point your agent at the ai-optimizer stdio server. For Claude Code, add to ~/.claude/settings.json:

json
{  "mcpServers": {    "ai-optimizer": {      "command": "ai-optimizer"    }  }}

Or scaffold the config and preview your savings automatically:

bash
npx @ai-optimizer/init# "we'd skip 47 files, ~14K tokens/session, ~$0.42/session at Sonnet pricing"

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:

ToolWhat it saves
optimized_read_fileFramework-aware skip + optional line slice
optimized_list_filesWalks the tree applying ignore globs (+ .gitignore)
optimized_grepContent search scoped by ignore filters
optimized_diagnosticsSpawns the right LSP, returns errors + a narrow code window
read_symbolLSP workspace/symbol slice instead of a full-file read (Pro/LSP)
strip_bash_noiseStrips ANSI, npm/maven/gradle progress, JVM warnings
optimizer_statusDetected frameworks, active packs, cumulative tokens saved

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

Free (MIT core)Pro ($9/mo)Team ($29/seat)
Framework packsPython, JS/TS+ React, Flutter, Java, Kotlin, Go, Rust, C#, Swift, Ruby, Elixir, PHP, Solidityall Pro packs
History compaction—✓✓
Scheduler (claude -p cron)—✓+ work-stealing across providers
Audit log + secret redaction + policy——✓

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

PackagePurposePublished
packages/coreMCP server + free packsnpm (MIT)
packages/initnpx @ai-optimizer/init config + savings previewnpm
packages/sdkdefinePack plugin SDKnpm
packages/context-mode-importImport .contextmode configsnpm
packages/proPro/Team packs + scheduler + auditprivate
apps/landing, apps/dashboard, apps/vscode-extension, apps/license-serverSite, local dashboard, IDE widget, license issuanceprivate
tools/pack-benchPack quality benchmark harnessprivate

Architecture details: ARCHITECTURE.md.

Development

bash
npm install            # at repo root (workspaces)npm run build          # build all packagesnpm test               # run all test suites

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
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.0最新Sep 16, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。