feat(mcp): expose SkillSpector as an MCP server with a scan_skill tool
Adds an MCP server (skillspector mcp) that wraps the existing graph and exposes one tool, scan_skill, over stdio and HTTP. Lets an agent — Claude Code, Codex, Gemini, or a remote A2A runtime — scan a skill and gate the install on the result.
Opened #35 first per CONTRIBUTING; sending this alongside so there's something concrete to look at. Glad to change the naming or packaging based on what you decide there.
What's here:
mcp_server.py—run_scan()does the actual work and doesn't import themcpSDK, so it's testable without the extra.build_server()wraps it in FastMCP;run()serves stdio or streamable HTTP.cli.py—skillspector mcp --transport stdio|http.pyproject.toml—mcpas an optional extra so the core deps don't grow, plus it's indevso CI exercises it.uv.lockupdated (additions only).
The verdict includes llm_used / scan_mode, so a static-only scan (e.g. no credentials) doesn't get mistaken for a clean full scan — related to #3 / #4 / #9.
I also noticed the TODO(SADD A.5.1) for a FastAPI skillspector serve. This is deliberately a separate surface (mcp, not serve) so the two don't collide; happy to fold it into serve later if you'd prefer.
Tested: unit tests for the verdict shape and the llm-accounting cases, plus a stdio client round-trip and the HTTP server run locally. ruff clean, unit suite passes.
pip install "skillspector[mcp]"
skillspector mcp # stdio
skillspector mcp --transport http --port 8000 # remote / A2A
Commits are DCO signed-off.
Please resolve. merge conflicts
Rebased onto current main — conflicts in cli.py resolved by preserving both the upstream multi-skill scanning functions (_build_trace_config, _scan_multi_skill) and the mcp command added in this PR. uv.lock regenerated. Ready to merge.
Seeing another conflict to resolve
Resolved merge conflict with upstream/main (baseline command, #106).
One file had a conflict:
src/skillspector/cli.py: both sides added a new@app.command()function after the same anchor point. Resolution: kept both —mcp()(this branch) andbaseline()(upstream), each with its own@app.command()decorator.
No logic changes. Full unit test suite: 935 passed, 2 pre-existing failures in
test_meta_analyzer.py that exist on upstream/main itself (unrelated to this branch).