원클릭으로
mcp-optimize
Use when the user wants to keep MCP but scope it to the current project with a smaller .mcp.json
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Use when the user wants to keep MCP but scope it to the current project with a smaller .mcp.json
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
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 convert expensive MCP tools into on-demand Claude Code skills
SOC 직업 분류 기준
| name | mcp-optimize |
| description | Use when the user wants to keep MCP but scope it to the current project with a smaller .mcp.json |
.mcp.jsonReduce MCP token waste without converting to skills — keep MCP, but scope it to only the servers relevant to this project by generating a minimal project-local .mcp.json.
This is the non-conversion alternative: instead of replacing MCP tools with skills, it reduces the number of MCP servers loaded per project.
Infer options from the user's request. Mirror the explicit command /mcp-optimizer:mcp-optimize:
--dry-run : show optimization plan without writing files (default behavior unless user confirms)--min-sessions 5 : confidence threshold for analysisSession analysis can be slow, so always use the Agent tool to delegate analysis and report generation. Only the final report should remain in the main context.
Use the following prompt when invoking the Agent tool:
Perform an MCP config optimization analysis.
1. Run the following command to get the optimization JSON:
python3 "${CLAUDE_SKILL_DIR}/scripts/mcp_optimizer.py" --dry-run [--min-sessions <N>]
(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 Optimization Plan
======================
Current: {global_servers} global MCP servers loaded every session
Optimized: {project_relevant_servers} servers scoped to this project
| Server | Status | Est. Tokens/Session |
|--------|--------|---------------------|
| {name} | Keep / Remove | {tokens} |
Removal Candidates:
(list each with reason and token savings)
Estimated Savings: ~{tokens_saved} tokens/session ({percent_reduction}% reduction)
Proposed .mcp.json:
(show the project_config content)
(if warning present, show it prominently)
Report rules:
- Use thousand separators for token counts
- Show "Keep" servers in GREEN, "Remove" servers in YELLOW
- If 0 global servers found, output "No global MCP servers to optimize"
- Return only the final report text. Do NOT return the raw JSON.
- Include the full JSON content of the proposed .mcp.json
.mcp.json that overrides global config.mcp.json to revert to your global config".mcp.json? [Y/n]"If the user confirms:
python3 "${CLAUDE_SKILL_DIR}/scripts/mcp_optimizer.py" [--min-sessions <N>]
(Without --dry-run, this writes the .mcp.json file)
Then confirm: ".mcp.json written. Restart Claude Code for changes to take effect."
After optimization, suggest:
/mcp-optimizer:mcp-audit to verify the improvement in token usage"/mcp-optimizer:mcp-to-skills to convert remaining high-waste servers to on-demand skills"~/.claude.json — only creates project-local .mcp.json.mcp.json to revertsession_analyzer.py from the bundled audit workflow via subprocess to avoid code duplication.mcp.json already exists, it will be overwritten (after user confirmation)