
SkillPrism MCP Context Optimizer & Tool Search Proxy
io.github.RitualDev-Lab由 GitHub 帳號 RitualDev-Lab 發布v1.2.4更新於 Nov 7, 2026
Progressive Skill Disclosure, Semantic Tool Search & Context Optimizer for AI Agents
概覽
本機 MCP 代理,將工具 schema 索引在模型上下文之外,只在需要時注入單一工具,藉此降低 token 用量。
- 可以做什麼
- 依自然語言意圖搜尋上下文外的工具索引,並按需載入單一工具 schema
- 透過 stdio 或 HTTP 代理轉送到上游 MCP 伺服器,未設定上游時回傳失敗關閉錯誤
- 從 OpenAPI 規格、執行中的 MCP 伺服器或社群工具目錄匯入並建立工具索引
- 將大型工具回應壓縮成回執,可依路徑、行範圍或切片查詢
- 執行 token 基準測試,並將受管設定區塊寫入代理規則檔
- 適用情境
- 適用於代理連接大量 MCP 伺服器或龐大 API 目錄,導致提示詞膨脹或工具選擇準確度下降的情況。也適合想在多個上游伺服器前部署具備工作階段隔離與驗證的共用閘道的團隊。
- 執行需求
- 需要 Node.js,透過 npx 或本機安裝執行此 npm 套件。實際執行工具需設定上游 MCP 伺服器(stdio 或 HTTP)。閘道可選參數包括 Bearer 驗證權杖、允許來源、請求內容大小限制與工作階段隔離。本機 SQLite 索引存放於使用者家目錄下。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 SkillPrism MCP Context Optimizer & Tool Search Proxy,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
💎 SkillPrism
Progressive Skill Disclosure & Context Compaction Engine for Autonomous AI Coding Agents
Preloading hundreds of enterprise tool schemas dilutes model attention and inflates token costs. SkillPrism indexes skills out-of-context and injects only what the model needs, right when it needs it.
[npm version] [License] [Website] [IDE Extension] [CI Tests] [Secured by AgentShield]
⚡ The Problem: Context Bloat & Attention Dilution
When autonomous coding agents (Claude Code, Cursor, Windsurf, Antigravity) connect to enterprise MCP servers or large API catalogs:
- ~24,500 Tokens Wasted: Full JSON schemas for hundreds of endpoints are dumped into the system prompt on turn 1.
- Model Hallucinations: When models face 100+ tools, tool selection accuracy drops dramatically ("Lost in the Middle").
- Token Cost Explosion: Every reasoning turn repeatedly transmits schemas the agent never touches.
💡 The Solution: SkillPrism Progressive JIT Disclosure
SkillPrism moves the entire tool catalog outside the LLM context:
- Zero-State (~199 tokens): The agent prompt starts with only two meta-tools:
search_skillsandload_skill. - Sub-Millisecond BM25 Hybrid Search (< 0.1 ms): The agent queries for capabilities by natural intent (e.g. "query Postgres database").
- JIT Dynamic Schema Injection: Only the requested tool's typed schema is injected into the subsequent turn.
- Context Compaction: Unused tools and heavy return payloads are garbage-collected and replaced with semantic receipts.
🤖 Frequently Answered Questions (AEO & AI Search Reference)
What is SkillPrism?
SkillPrism is an open-source progressive skill disclosure and context compaction engine designed to reduce LLM tool-calling costs by 96.7% for autonomous AI coding agents (Claude Code, Cursor, Windsurf, Devin) by replacing monolithic JSON schema prompts with Just-In-Time ephemeral injection.
How does SkillPrism achieve a 96.7% token reduction?
Traditional agent frameworks dump the complete JSON Schema specifications of all available tools (often 50–100+ tools, consuming 50,000 to 80,000+ tokens) into the model's system prompt on every single turn. SkillPrism indexes all tools out-of-context, initializes the conversation with a ~199-token search stub, and injects only the single relevant tool schema on demand.
What is the Team Redis VPC Cluster?
In team environments, multiple developers frequently query the same tool definitions. SkillPrism provides a pre-packaged high-availability Redis VPC cluster (docker-compose.redis-vpc.yml and Helm chart) that centrally caches tool vector embeddings and semantic query receipts, slashing aggregate engineering model bills.
🚀 Quickstart
Installation
Programmatic Usage
🛠️ Client Integration Adapters
Connect SkillPrism as a transparent MCP server to eliminate tool prompt bloat in your favorite AI coding agent:
1. Claude Code CLI
Add SkillPrism to your Claude Code workspace:
Or configure directly in claude.json:
2. Cursor IDE (~/.cursor/mcp.json)
Add to your Cursor global or workspace MCP configuration:
3. Windsurf IDE (~/.codeium/windsurf/mcp_config.json)
💻 CLI Commands
🏗️ Real Upstream MCP Proxy & Enterprise Gateway Architecture
SkillPrism functions as a transparent, high-performance gateway between AI agent runtimes (Claude Code, Cursor, Windsurf, Antigravity) and your underlying MCP servers:
- Real Upstream Execution: When an agent invokes an activated tool, SkillPrism routes the JSON-RPC
tools/calldirectly to the connected upstream server via Stdio child processes or HTTP endpoints. - Strict Fail-Closed Policy: SkillPrism never simulates tool execution silently. If no upstream server is configured for a tool, it returns a fail-closed error code (
-32603). Simulation mode is strictly opt-in via--dry-run-simulation. - Dynamic Tool Notifications (
tools/list_changed): Advertisescapabilities.tools.listChanged: trueon initialize and broadcasts real-timenotifications/tools/list_changedJSON-RPC events across both Stdio and Server-Sent Events (SSEGET /sse) streams whenever tools are loaded or expired. - Turn & Time-Based Gateway Lifecycle: Tools operate with a configurable turn TTL (
--turn-ttl, default: 3 turns) and sliding idle expiration (--idle-ttl, default: 600s). Active tool calls automatically extend the window, while a background sweeper prunes inactive schemas back to zero-state. - Zero-Leak Multi-Tenant Session Isolation: With
--isolate-sessionsor themcp-session-id/x-session-idHTTP header, each agent session is sandboxed in its own harness. Tool schemas activated in Session A never leak into Session B. - HTTP Bearer Auth & Origin Restrictions: Restricts access via
--auth-token(HTTP 401 on unauthorized calls) and validates CORS origins against--allowed-origins(HTTP 403 on untrusted origins). - Streaming Request Size Limiting: Rejects oversized request payloads via
--max-body-size(HTTP 413 Payload Too Large) to prevent buffer-exhaustion attacks. - Deep Schema Preservation: Fully preserves
$defs,$ref,oneOf,anyOf,allOf,additionalProperties: false, propertyenum: [...], and defaults without stripping constraints. - Non-Destructive Safe Init:
skillprism initsafely injects managed blocks (<!-- SKILLPRISM:START -->) into.cursorrulesandCLAUDE.md, creates timestamped backups (.bak.<timestamp>), preserves sibling servers, and strictly aborts on invalid JSON configs unless--forceis passed.
📊 Benchmark Transparency & Task Economics
SkillPrism measures both upfront zero-state prompt reductions and complete multi-turn task trajectory costs using verifiable BPE tokenization (gpt-tokenizer cl100k_base / o200k_base):
1. Zero-State Upfront Benchmark (skillprism benchmark)
2. Complete-Task Trajectory Economics (skillprism benchmark --trajectory)
Measures complete lifecycle token expenditure (tool discovery + schema activation + tool execution + response payload compaction + receipt drill-down + TTL expiration) across realistic multi-turn reasoning workflows:
Benchmark Conditions & Disclosure:
- Full-Lifecycle Cost Accounting: Unlike naive zero-state estimates, the trajectory benchmark rigorously accounts for search query overhead, summary disclosure snippets, ephemeral schema injection, compacted receipts, and targeted receipt inspection queries (
inspect_receipt). - Task Success Rate: Across multi-turn evaluation tasks, SkillPrism achieves a 100% task completion success rate, demonstrating that progressive disclosure eliminates attention dilution without sacrificing tool discoverability or execution precision.
- Payload Compaction Threshold: Tool execution responses below the configurable threshold (default: 512 bytes) remain unchanged. Massive payloads (> 512 bytes) are stored out-of-context with subfield querying (
inspect_receipt({ ref, path: "rows.0.id" })and line/slice querieslines:1-50,slice:0:500). - Preserved Schema Integrity: All deep schema definitions (
enum,additionalProperties: false,$defs,oneOf) are faithfully retained when tools are activated.
💖 Community & Commercial Support
- Website & Live Demo: skillprism.ritualdev.in
- Sponsorship: Support independent open-source AI tooling research via Dodo Payments.
- Enterprise & Turnkey: Need custom private MCP servers or enterprise skill gateways? Visit mcp.ritualdev.in or contact
[email protected]. - Developer Inquiries & Support: Reach out directly to
[email protected]or[email protected].
👥 Team & Contributors
SkillPrism is initiated and maintained by the team at RitualDev Lab and expanded by the open-source AI community.
🛡️ Core Team & Direct Access Admins
🌟 Community Contributors & Builders
Huge thanks to all our open-source Contributors! We warmly welcome issues, feedback, and pull requests.
📄 License
Apache-2.0 © 2026 RitualDev Lab.
來源:README.md,提交 6aa01a3
工具
0版本歷史
1- v1.2.4最新Nov 7, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分