
AI 工具输出的可靠性网关:适用于 MCP 和 CLI 代理的 schema-stable、secret-safe、分页完整 JSON 格式。
概览
AI工具输出的可靠性网关:schema-stable、secret-safe、分页完整JSON。 Sift 是 MCP 和 CLI 工具输出的可直接依赖性层。它将完整有效载荷作为工件持久化,返回内联有效载荷(完整)或紧凑引用(schema_ref),并允许代理用 Python 代码对存储数据进行查询所需内容。 基准总结:在12个真实JSON数据集中,103个事实性问题中,Sift将准确率从33.0%提升到99.0%,同时剔除输入令牌减少了95.4%(10,757,230 - > 489,655)。完整详情请见benchmarks/README.md。 1. 执行上游工具/命令并捕获 JSON。2. 将完整输出作为 SQLite 中的工件持久化,并确定性地映射模式/根提示。3. 返回完整(小)或 schema_ref(大/分码)。4. 明确继续页面直到 pagination.retrieval_status == 完成。5. 对单个工件或完整的分页链运行聚焦的 Python 查询。
概述(AI 翻译)
AI工具输出的可靠性网关:schema-stable、secret-safe、分页完整JSON。
Sift 是 MCP 和 CLI 工具输出的可直接嵌入可靠性层。它以工件形式保留完整有效载荷,返回内联有效载荷(full)或紧凑引用(schema_ref),并允许代理用 Python 代码对存储数据进行查询所需内容。
基准总结:在12个真实JSON数据集中,103个事实性问题中,Sift将准确率从33.0%提升到99.0%,同时剔除输入令牌减少了95.4%(10,757,230 - > 489,655)。完整详情请见benchmarks/README.md。
它是如何运作的
流程:
- 执行上游工具/命令并捕获 JSON。
- 在 SQLite 中作为工件持久化完整输出,并确定性地映射模式/根提示。
- 返回
full(小)或schema_ref(大/分码)。 - 明确继续页面直到
pagination.retrieval_status == COMPLETE。 - 对单个工件或完整的分页链运行聚焦的Python查询。
主要MCP痛点
这些内容在MCP客户端问题跟踪器和协议生产环境中的使用中反复出现:
- 大型工具定义和大型工具结果会迅速消耗上下文。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Sift
Reliability gateway for AI tool output: schema-stable, secret-safe, pagination-complete JSON.
Sift is a drop-in reliability layer for MCP and CLI tool output. It persists full payloads as artifacts, returns either inline payload (full) or compact references (schema_ref), and lets agents query what they need with Python code over stored data.
Benchmark summary: on 103 factual questions across 12 real JSON datasets, Sift improved accuracy from 33.0% to 99.0% while cutting input tokens by 95.4% (10,757,230 -> 489,655). Full details: benchmarks/README.md.
How it works
┌─────────────────────┐
MCP tool call ──────────▶│ │──────────▶ Upstream MCP server
CLI command ──────────▶│ Sift │──────────▶ Shell/API command
│ │
│ ┌─────────────┐ │
│ │ Artifacts │ │
│ │ (SQLite) │ │
│ └─────────────┘ │
└─────────────────────┘
│
▼
Small output -> `full` inline
Large output -> `schema_ref`
Agent queries artifacts with code
Flow:
- Execute upstream tool/command and capture JSON.
- Persist full output as an artifact in SQLite and deterministically map schema/root hints.
- Return
full(small) orschema_ref(large/paginated). - Continue pages explicitly until
pagination.retrieval_status == COMPLETE. - Run focused Python queries on one artifact or the full pagination chain.
Main MCP pain points
These are recurring across MCP client issue trackers and protocol usage in production:
- Large tool definitions and large tool results consume context quickly.
- Upstream API pagination often sits outside MCP list-cursor flows, so agents can stop early and answer on partial data.
- Tool output shape differs across servers, which makes follow-up parsing brittle.
- Tool output is untrusted input and can contain sensitive values that should not re-enter model context.
- Raw outputs scroll away in chat history, so provenance and reproducibility degrade across multi-step runs.
Background and references: docs/why.md.
What Sift adds (without changing upstream servers)
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →