Sponsor MCPSafe10 founding slots
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.

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

1

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.

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

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.

5

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

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

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.