Skip to main content
Glama
Security-Use MCP Server

Security-Use MCP Server

by security-use

Security-Use MCP Server

An MCP (Model Context Protocol) server that gives AI assistants like Cursor, Claude, and other MCP-compatible tools the ability to scan for security vulnerabilities and automatically fix them.

What It Does

This MCP server exposes powerful security tools to your AI assistant:

Core Security Tools

Tool

Description

scan_dependencies

Scans your project's dependencies for known vulnerabilities using the OSV database

scan_iac

Scans Infrastructure as Code files for security misconfigurations

fix_vulnerability

Automatically updates vulnerable packages to secure versions

fix_iac

Generates and applies fixes for IaC security issues

SBOM & Compliance Tools

Tool

Description

generate_sbom

Generate Software Bill of Materials in CycloneDX or SPDX format

check_compliance

Check against SOC2, HIPAA, PCI-DSS, NIST 800-53, CIS, and ISO 27001

Runtime Security Tools

Tool

Description

detect_vulnerable_endpoints

Find API endpoints using vulnerable packages

analyze_request

Analyze HTTP requests for SQL injection, XSS, and other attacks

get_sensor_config

Generate SecurityMiddleware configuration for FastAPI/Flask

GitHub Integration

Tool

Description

create_fix_pr

Create a GitHub PR with security fixes

Related MCP server: Cybrium MCP Server

Supported Formats

Dependency Scanning

  • Python: requirements.txt, pyproject.toml, Pipfile, Pipfile.lock, poetry.lock, setup.py

  • JavaScript/Node.js: package.json, package-lock.json, yarn.lock

  • Java: pom.xml, build.gradle

  • .NET: csproj, packages.config

  • PHP: composer.json, composer.lock

  • Conda: environment.yml

Infrastructure as Code

  • Terraform (.tf files)

  • AWS CloudFormation (.yaml, .yml, .json)

  • AWS SAM templates

  • AWS CDK synthesized output

IaC Security Rules

The scanner checks for misconfigurations across multiple cloud providers:

AWS

  • S3 buckets with public access or missing encryption

  • Security groups with unrestricted ingress

  • RDS/EBS without encryption

  • CloudTrail not enabled

  • IAM users without MFA

Azure

  • Storage accounts with public access

  • Network security group issues

  • Key Vault misconfigurations

GCP

  • Cloud Storage bucket permissions

  • Firewall rules

  • KMS configurations

Kubernetes

  • Container security contexts

  • Network policies

  • RBAC configurations

Compliance Frameworks

  • SOC 2 Type II controls

  • HIPAA Security Rule

  • PCI-DSS v4.0

  • NIST 800-53

  • CIS Benchmarks (AWS, Azure, GCP, Kubernetes)

  • ISO 27001

Installation

From PyPI

pip install security-use-mcp

From Source

git clone https://github.com/security-use/mcp.git
cd mcp
pip install -e .

Quick Setup for Cursor

  1. Install the package (see above)

  2. Add to Cursor's MCP configuration (~/.cursor/mcp.json):

{
  "mcpServers": {
    "security-use": {
      "command": "security-use-mcp",
      "args": [],
      "env": {}
    }
  }
}

If you installed from source or use a virtual environment:

{
  "mcpServers": {
    "security-use": {
      "command": "python",
      "args": ["-m", "security_use_mcp.server"],
      "env": {}
    }
  }
}
  1. Restart Cursor

  2. Test it - Open Cursor's AI chat and ask:

    "Scan this project for security vulnerabilities"

Usage Examples

Once configured, you can ask your AI assistant things like:

Dependency Scanning

  • "Scan this project for vulnerable dependencies"

  • "Check if my Python packages have any CVEs"

  • "Are there any security issues in my requirements.txt?"

IaC Scanning

  • "Scan my Terraform files for security issues"

  • "Check this CloudFormation template for misconfigurations"

  • "Are my S3 buckets configured securely?"

Fixing Vulnerabilities

  • "Fix the requests vulnerability"

  • "Update django to a secure version"

  • "Fix the S3 bucket public access issue in main.tf"

Compliance Checking

  • "Check this project against SOC2 requirements"

  • "Are we compliant with HIPAA security controls?"

  • "Run a PCI-DSS compliance check on our infrastructure"

SBOM Generation

  • "Generate an SBOM for this project"

  • "Create a CycloneDX bill of materials"

  • "Generate an SPDX software inventory"

Runtime Security

  • "Find vulnerable endpoints in this Flask app"

  • "Analyze this request for SQL injection: GET /api/users?id=1' OR '1'='1"

  • "Generate security middleware config for my FastAPI app"

GitHub Integration

  • "Create a PR with these security fixes"

  • "Open a draft PR for the vulnerability fix"

Example Output

Dependency Scan Results

## Dependency Security Scan Results

**Found 2 vulnerabilities**

### CRITICAL (1)

#### requests (2.25.0)
- **ID**: GHSA-xxxx-yyyy-zzzz
- **Title**: CVE-2023-32681 - Unintended leak of Proxy-Authorization header
- **Fixed in**: 2.31.0

### HIGH (1)

#### django (3.1.0)
- **ID**: CVE-2023-xxxxx
- **Title**: SQL Injection in QuerySet.values()
- **Fixed in**: 3.2.19

Compliance Check Results

## Compliance Check Results

**Framework**: SOC 2 Type II
**Files Scanned**: 15

### Summary
- **Total IaC Findings**: 8
- **Findings Mapped to SOC 2**: 6

### CC6.1: Logical and Physical Access Controls
- **CKV_AWS_23**: Security group allows unrestricted ingress
  - File: `sg.tf:8`
  - Severity: HIGH

### CC6.6: System Operations - Encryption
- **CKV_AWS_19**: S3 bucket without encryption
  - File: `s3.tf:15`
  - Severity: HIGH

Request Analysis Results

## Request Security Analysis

**Method**: GET
**Path**: /api/users
**Source IP**: 192.168.1.100

### āš ļø 1 Potential Threat(s) Detected

#### šŸ”“ SQL_INJECTION
- **Severity**: CRITICAL
- **Confidence**: 95%
- **Description**: SQL injection attempt detected in query parameter
- **Location**: query
- **Field**: id
- **Matched Value**: `1' OR '1'='1`

### Recommendations
1. Block this request if in production
2. Log the source IP for monitoring
3. Review application input validation

Configuration Options

Environment Variables

Variable

Description

Default

SECURITY_USE_LOG_LEVEL

Logging level (DEBUG, INFO, WARN, ERROR)

INFO

SECURITY_USE_CACHE_DIR

Directory for caching vulnerability data

System temp

SECURITY_USE_API_KEY

API key for dashboard alerting

None

Example configuration with environment variables:

{
  "mcpServers": {
    "security-use": {
      "command": "security-use-mcp",
      "args": [],
      "env": {
        "SECURITY_USE_LOG_LEVEL": "DEBUG",
        "SECURITY_USE_API_KEY": "your-api-key"
      }
    }
  }
}

Development

Setup

# Clone the repository
git clone https://github.com/security-use/mcp.git
cd mcp

# Create virtual environment
python -m venv .venv
source .venv/bin/activate

# Install with dev dependencies
pip install -e ".[dev]"

# Also install the core security-use package
pip install -e ../security-use

Running Tests

# Run all tests
pytest

# Run with coverage
pytest --cov=security_use_mcp

# Run specific test file
pytest tests/test_handlers.py -v

Linting

# Check code style
ruff check src/ tests/

# Auto-fix issues
ruff check src/ tests/ --fix

Testing the Server

You can test the MCP server directly:

# Start the server (it communicates via stdin/stdout)
python -m security_use_mcp.server

# Or use the entry point
security-use-mcp

Troubleshooting

Server Not Starting

  1. Check Python version (requires 3.10+):

    python --version
  2. Verify installation:

    pip show security-use-mcp
    pip show security-use
  3. Test the server directly:

    python -c "from security_use_mcp.server import server; print('OK')"

Tools Not Appearing in Cursor

  1. Restart Cursor after changing mcp.json

  2. Check that the JSON is valid

  3. Look for errors in Cursor's Developer Tools (Help > Toggle Developer Tools)

Scan Returns No Results

  1. Make sure you have dependency files (requirements.txt, package.json, etc.) or IaC files (.tf, .yaml) in your project

  2. Check that the path is correct when scanning specific directories

Architecture

security-use-mcp/
ā”œā”€ā”€ src/security_use_mcp/
│   ā”œā”€ā”€ server.py          # MCP server implementation
│   ā”œā”€ā”€ models.py          # Data models for results
│   └── handlers/          # Tool handlers
│       ā”œā”€ā”€ dependency_handler.py  # Dependency scanning/fixing
│       ā”œā”€ā”€ iac_handler.py         # IaC scanning/fixing
│       ā”œā”€ā”€ github_handler.py      # GitHub PR creation
│       ā”œā”€ā”€ sbom_handler.py        # SBOM generation
│       ā”œā”€ā”€ compliance_handler.py  # Compliance checking
│       └── sensor_handler.py      # Runtime security tools
└── tests/
    ā”œā”€ā”€ test_server.py         # Server tests
    ā”œā”€ā”€ test_handlers.py       # Handler unit tests
    ā”œā”€ā”€ test_new_handlers.py   # New handler tests
    └── test_integration.py    # Integration tests

The MCP server wraps the security-use Python package, which provides:

  • Dependency scanning via the OSV (Open Source Vulnerabilities) database

  • IaC scanning with configurable security rules for AWS, Azure, GCP, and Kubernetes

  • SBOM generation in CycloneDX and SPDX formats

  • Compliance framework mapping (SOC2, HIPAA, PCI-DSS, NIST, CIS, ISO 27001)

  • Runtime attack detection (SQL injection, XSS, path traversal, command injection)

  • Automated fixing capabilities

License

MIT

Available Tools

18 tools
acknowledge_alertA

Mark a security alert as reviewed/acknowledged. Removes the alert from active alerts list.

Inputs: alert_id (required), notes.

analyze_requestC

Analyze an HTTP request for potential attacks. Detects SQL injection, XSS, path traversal, command injection, and other attack patterns.

Inputs: method (required), path (required), query_params, headers, +2 more.

block_ipB

Block a source IP address. Adds the IP to the sensor's block list for the specified duration.

Inputs: ip_address (required), duration.

check_complianceC

Check project against a compliance framework. Scans IaC files and maps findings to compliance controls. Supports SOC2, HIPAA, PCI-DSS, NIST 800-53, CIS, and ISO 27001.

Inputs: framework (required), path.

configure_sensorC

Update runtime sensor configuration. Modify detection sensitivity, patterns, and rate limits.

Inputs: sensitivity, patterns, rate_limits.

create_fix_prA

Create a GitHub Pull Request with security fixes. Commits pending changes, pushes to a new branch, and opens a PR. Use after applying fixes with fix_vulnerability or fix_iac.

Inputs: repo, vulnerability_id, iac_finding_id, branch_name, +1 more.

detect_projectA

Detect project framework and configuration without making changes. Analyzes a project to identify web framework, dependency files, IaC files, and existing security configuration. Useful for understanding a project before initializing.

Inputs: path.

detect_vulnerable_endpointsC

Detect vulnerable API endpoints in a project. Analyzes code to find endpoints using vulnerable packages or high-risk code patterns.

Inputs: path, min_risk_score.

fix_iacA

Fix an Infrastructure as Code security misconfiguration. Can either suggest a fix (default) or apply it automatically. Returns before/after code for review.

Inputs: file_path (required), rule_id (required), line_number, auto_apply.

fix_vulnerabilityA

Fix a detected dependency vulnerability by updating to a safe version. Modifies requirements.txt or pyproject.toml with the patched version. Returns a diff of changes for review.

Inputs: package_name (required), target_version, path.

generate_sbomC

Generate a Software Bill of Materials (SBOM) for the project. Supports CycloneDX and SPDX formats.

Inputs: path, format.

get_alert_detailsB

Get full details of a specific security alert. Returns attack payload, source IP, and matched patterns.

Inputs: alert_id (required).

get_blocked_ipsA

List all currently blocked IP addresses. Shows IP, duration, and expiration time.

Inputs: no named parameters.

get_security_alertsC

Retrieve recent security alerts from the runtime sensor. Returns alerts with severity, attack type, and source information.

Inputs: time_range, severity, attack_type.

get_sensor_configC

Generate sensor configuration for framework integration. Creates code snippets for adding SecurityMiddleware to FastAPI or Flask applications.

Inputs: framework, block_on_detection, watch_paths, api_key.

init_projectA

Initialize security-use for a project with zero configuration. Auto-detects the framework (FastAPI, Flask, Django) and sets up runtime middleware, pre-commit hooks, and configuration files. The easiest way to add security scanning to any Python project.

Inputs: path, inject_middleware, setup_precommit, dry_run.

scan_dependenciesB

Scan the project for dependency vulnerabilities. Analyzes requirements.txt, pyproject.toml, and other dependency files to find known security vulnerabilities (CVEs) in installed packages.

Inputs: path.

scan_iacA

Scan Infrastructure as Code files for security misconfigurations. Supports Terraform (.tf), CloudFormation (.yaml/.json), and other IaC formats. Detects issues like open S3 buckets, overly permissive IAM, missing encryption.

Inputs: path.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 18 tools

    Disambiguation4/5

    Most tools have distinct purposes, such as acknowledge_alert for alert management, analyze_request for attack detection, and fix_vulnerability for dependency fixes. However, some overlap exists between detect_project and detect_vulnerable_endpoints, as both involve project analysis, which could cause minor confusion for an agent.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern using snake_case, such as acknowledge_alert, analyze_request, and block_ip. This predictability makes it easy for agents to understand and select tools without naming confusion.

    Tool Count4/5

    With 18 tools, the count is slightly high but reasonable for a comprehensive security server covering alert management, vulnerability scanning, compliance, and project initialization. It supports various workflows without feeling overly bloated, though it borders on being heavy.

    Completeness5/5

    The tool set provides complete coverage for security operations, including detection (e.g., scan_dependencies, scan_iac), analysis (e.g., analyze_request, check_compliance), remediation (e.g., fix_vulnerability, create_fix_pr), and management (e.g., configure_sensor, get_security_alerts). No obvious gaps exist, enabling agents to handle end-to-end security tasks effectively.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables security scanning of codebases through integrated tools for secret detection, SCA, SAST, and DAST vulnerabilities, with AI-powered remediation suggestions based on findings.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides AI coding assistants with real-time security scanning superpowers, including SAST, secrets detection, dependency CVE scanning, and web vulnerability assessment.
      24 npm
      Apache 2.0
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI coding assistants to scan projects for security issues such as leaked API keys, missing Supabase RLS, open Firebase rules, unauthenticated routes, and hallucinated packages, then fix and verify the results.
      8
      1
      MIT