一键导入
mcp-audit
Use when the user wants to measure MCP token waste, rank high-cost servers, or choose between project scoping and skill conversion
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when the user wants to measure MCP token waste, rank high-cost servers, or choose between project scoping and skill conversion
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when the user wants to health-check MCP servers, diagnose broken connections, or find duplicate tools and missing credentials
Use when the user wants to keep MCP but scope it to the current project with a smaller .mcp.json
Use when the user wants to convert expensive MCP tools into on-demand Claude Code skills
| name | mcp-audit |
| description | Use when the user wants to measure MCP token waste, rank high-cost servers, or choose between project scoping and skill conversion |
Analyze the user's Claude Code session history (JSONL) to:
Infer scope from the user's request. Mirror the explicit command /mcp-optimizer:mcp-audit. Default is project.
--scope project : analyze sessions for the current project only--scope all : analyze sessions across all projectsSession data can be large, so always use the Agent tool to delegate analysis and report generation. Only the final report text should remain in the main context.
Use the following prompt when invoking the Agent tool:
Perform an MCP token waste analysis.
1. Run the following command to get the analysis JSON:
python3 "${CLAUDE_SKILL_DIR}/scripts/session_analyzer.py" --scope <scope>
(Actual path for ${CLAUDE_SKILL_DIR}: <absolute path to this skill directory>)
2. Format the JSON result into the report template below and return it:
MCP Token Waste Analysis Report
================================
Scope: {scope} ({sessions_analyzed} sessions, {date_range})
| MCP Server | Tools | Used | Est. Wasted Tokens | Cost/Session | Priority |
|------------|-------|------|--------------------|-------------|----------|
| {name} | {total} | {used} ({ratio}%) | ~{waste} | {per_session} | {priority} |
Total estimated waste: ~{total_waste} tokens
Recommended Actions:
(list each item from the recommendations array, ranked by priority)
Unmatched Tools:
(show unmatched_mcp_tools if any exist)
Report rules:
- Priority indicators: HIGH = RED, MEDIUM = YELLOW, LOW = GREEN
- Use thousand separators for token counts (e.g., 126,000)
- Show ratios as percentages
- If 0 sessions found, output "No session data available for analysis"
- Include convert_command from recommendations
- Return only the final report text. Do NOT return the raw JSON.
Output the report returned by the sub-agent directly to the user.
If the report contains recommended actions, present two optimization paths:
Option A: /mcp-optimizer:mcp-optimize — Keep MCP, reduce scope
.mcp.json with only relevant servers.mcp.json to revert)Option B: /mcp-optimizer:mcp-to-skills — Convert to on-demand skills
Present the options like this:
/mcp-optimizer:mcp-to-skills/mcp-optimizer:mcp-optimize/mcp-optimizer:mcp-optimize/mcp-optimizer:mcp-to-skills for the recommended servers/mcp-optimizer:mcp-optimize first, then /mcp-optimizer:mcp-to-skills for remaining high-waste servers