Stackhawk

com.stackhawk由 stackhawk.com 發布v1.1.1更新於 Oct 24, 2026

An MCP server that provides interaction with StackHawk's security scanning platform.

已驗證STDIO僅桌面開發者工具安全與監控

概覽

AI 產生的概覽

StackHawk MCP 讓助手在 IDE 或對話中完成 StackHawk 安全掃描設定、驗證 stackhawk.yml、執行掃描並整理漏洞發現。

可以做什麼
  • 查詢組織資訊、團隊與應用程式清單
  • 為專案設定 StackHawk:辨識語言、尋找或建立應用程式、產生 stackhawk.yml
  • 依官方 StackHawk schema 驗證 YAML 設定,並檢查欄位路徑是否存在
  • 透過 CLI 執行 StackHawk 掃描,缺少 CLI 時提供安裝提示
  • 取得達到或超過失敗門檻的漏洞發現以便處理
適用情境
適合想讓 AI 程式助理不必離開 IDE 或對話,就能為新專案導入 StackHawk、讓掃描設定符合 schema、啟動掃描並追蹤漏洞修復的情境。
執行需求
本機 Python 套件(需 Python 3.10 以上),以 pip 安裝並以模組方式執行;需要 STACKHAWK_API_KEY 環境變數中的 StackHawk API 金鑰;執行掃描需要 StackHawk CLI;需要連線至 StackHawk API 與 schema 的網路。
安裝前請注意
需要 StackHawk API 金鑰,該金鑰可存取你所屬組織的 StackHawk 資料;設定工具會在組織中建立應用程式並將 stackhawk.yml 寫入專案;掃描會對目標主機執行並消耗 StackHawk 掃描額度;產生的設定可能包含被掃描應用程式的驗證憑證。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Stackhawk,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

StackHawk MCP Server

Current Version: 1.2.5 Requires Python 3.10 or higher

A Model Context Protocol (MCP) server for integrating with StackHawk's security scanning platform. Helps developers set up StackHawk, run security scans, and triage findings to fix vulnerabilities — all from within an LLM-powered IDE or chat.


Table of Contents


Features

  • Setup: Detect your project, create a StackHawk application, and generate a ready-to-scan stackhawk.yml
  • Scan: Run StackHawk scans directly from your IDE or chat (with install help if the CLI is missing)
  • Triage: Get actionable findings at or above your failure threshold for remediation
  • Validate: Check YAML configs against the official schema and validate field paths to prevent hallucination
  • Custom User-Agent: All API calls include a versioned User-Agent header

Installation

  1. Install via pip (make sure you have write permission to your current python environment):
    bash
    > pip install stackhawk-mcp# Requires Python 3.10 or higher

Or Install via pip in a virtual env:

bash
> 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:

bash
> pyenv shell 3.10.11> pip install stackhawk-mcp# Requires Python 3.10 or higher

Or Install locally from this repo:

bash
> pip install --user .# Run this command from the root of the cloned repository
  1. Set your StackHawk API key:
    bash
    > export STACKHAWK_API_KEY="your-api-key-here"

Usage

Running the MCP Server

bash
python -m stackhawk_mcp.server

Running the HTTP Server (FastAPI)

bash
python -m stackhawk_mcp.http_server

Running Tests

bash
pytest

Integrating with LLMs and IDEs

StackHawk MCP can be used as a tool provider for AI coding assistants and LLM-powered developer environments, enabling security scanning setup, YAML validation, and vulnerability triage directly in your workflow.

Cursor (AI Coding Editor)
  • Setup:
    • Follow the installation instructions above to install stackhawk-mcp in your python environment.
    • In Cursor, go to Cursor Settings->Tools & Integrations->MCP Tools
    • Add a "New MCP Server" with the following json, depending on your setup:
      • Using a virtual env at ~/.virtualenvs/mcp:
        json
        {  "mcpServers": {    "stackhawk": {      "command": "/home/bobby/.virtualenvs/mcp/bin/python",      "args": ["-m", "stackhawk_mcp.server"],      "env": {        "STACKHAWK_API_KEY": "${env:STACKHAWK_API_KEY}"      },      "disabled": false    }  }}
      • Using pyenv:
        json
        {  "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    }  }}
      • Or use python directly:
        json
        {  "mcpServers": {    "stackhawk": {      "command": "python3",      "args": ["-m", "stackhawk_mcp.server"],      "env": {        "STACKHAWK_API_KEY": "${env:STACKHAWK_API_KEY}"      }    }  }}
      • Then make sure the "stackhawk" MCP Tool is enabled
  • Usage:
    • Use Cursor's tool invocation to call StackHawk MCP tools (e.g., vulnerability search, YAML validation).
    • Example prompt: Validate this StackHawk YAML config for errors.
OpenAI, Anthropic, and Other LLMs
  • Setup:
    • Deploy the MCP HTTP server and expose it to your LLM system (local or cloud).
    • Use the LLM's tool-calling or function-calling API to connect to the MCP endpoint.
    • Pass the required arguments (e.g., org_id, yaml_content) as specified in the tool schemas.
  • Example API Call:
    json
    {  "method": "tools/call",  "params": {    "name": "validate_stackhawk_config",    "arguments": {"yaml_content": "..."}  }}
  • Best Practices:
    • Use anti-hallucination tools to validate field names and schema compliance.
    • Always check the tool's output for warnings or suggestions.
IDEs like Windsurf
  • Setup:
    • Add StackHawk MCP as a tool provider or extension in your IDE, pointing to the local or remote MCP server endpoint.
    • Configure environment variables as needed.
  • Usage:
    • Invoke setup, scanning, validation, and triage tools directly from the IDE's command palette or tool integration panel.
General Tips
  • Ensure the MCP server is running and accessible from your LLM or IDE environment.
  • Review the Available Tools & API section for supported operations.
  • For advanced integration, see the example tool usage in this README or explore the codebase for custom workflows.

GitHub Copilot Agents

StackHawk can be added to the GitHub Coding Agent as an MCP server or as its own GitHub Custom Agent.

Add to GitHub Coding Agent

You can add StackHawk MCP to the GitHub Copilot Coding Agent. This gives the agent all the stackhawk/ tools.

StackHawk MCP installation into the Coding Agent

General instructions on GitHub

For StackHawk MCP, the MCP Configuration JSON should look something like this:

yaml
{  "mcpServers": {    "stackhawk": {      "type": "local",      "tools": [        "*"      ],      "command": "uvx",      "args": [        "stackhawk-mcp"      ],      "env": {        "STACKHAWK_API_KEY": "COPILOT_MCP_STACKHAWK_API_KEY"      }    }  }}

Then in the Repository's Settings->Environments->copilot->Environment Secrets, add COPILOT_MCP_STACKHAWK_API_KEY with your StackHawk API Key.

Installation verification instructions

StackHawk Onboarding Agent as a GitHub Copilot Custom Agent

You can the StackHawk Onboarding Agent as a custom agent at the enterprise, organization, or repository level in GitHub. When added, the StackHawk Onboarding Agent becomes a selectable option in the Copilot Agent Chat with context to help with onboarding, plus it installs stackhawk-mcp so the agent has access to all of those tools.

StackHawk Onboarding Agent installation

The general approach is to take the StackHawk Onboarding Agent defintion and apply it to either the desired repository, enterprise, or organization in GitHub.

Note that the mcp-servers block in the StackHawk Onboarding Agent definition references an environment variable called COPILOT_MCP_STACKHAWK_API_KEY. Go to the Repository's Settings->Environments->copilot->Environment Secrets, add COPILOT_MCP_STACKHAWK_API_KEY with your StackHawk API Key.


Configuration

  • All HTTP requests include a custom User-Agent header:
    User-Agent: StackHawk-MCP/{version}
  • The version is set in stackhawk_mcp/server.py as STACKHAWK_MCP_VERSION.
  • Set your API key via the STACKHAWK_API_KEY environment variable.

Available Tools

The MCP server exposes 7 tools organized around the developer workflow:

PhaseToolDescription
Discoverget_organization_infoGet org details, teams, and applications
Discoverlist_applicationsList applications in an organization
Setupsetup_stackhawk_for_projectDetect language, find/create app, generate stackhawk.yml
Validatevalidate_stackhawk_configValidate YAML against the official StackHawk schema
Validatevalidate_field_existsCheck if a field path is valid in the schema (anti-hallucination)
Scanrun_stackhawk_scanRun a StackHawk scan via the CLI (returns install help if CLI is missing)
Triageget_app_findings_for_triageGet findings at/above the configured failure threshold

Example Tool Usage

python
# Set up StackHawk for a projectresult = await server.call_tool("setup_stackhawk_for_project", {"host": "http://localhost:3000"})
# Validate a YAML configresult = await server.call_tool("validate_stackhawk_config", {"yaml_content": "..."})
# Run a scanresult = await server.call_tool("run_stackhawk_scan", {})
# Get findings to triageresult = await server.call_tool("get_app_findings_for_triage", {})

Official Schema URL: https://download.stackhawk.com/hawk/jsonschema/hawkconfig.json


Testing & Development

Running All Tests

bash
pytest

Running Individual Tests

bash
pytest tests/test_ux_improvements.pypytest tests/test_user_scenarios.py

Code Formatting

bash
black stackhawk_mcp/

Type Checking

bash
mypy stackhawk_mcp/

Example Configurations

Basic Configuration

yaml
app:  applicationId: "12345678-1234-1234-1234-123456789012"  env: "dev"  host: "http://localhost:3000"  name: "Development App"  description: "Local development environment"

Production Configuration with Authentication

yaml
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"

Contributing

Contributions are welcome! Please open issues or pull requests for bug fixes, new features, or documentation improvements.


License

Apache License 2.0. See LICENSE for details.

Release and Version Bumping

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.

GitHub Actions Authentication

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.

Workflow Protections

Workflows are designed to skip jobs if the latest commit is an automated version bump, preventing workflow loops.

How to Trigger a Release

  1. Go to the "Actions" tab on GitHub.
  2. Select the "Prepare Release" workflow.
  3. Click "Run workflow" and choose the desired bump type (minor or major).
  4. The workflow will handle the rest!

來源:README.md,提交 28755aa

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.1.1最新Sep 16, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。