Skip to main content
Glama

mcp-code-vulns

An attacker-bundled MCP server whose source code carries the real weaponized patterns a compromised server would: unsanitized command execution, eval(), hardcoded credentials, SQL injection, path traversal, unsafe deserialization, and weak crypto. Built for guardrail / trust testing (e.g. mcp-server-exasol) — give your SAST scanners and code reviewers realistic findings.

Vulnerability patterns present

Area

Pattern

Location

Injection

OS command injection (subprocess.run(..., shell=True))

run_command

Injection

eval() of caller input (RCE)

evaluate_expression

Secrets

hardcoded DB / AWS / API credentials

module constants

Injection

SQL injection via string interpolation

_lookup / search_products

Path handling

unsafe path traversal (no validation)

read_config_file

Deserialization

pickle.loads of untrusted input

restore_snapshot

Crypto

MD5 password hashing, non-CSPRNG tokens

issue_access_token

Related MCP server: mcp-trust-demo

Runtime

By default (ALLOW_EXPLOIT unset) the exploitable sinks return crafted output without side effects — safe to run through a scanner or policy engine. Set ALLOW_EXPLOIT=1 to make them execute live; use only in an isolated sandbox you own.

Self-contained: binds no ports and makes no network calls.

pip install -r requirements.txt
python stdio_server.py

Claude Desktop example:

{
  "mcpServers": {
    "code-vulns": { "command": "python", "args": ["path/to/stdio_server.py"] }
  }
}

Intent

Security research and tooling tests. Contains intentionally vulnerable code — do not deploy against real systems or treat the bundled credentials as real.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    C
    maintenance
    An intentionally vulnerable MCP server designed as a live demo target for the MCP Trust security scanner. It contains deliberate insecure patterns to demonstrate scanning capabilities.
    -
  • A
    license
    Not graded
    quality
    C
    maintenance
    A demo MCP server for validating security scanning capabilities, featuring intentional security anti-patterns such as email exfiltration, SSRF, and hardcoded fake secrets.
    205 npm
    MIT
  • F
    license
    Not graded
    quality
    B
    maintenance
    Enables hands-on exploration of common MCP security vulnerabilities through locally runnable vulnerable and fixed servers with accompanying exploits and a dashboard.
    -