Writing Skills
writing-skills
效率与协作技能,来自 obra/superpowers,查看原文获取完整用途和操作说明。
mcp-tool-validator【部署与运维】Validate MCP (Model Context Protocol) server tools end-to-end after code changes. Use this skill whenever the user is building, modifying, or deploying an MCP server and needs to verify that all registered tools actually work — not just that the server starts. Triggers on mentions of "MCP server", "MCP tools", "tool validation", "tools/list", "tools/…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
This skill provides a complete, drop-in test harness for validating MCP server tools after code changes. It enforces a strict feedback loop: deploy → validate every tool → fix failures → redeploy → re-validate, capped at 5 iterations, before a PR is raised.
Works for both single-repo and monorepo layouts. Override the defaults table below to match your project structure.
| Setting | Default value | How to override |
|---|---|---|
| Server URL | http://localhost:8080/mcp | Set SERVER_URL env var or edit run_validation.sh |
| Health URL | http://localhost:8080/health | Set HEALTH_URL env var |
| Transport | http (Streamable HTTP) | Pass --transport {stdio,sse,http} |
| Compose file | docker-compose.yml | Set COMPOSE_FILE env var |
| Compose service | mcp-server | Set COMPOSE_SERVICE env var |
| Container name | <project>-mcp | Set in docker-compose.yml container_name: |
| Scenarios file | tests/scenarios.yaml | Set SCENARIOS_FILE env var |
| Test client | tests/mcp_test_client.py | Set TEST_CLIENT env var |
| Orchestrator | tests/run_validation.sh | Modify path in CLAUDE.md block |
| Coverage script | scripts/validate_coverage.py | Set COVERAGE_SCRIPT env var |
Monorepo note: If your MCP server lives in a subdirectory (e.g. mcp/<server-name>/), prefix all paths above with that subdirectory. Example: SCENARIOS_FILE=mcp/my-server/tests/scenarios.yaml.
Use this skill when ANY of the following are true:
src/ and the server has been rebuilt/redeployedDo NOT use this skill for:
npm test or pytest in your MCP server directory)A green health check does not mean the tools work. This skill closes that gap by spawning a real MCP client, calling every tool with declared scenarios, and asserting on protocol shape AND semantic content.
python scripts/validate_coverage.py --server-url $SERVER_URL --scenarios tests/scenarios.yaml --transport http from inside your MCP server directory to verify coverage.references/scenario_schema.md to author or extend scenarios.tests/mcp_test_client.py is the client. No modifications needed for standard use.tests/run_validation.sh as the orchestrator. It handles build → deploy → wait → validate → report.references/feedback_loop.md into your project's CLAUDE.md.Read these only when needed for the current task:
references/client_skeleton.md — Read when implementing or modifying the test client itself (transport details, session lifecycle, stdio vs HTTP)references/scenario_schema.md — Read when authoring scenarios or extending the assertion DSLreferences/assertion_library.md — Read when a scenario needs an assertion type not in the starter setreferences/feedback_loop.md — Read when configuring the autonomous fix-redeploy-retest loop in CLAUDE.mdreferences/docker_orchestration.md — Read when health-check waits, port conflicts, or compose-file orchestration cause issuesEvery tool registered via tools/list MUST have:
happy_path)invalid_input)Run python scripts/validate_coverage.py --server-url $SERVER_URL --scenarios tests/scenarios.yaml before committing. It fails if any tool is missing scenarios.
These guards prevent the most common ways autonomous loops produce false-green results:
# REASON: <one line> comment AND user approval in the conversation.scenarios.yaml require commit message tag [scenario-update] and a one-line justification.validate_coverage.py exits non-zero.After running validation, produce a report with: