
mcp-usage
io.github.Rixtayz由 GitHub 账号 Rixtayz 发布v0.1.1更新于 Nov 5, 2026
Find out which MCP servers you actually use: local, read-only audit of Claude Code transcripts.
概览
只读的 MCP 服务器兼命令行工具,审计本地 Claude Code 会话记录,显示已连接的 MCP 服务器中哪些真正被使用、闲置、连接失败或等待授权。
- 可以做什么
- 汇总 MCP 服务器使用情况:每个服务器一行,含状态、暴露的工具、会话数、调用次数、错误率、估算结果 token 与最近使用时间
- 列出已连接但从未被调用、连接失败或等待授权的服务器
- 查看单个服务器的详情,包括各工具调用次数、错误与结果大小
- 给出按优先级排序的清理建议:断开、修复或移除、授权或移除、排查错误、结果过大
- 适用场景
- 当你在 Claude Code 中积累了大量 MCP 服务器、想决定保留或断开哪些时使用;也可用于某个服务器表现不稳定时查看各工具的错误证据。只适用于存放 Claude Code 会话历史的同一台机器。
- 运行要求
- 需要 Node.js 22 或更高版本,通过 npx 从 npm 包 @rixtay/mcp-usage 本地运行(stdio 传输)。需要本机已有 Claude Code 会话历史。无需账号、API 密钥或配置;Claude 配置目录默认为 $CLAUDE_CONFIG_DIR 或 ~/.claude,可用 --dir 覆盖。
安装
在 SourceWeft 中
- 打开 控制台中的 mcp-usage,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
mcp-usage
[CI] [npm] [Node] [License: MIT] [MCP Registry]
[mcp-usage: find out which of your MCP servers you actually use]
A small, focused MCP server and CLI that reads your local Claude Code transcripts and tells you, for every MCP server you have connected, whether it is actually used, sits idle in every session, fails to connect, or has been waiting for authorization for weeks — and what to disconnect.
Built for one job: answer "which of my MCP servers should I keep?" — locally, read-only, without ever exposing a word of your conversations.
Tools
Four tools, all read-only:
Design choices:
- Exact, not guessed. Claude Code already records, in every session, which MCP tools were available and which servers failed or needed auth. "Available but never used" is a set difference over your own logs, not a heuristic.
- Private by construction. No network code at all. The output holds server names, tool names, counts, byte totals and timestamps — never prompts, responses, tool inputs, tool outputs, file paths or error messages. The test fixtures plant
SECRET_*markers everywhere private content lives in a real transcript, and the tests assert none of them reach the library, the CLI or the MCP output. - Fast on big histories. Transcripts are streamed line by line and lines that cannot matter are skipped before
JSON.parse: ~360 MB of history (including a 90 MB session) scans in about 3 seconds. - Hygiene, not billing. Cost analyzers (ccusage, agent-cost-mcp, …) tell you how many tokens and dollars you spent. This tells you which servers earn their place.
- Every tool ships a strict input schema and MCP annotations (
readOnlyHint,idempotentHint) so hosts can auto-approve them.
Requirements
- Node.js 22 or newer.
- Claude Code (CLI, desktop app or IDE extension) with some session history on this machine. Nothing else: no account, no API key, no configuration.
1. Run the report
No install needed, npx fetches the package from npm (@rixtay/mcp-usage, the installed command is mcp-usage):
Or from a clone:
Text output truncates long lists; --json always contains everything.
2. Connect to Claude Code
3. Connect to Claude Desktop / Cowork / any MCP client
mcp-usage is listed in the official MCP Registry as io.github.Rixtayz/mcp-usage, so clients that browse the registry can install it by name. Otherwise, configure it by hand:
Edit ~/Library/Application Support/Claude/claude_desktop_config.json on macOS (or %APPDATA%\Claude\claude_desktop_config.json on Windows), reachable through Settings → Developer → Edit Config.
If the host cannot find npx (it may not inherit your shell PATH), use absolute paths instead: "command": "/absolute/path/to/node", "args": ["/absolute/path/to/mcp-usage/dist/bin/cli.js", "serve"].
The server reads Claude Code's transcripts wherever it runs, so it only makes sense in local sessions, on the machine where you use Claude Code.
4. Example prompts
- "Which of my MCP servers should I disconnect?"
- "Which servers have been waiting for authorization the longest?"
- "Playwright seems flaky. Which of its tools fail the most?"
- "Did I use anything other than Context7 in the last 7 days?"
Typical flow: recommendations → the assistant proposes a cleanup list, you confirm → server_details on anything surprising → you disconnect the servers yourself. The tools never touch your MCP configuration.
What it reports
Each server gets one status:
Recommendations, in priority order:
Development
Layout:
Stack: @modelcontextprotocol/sdk v1, zod v4, nothing else at runtime. Design notes: docs/DESIGN.md.
Things worth knowing
- The transcript format is not a public API. It is parsed defensively — every field optional, unknown records ignored, malformed lines counted and skipped — but a future Claude Code release can still break it. Tested against Claude Code 2.1.233 – 2.1.274.
- Token figures are estimates: result bytes ÷ 4, text only. Transcripts record no per-result token count, and image results are not counted.
- Tool names are split on the first
__after themcp__prefix. Server ids can contain underscores, hyphens, dots or be a bare UUID, and tool names can contain__themselves, so a naivesplit("__")miscounts. - The same connector can appear under two names — a readable one in the CLI, a UUID in the desktop app. They are not merged.
- Servers bundled with the Claude desktop app (
ccd_*) are reported but never flagged for disconnection: you cannot remove them. - Claude Code deletes old transcripts, so a long
--sincewindow only sees what is still on disk. - Claude Code only, for now. Adapters for other clients are welcome.
Contributing
Bug reports, fixes and adapters for other MCP clients are welcome: see CONTRIBUTING.md. If Claude Code updates and the report suddenly looks wrong, open a bug with your Claude Code version. Found a way the tool could leak transcript content? Please report it privately, as described in SECURITY.md.
Release history: CHANGELOG.md.
License
MIT
来源:README.md,提交 4f8dc39
工具
0版本历史
1- v0.1.1最新Oct 1, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
