Overview
MCP (Model Context Protocol) servers are long-lived processes that expose tools to the agent over stdio or HTTP. They're riskier than skills: a compromised MCP server can exfiltrate data, destroy filesystems, or inject prompts into every subsequent call. DefenseClaw manages MCP entries with defenseclaw mcp set / unset and scans them with defenseclaw mcp scan.
Configure it
defenseclaw setup mcp-scanner
Wizard questions:
- Analyzer list (
yara,api,llm,behavioral,readiness). - Unified LLM provider/model when the LLM analyzer is enabled.
- Cisco AI Defense API analyzer settings when the API analyzer is enabled.
- Whether to scan MCP prompts, resources, and server instructions.
Non-interactive:
defenseclaw setup mcp-scanner \
--non-interactive \
--analyzers yara,behavioral,readiness \
--scan-prompts \
--scan-resources \
--scan-instructions
See the autogenerated setup command page for the full flag table.
Analyzers
| Analyzer | What it flags |
|---|---|
| Manifest validation | Invalid mcp.json, missing required fields, unsigned server manifests |
| YARA | Pattern-based findings from the scanner ruleset |
| API | Cisco AI Defense remote analyzer when configured |
| LLM | Semantic analysis through the unified llm: block |
| Behavioral | Behavioral checks over server/tool metadata |
| Readiness | Runtime readiness and manifest sanity checks |
Findings land in the audit store with scanner=mcp. EventScanFinding.rule_id matches the analyzer; tool_id records which declared tool is responsible.
Verify it worked
defenseclaw mcp scan my-mcp
defenseclaw tui # watch scans arrive live
defenseclaw mcp scan accepts --json, --analyzers, --scan-prompts, --scan-resources, --scan-instructions, and --all for the current OpenClaw MCP config.
Undo
defenseclaw setup mcp-scanner --non-interactive --analyzers yara,readiness
Or edit config.yaml directly when you need a setting that is not exposed through the setup wizard, then restart defenseclaw-gateway.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
mcp-scanner: requires Python >=3.11 (skipped) | Python 3.10 interpreter | Reinstall under 3.11+ |
tool-graph analysis: timeout | A behavioral analyzer took too long on a complex server | Temporarily remove behavioral from --analyzers |
| No findings but you expected some | Analyzer list is too narrow | Re-run setup with --analyzers yara,api,llm,behavioral,readiness |