清理工具 是 AI Skill Hub 本期精选MCP工具之一。综合评分 7.5 分,整体质量较高。我们推荐使用将其纳入你的 AI 工具库,帮助提升工作效率。
清理工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
清理工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/qdrddr/clear-your-tools
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"----": {
"command": "npx",
"args": ["-y", "clear-your-tools"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 清理工具 执行以下任务... Claude: [自动调用 清理工具 MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"____": {
"command": "npx",
"args": ["-y", "clear-your-tools"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
Clear Your Tools is a reverse proxy for coding agents such as Claude Code and Codex CLI. It sits between the agent and upstream LLM providers (Anthropic-compatible APIs on OpenRouter, Novita, DeepInfra, and others), intercepts each request, and shrinks the tool payload before forwarding it upstream. Can be easily adopted for other harness agents.
Supported and tested Agents:
Examples of how to run these agents with the proxy can be found in the ./examples/agents directory.
Large MCP catalogs can add tens of thousands of tokens of tool-schema overhead on every turn. Clear Your Tools removes irrelevant tools and trims irrelevant optional parameters while always keeping required fields for tools that stay in the request.
---
From PyPI (proxy + pruners):
uv tool install 'clear-your-tools[all]'
Requires uv tool. Install uv
uv run cyt setup ```
Stats are stored in ~/.config/cyt/stats.db by default.
---
| Stage | Model (default) | When it runs | What it does |
|---|---|---|---|
bm25 | Local BM25 index (bm25s) | Default pipeline when no remote pruner is configured; also fallback when rerank/llm fail or tool count is below their thresholds | Scores catalog chunks locally against the user query; no API keys or pruning cost. Indexes are cached under ~/.config/cyt/bm25/. |
rerank | Qwen3-Reranker-8B (DeepInfra) | ≥ models.rerankers.minimum_tools tools (default **50**), after cyt setup | Scores every catalog chunk against the user query; drops low-scoring tools and optional props. |
llm | Mercury 2 or GPT-OSS-120B (OpenRouter) | ≥ models.llm.minimum_tools tools (default **50**), after rerank | LLM selects which catalog chunks to keep; can remove entire tools more aggressively. |
Tool Recommendations:
- Getting started / no setup — the default bm25 pipeline works out of the box with no remote API keys. - 50+ tools — run cyt setup and use rerank or llm. Rerank can be pipelined into LLM as a second stage (pipeline: [rerank, llm]) for stronger tool-level filtering on large catalogs.
Pipeline & Model Recommendations: Choose your pipeline based on model cost:
---
<details> <summary><strong>Doesn't pruning burn more tokens than it saves?</strong></summary>
The default is BM25 algorithm running locally on your computer it is free. The reranker and weak LLM used for pruning are much cheaper per token than the main model (e.g. Claude Sonnet). You may spend extra tokens on pruning, but they cost a fraction of what you save on the main request. Set input_cost_per_token and output_cost_per_token in ~/.config/cyt/config.yaml to track savings.
Example pricing (input tokens):
| Model | Cost per 1M input tokens |
|---|---|
| Claude Sonnet 4.6 | $3.00 |
| Qwen-Reranker-8B | $0.050 |
| GPT-OSS-120B | $0.14 |
| Inception Mercury 2 | $0.25 |
The weak models such as Mercury 2 or GPT-OSS-120B returns only the IDs of tools to keep, so its output stays extremely small. Rerankers do not count output tokens and are usually much cheaper than a strong LLM.
Rule of thumb: saving 1M Sonnet input tokens is still worthwhile even if pruning uses up to ~10M Mercury tokens — roughly a 1:10 cost ratio. The reranker has roughly a 1:60 cost ratio.
In practice, pruning usually adds modest overhead. Worst case (no tools pruned), you might pay ~$3.30 instead of $3.00. With typical pruning (40–95% of tool tokens removed), tool-schema cost drops from ~$3.00 to roughly $0.15–$1.80, plus ~$0.30 for pruning — about $0.45–$2.10 total for tool-related cost, or roughly 30–85% savings depending on policy. </details>
<details> <summary><strong>Why don't I see 30–85% savings on my total request?</strong></summary>
Those numbers apply to tool schemas only of the input tokens only, not the full prompt (system message, conversation history, user message, etc.). Clear Your Tools prunes tools based on the user request; the rest of the request is unchanged. Codex agent has an efficient tool use and CYT saves less tokens.
How much you save overall depends on:
- How many tools you have — more MCP servers mean a larger share of the request is tool schemas. We do not recommend using CYT below 50 tools. - Which pruning policy you use — see Pruning policies.
To estimate savings on a captured request JSON, see DEV.md. To see statistics of actual net savings (input tokens) run:
uv run cyt stats totals
With ~100 tools and prune_all, expect ~85–95% savings on tool tokens and typically ~30%+ savings on the full request. The more tools you have the more overall savings you'll see.
</details>
<details> <summary><strong>Where can I see how many tools and parameters an MCP server has?</strong></summary>
The popular Fetch MCP server is a good example. On its Tools tab: 4 tools, each with 4 parameters (1 required, 3 optional) — 16 parameters total.
If the user asks to "fetch the Markdown of a webpage", the prune_all typically keeps only the Fetch Markdown tool with its required parameter plus any optional parameters that look relevant. Unrelated tools (e.g. Read file) are dropped entirely.
</details>
<details> <summary><strong>Is my provider/model supported?</strong></summary>
CYT's pruner models (the cheap reranker and LLM that decide which tools to keep) call providers through LiteLLM. If LiteLLM supports your provider and model, you can use them in CYT.
When you run cyt setup and add a pruner model, you'll be prompted for:
- Provider — LiteLLM provider route, without a trailing slash (e.g. openai, openrouter). - Model name — LiteLLM model string (see the provider docs). - API key env var — the name of the environment variable that holds your key, not the key itself (e.g. OPENAI_API_KEY, OPENROUTER_API_KEY). - domain_match — hostname from the provider's API base URL (e.g. openai.com for OpenAI, openrouter.ai for OpenRouter). Used to match outgoing requests to the right model config.
</details>
<details> <summary><strong>Claude Code reports ZlibError when using the proxy</strong></summary>
Install missing zlib:
npm install -g zlib
brew install zlib
This usually means the proxy returned a Content-Encoding: gzip (or deflate) header with a body that was already decompressed. Claude Code’s fetch then tries to inflate plain JSON/SSE and fails. It is not a missing zlib install on your machine or in CYT.
Fix: upgrade to a cyt build that streams upstream bytes unchanged (aiter_raw pass-through). After upgrading, verify:
curl --raw -sS -D - -o /tmp/cyt-msg.body \
-H 'Accept-Encoding: gzip' \
... # your POST to http://127.0.0.1:8834/anthropic/v1/messages
head -c 4 /tmp/cyt-msg.body | xxd # should show 1f8b when header says gzip
Also check: ANTHROPIC_BASE_URL must use http:// for the default plain-HTTP server, e.g. http://localhost:8834/anthropic. Using https:// against cyt proxy (without TLS/http2.serve) causes uvicorn’s Invalid HTTP request received and broken API calls.
</details>
<details> <summary><strong>Uvicorn logs Invalid HTTP request received</strong></summary>
cyt proxy listens for HTTP/1.1 on the configured port (default 8834). This warning almost always means a client connected with the wrong protocol:
https://localhost:8834 while the proxy is plain HTTP → TLS handshake bytes, not HTTPhttp2.serve + TLS certs only if you intend HTTPS)Use http://localhost:8834/anthropic unless you have enabled Hypercorn TLS in config.
</details>
<details> <summary><strong>Should I use .env</strong></summary>
We strongly recommend using password vaults like macOS KeyChain
```shell
高效的MCP工具,值得关注
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。
经综合评估,清理工具 在MCP工具赛道中表现稳健,质量良好。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | clear-your-tools |
| 原始描述 | 开源MCP工具:Cut input tokens by 30% while preserving LLM focus and pruning irrelevant MCP to。⭐6 · Python |
| Topics | mcpmcp-toolsproxy-serverpython |
| GitHub | https://github.com/qdrddr/clear-your-tools |
| License | Apache-2.0 |
| 语言 | Python |
收录时间:2026-05-29 · 更新时间:2026-05-30 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端