How Scanning Works
MCPSafe uses static analysis to find security vulnerabilities in MCP server code without executing it. Here's how the scanner works under the hood.
AST-Based Analysis
Uses Tree-sitter to parse code into Abstract Syntax Trees, enabling precise pattern matching without executing code.
Multi-Language Support
Analyzes JavaScript, TypeScript, and Python codebases with language-specific security rules.
MCP-Specific Rules
Rules cover generic appsec plus MCP-specific risks: prompt-injection metadata, tool command execution, secret exfiltration, broad filesystem access, and SSRF.
Fast Scanning
Most scans complete in under 60 seconds, even for large codebases with thousands of files.
Scanning Process
Source-Aware Retrieval
The scanner resolves the actual viable source first: GitHub repository when present, npm package when available, or endpoint/source-unavailable classification with evidence.
Code Parsing
Tree-sitter parses the code into an AST for each supported language in the project.
Pattern Matching
Security rules are applied to the AST to detect vulnerable patterns and practices.
Internal Evidence Collection
Automated findings are stored as internal evidence by default. Public security grades/counts only publish after reviewed-promotion gates approve defensible findings.
Scores and Registry Sync
Security, quality, popularity, and freshness data are synced into public registry/list/detail views with clear separation between reviewed security data and quality metadata.
Rule Categories
Our security rules are organized into categories based on vulnerability type.
Command Injection
Detects shell command execution with user input
Code Injection
Finds eval(), Function(), and dynamic code execution
Path Traversal
Identifies file system access vulnerabilities
Network Security
SSRF, insecure URLs, and network-related issues
Hardcoded Secrets
API keys, passwords, and credentials in code
SQL Injection
Unsafe database query construction
Authentication
Weak auth patterns and missing checks
Information Disclosure
Sensitive data exposure in logs/errors
Supported Languages
Go, Rust, Java, and other ecosystems can still be tracked through source metadata, but deep static rules are strongest for JavaScript, TypeScript, and Python today.