mcp-api-pentest

v0.3.4
mcp-api-pentest Checked 1 day ago Published 3 months ago

MCP server for autonomous API logic penetration testing — OWASP API Top 10 / BOLA-IDOR detection via LLM-driven analysis

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

parse_api_spec Parse Api Spec

Reads a local OpenAPI/Swagger file (JSON or YAML), auto-detects format, and selectively extracts routes and methods. Strips verbose descriptions to save up to 70% of LLM tokens.

ParameterTypeDescription
spec_path *string

execute_security_request Execute Security Request

Async resilient HTTP client with anti-blocking (WAF) protection and rate limiting. Supports multiple auth types: bearer, basic, api_key_header, api_key_query, cookie. When stealth mode is enabled, uses random delay between STEALTH_MIN and STEALTH_MAX to evade WAF detection patterns.

ParameterTypeDescription
method *string
url *string
auth_credentials
auth_key_name
auth_token
auth_typestring
body_json
delay_secondsnumber
stealthboolean

analyze_access_control Analyze Access Control

Executes the same HTTP request with two different tokens (privileged vs unprivileged) and compares responses to detect authorization failures (BOLA/IDOR). Automatically cleans volatile fields (timestamps, session_ids, etc.) and calculates structural similarity. Marks as 'is_suspicious_success' if both return 200 OK with >85% similarity. When stealth mode is enabled, uses random delay to evade WAF detection patterns. Supports multiple auth types: bearer, basic, api_key_header, api_key_query, cookie.

ParameterTypeDescription
privileged_token *string
unprivileged_token *string
url *string
auth_key_name
auth_typestring
body_json
delay_secondsnumber
methodstring
stealthboolean

capture_context Capture Context

Stores a dynamic value in the session cache. Use after POST/PUT responses to save resource IDs for later use in DELETE/GET requests with a different auth token.

ParameterTypeDescription
key *string
value *string

get_context Get Context

Retrieves a previously stored value from the session cache. Returns not_found if the key does not exist. Use to inject dynamic IDs into attack URLs.

ParameterTypeDescription
key *string

list_context List Context

Returns all key-value pairs stored in the session cache. Useful for the LLM to see what dynamic IDs are available for chained attack flows.

clear_context Clear Context

Clears all stored values from the session cache. Use at the start of a new audit cycle to avoid stale data contamination.

extract_json_value Extract Json Value

Extracts a specific value from a JSON response using dot-notation path. Essential for chained attacks where the LLM needs to grab a dynamically created resource ID from a POST response (e.g. 'data.id' → 42).

ParameterTypeDescription
json_path *string
response_json *string

save_security_finding Save Security Finding

ParameterTypeDescription
affected_url *string
description *string
severity *string
title *string
evidence_request
evidence_response
remediation

generate_report Generate Report

export_report_json Export Report Json