DocsScannerOverview
Security Scanner

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.

50+ Security Rules

Comprehensive rule set covering OWASP Top 10, command injection, path traversal, SSRF, and more.

Fast Scanning

Most scans complete in under 60 seconds, even for large codebases with thousands of files.

Scanning Process

1

Source Retrieval

The scanner fetches source code from GitHub, npm, or PyPI based on the provided URL.

2

Code Parsing

Tree-sitter parses the code into an AST for each supported language in the project.

3

Pattern Matching

Security rules are applied to the AST to detect vulnerable patterns and practices.

4

Severity Classification

Each finding is assigned a severity based on CVSS scoring and potential impact.

5

Report Generation

Results are compiled into a detailed report with locations, descriptions, and remediation advice.

Rule Categories

Our security rules are organized into categories based on vulnerability type.

Command Injection

8 rules

Detects shell command execution with user input

Code Injection

6 rules

Finds eval(), Function(), and dynamic code execution

Path Traversal

5 rules

Identifies file system access vulnerabilities

Network Security

7 rules

SSRF, insecure URLs, and network-related issues

Hardcoded Secrets

10 rules

API keys, passwords, and credentials in code

SQL Injection

4 rules

Unsafe database query construction

Authentication

6 rules

Weak auth patterns and missing checks

Information Disclosure

4 rules

Sensitive data exposure in logs/errors

Supported Languages

JavaScript
TypeScript
Python

Support for additional languages (Go, Rust, Java) is planned for future releases.