Skip to content

Getting Started

Tool-Scan scans MCP tool definitions for security vulnerabilities, MCP spec compliance, and quality issues. This guide covers installation and your first scan.

Install from PyPI:

Terminal window
pip install tool-scan

Scan a single tool definition file:

Terminal window
tool-scan my_tool.json

The output shows the score, letter grade, and any remarks with actionable recommendations.

Use --strict to fail on any security issue, and --min-score to set a threshold:

Terminal window
tool-scan --strict --min-score 80 tools/*.json

For automation and downstream processing:

Terminal window
tool-scan --json my_tool.json > report.json

For GitHub Code Scanning and other SARIF-compatible tools:

Terminal window
tool-scan --format sarif tools/*.json > results.sarif

Process multiple files in parallel with --jobs:

Terminal window
tool-scan --jobs 4 --json tools/*.json

For large batches, reduce output size or memory usage:

Terminal window
# Compact JSON (~50% smaller, single line)
tool-scan --json --compact-json tools/*.json
# Streaming JSON (low peak memory)
tool-scan --json --stream tools/*.json

You can also scan tools programmatically:

from tool_scan import grade_tool
tool = {
"name": "get_weather",
"description": "Gets current weather for a location.",
"inputSchema": {
"type": "object",
"properties": {
"city": {"type": "string", "description": "City name"}
},
"required": ["city"],
"additionalProperties": False
}
}
report = grade_tool(tool)
print(f"Score: {report.score}/100")
print(f"Grade: {report.grade.letter}")
print(f"Safe: {report.is_safe}")