Use StackHawk to test for and FIX security problems in your code or vibe coded app.
Current Version: 1.0.3 Requires Python 3.10 or higher
A Model Context Protocol (MCP) server for integrating with StackHawk's security scanning platform. Provides security analytics, YAML configuration management, sensitive data/threat surface analysis, and anti-hallucination tools for LLMs.
User-Agent
header> pip install stackhawk-mcp
# Requires Python 3.10 or higher
Or Install via pip in a virtual env:
> python3 -m venv ~/.virtualenvs/mcp
> source ~/.virtualenvs/mcp/bin/activate
> (mcp) pip install stackhawk-mcp
# Requires Python 3.10 or higher
Or Install via pip using pyenv:
> pyenv shell 3.10.11
> pip install stackhawk-mcp
# Requires Python 3.10 or higher
Or Install locally from this repo:
> pip install --user .
# Run this command from the root of the cloned repository
> export STACKHAWK_API_KEY="your-api-key-here"
python -m stackhawk_mcp.server
python -m stackhawk_mcp.http_server
pytest
StackHawk MCP can be used as a tool provider for AI coding assistants and LLM-powered developer environments, enabling security analytics, YAML validation, and anti-hallucination features directly in your workflow.
stackhawk-mcp
in your python environment.Cursor Settings->Tools & Integrations->MCP Tools
~/.virtualenvs/mcp
:
{
"mcpServers": {
"stackhawk": {
"command": "/home/bobby/.virtualenvs/mcp/bin/python",
"args": ["-m", "stackhawk_mcp.server"],
"env": {
"STACKHAWK_API_KEY": "${env:STACKHAWK_API_KEY}"
},
"disabled": false
}
}
}
{
"mcpServers": {
"stackhawk": {
"command": "/home/bobby/.pyenv/versions/3.10.11/bin/python3",
"args": ["-m", "stackhawk_mcp.server"],
"env": {
"STACKHAWK_API_KEY": "${env:STACKHAWK_API_KEY}"
},
"disabled": false
}
}
}
{
"mcpServers": {
"stackhawk": {
"command": "python3",
"args": ["-m", "stackhawk_mcp.server"],
"env": {
"STACKHAWK_API_KEY": "${env:STACKHAWK_API_KEY}"
}
}
}
}
Validate this StackHawk YAML config for errors.
{
"method": "tools/call",
"params": {
"name": "validate_stackhawk_config",
"arguments": {"yaml_content": "..."}
}
}
User-Agent
header:
User-Agent: StackHawk-MCP/{version}
stackhawk_mcp/server.py
as STACKHAWK_MCP_VERSION
.STACKHAWK_API_KEY
environment variable.# Get organization info
org_info = await server._get_organization_info(org_id="your-org-id")
# Validate a YAML config
result = await server._validate_stackhawk_config(yaml_content="...")
# Get application vulnerabilities
vulns = await server._get_application_vulnerabilities(app_id="your-app-id")
suggest_configuration
for YAML recommendationsvalidate_stackhawk_config
Official Schema URL: https://download.stackhawk.com/hawk/jsonschema/hawkconfig.json
pytest
pytest tests/test_sensitive_data.py
pytest tests/test_repository_analysis.py
black stackhawk_mcp/
mypy stackhawk_mcp/
app:
applicationId: "12345678-1234-1234-1234-123456789012"
env: "dev"
host: "http://localhost:3000"
name: "Development App"
description: "Local development environment"
app:
applicationId: "87654321-4321-4321-4321-210987654321"
env: "prod"
host: "https://myapp.com"
name: "Production App"
description: "Production environment"
authentication:
type: "form"
username: "your-username"
password: "your-password"
loginUrl: "https://myapp.com/login"
usernameField: "username"
passwordField: "password"
hawk:
spider:
base: true
ajax: false
maxDurationMinutes: 30
scan:
maxDurationMinutes: 60
threads: 10
startupTimeoutMinutes: 5
failureThreshold: "high"
tags:
- name: "environment"
value: "production"
- name: "application"
value: "myapp"
Contributions are welcome! Please open issues or pull requests for bug fixes, new features, or documentation improvements.
Apache License 2.0. See LICENSE for details.
Version bumps are managed via the "Prepare Release" GitHub Actions workflow. When triggering this workflow, you can select whether to bump the minor or major version. The workflow will automatically update version files, commit, and push the changes to main.
Note: The workflow is protected against infinite loops caused by automated version bump commits.
All CI/CD git operations use a GitHub App token for authentication.
The git user and email are set from the repository secrets HAWKY_APP_USER
and HAWKY_APP_USER_EMAIL
.
Workflows are designed to skip jobs if the latest commit is an automated version bump, preventing workflow loops.