tollgate scan
Thescan command spawns an MCP server, discovers its available tools, and performs security risk assessment on each tool. It generates recommended security policies based on the analysis.
This is a proactive security measure that helps you understand what an MCP server can do before deploying it to production.
Usage
Options
| Option | Description |
|---|---|
-o, --output <path> | Output generated config to file |
-g, --generate-config | Generate recommended configuration |
-a, --append | Append to existing config file |
-n, --server-name <name> | Server name for generated config |
-t, --timeout <ms> | Connection timeout (default: 30000) |
-e, --env <key=value...> | Environment variables to pass to server |
--json | Output results as JSON |
How It Works
- Server Spawn: The scanner spawns the MCP server process
- Tool Discovery: Calls
tools/listto get all available tool definitions - Risk Analysis: Analyzes each tool’s name, description, and parameters for risk indicators
- Policy Generation: Recommends appropriate actions (allow/prompt/deny/smart) for each tool
Risk Levels
The scanner classifies tools into five risk levels:| Level | Description | Keywords |
|---|---|---|
| 🟢 safe | No risk indicators found | - |
| 🟢 read | Read-only operations | get, list, fetch, search, view |
| 🟡 write | Write operations | create, add, update, insert, upload |
| 🔴 destructive | Potentially destructive | delete, remove, drop, truncate, purge |
| 🔴 dangerous | Arbitrary code/command execution | execute, run, eval, shell, command |
Examples
Basic Scan
Generate Configuration
Scan with Environment Variables
JSON Output for Scripting
Generated Policy Example
When using--generate-config, the scanner produces a complete tollgate.yaml:
Smart Analyzer Detection
The scanner automatically detects when smart analyzers can be used:| Tool Pattern | Recommended Analyzer |
|---|---|
| SQL, query, database | sql analyzer |
| file, path, directory | filesystem analyzer |
| shell, command, exec | shell analyzer |
| http, fetch, url | http analyzer |
smart instead of prompt, allowing for intelligent content-based decisions.
Use Cases
Pre-Deployment Security Audit
Before adding a new MCP server to your configuration:Generate Starter Configuration
Bootstrap a new project with recommended policies:CI/CD Security Gate
Add to your pipeline to ensure servers meet security requirements:Best Practices
- Always scan before deploying - Run scan on new MCP servers before adding to production
- Review generated configs - The scanner provides recommendations; always review before use
- Update periodically - Re-scan servers after updates to catch new tools
- Use JSON output for automation - The JSON format is stable for scripting