Pentest Mcp Server

io.github.cyanheads由 GitHub 帳號 cyanheads 發布v0.3.0更新於 Oct 30, 2026

Offline methodology engine for authorized penetration testing, CTF, and security research.

已驗證Streamable HTTP可網頁執行知識與記憶安全與監控

概覽

AI 產生的概覽

離線滲透測試方法論引擎,讓助理查詢 ATT&CK、取得 OWASP 測試手冊、分析 HTTP 回應並產生酬載範本。

可以做什麼
  • 依攻擊向量取得分階段的測試手冊,每項技術都附偵測與緩解說明
  • 依 ID 或關鍵字查詢 MITRE ATT&CK 技術、威脅組織與軟體項目
  • 依技術堆疊、服務、驗證類型與作業系統等目標輪廓,排序 ATT&CK 技術與 OWASP 測試案例
  • 分析原始 HTTP 回應標頭與內容,找出資訊外洩、指紋特徵與設定錯誤
  • 依漏洞類別與注入情境產生附註解的酬載範本,可選擇附上 WAF 繞過說明
  • 對酬載字串依序套用編碼鏈,並提供解碼路徑追蹤
適用情境
適用於取得授權的滲透測試、CTF、安全研究與教學;也適合防禦方與開發者,在了解攻擊技術的同時取得偵測與緩解資訊。想在沒有即時掃描的情況下取得結構化方法論與 ATT&CK 資料時使用。
執行需求
可作為遠端託管端點使用,也可透過 npx(Node.js)或 Bun 在本機執行;Docker 或原始碼建置需先匯入 ATT&CK 資料。不需要 API 金鑰或憑證。選用環境變數可設定傳輸方式、HTTP 連接埠、驗證模式、日誌等級,以及是否開放酬載工具。
安裝前請注意
輸出屬於攻擊性安全內容,包含酬載範本、編碼鏈與 WAF 繞過說明。伺服器聲明無法代為確認授權,合法合規與測試範圍由使用者自行負責。可將 PENTEST_ENABLE_PAYLOAD_GENERATION 設為 false 以隱藏酬載產生與編碼工具。選用的失敗呼叫日誌可能記錄含機密的自由文字值。

安裝

在 SourceWeft 中

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

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.cyanheads%2Fpentest-mcp-server/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "pentest": {
      "type": "http",
      "url": "https://pentest.caseyjhand.com/mcp"
    }
  }
}

README

@cyanheads/pentest-mcp-server

Offline methodology engine and payload workshop for authorized penetration testing, CTF, security research, and education via MCP. STDIO or Streamable HTTP.

7 Tools

Public Hosted Server: https://pentest.caseyjhand.com/mcp


Authorized use only. This server is designed for penetration testers, red teamers, CTF players, security researchers, and students working on systems they own or have explicit written authorization to test. Users are solely responsible for ensuring their testing is lawful and appropriately scoped. Unauthorized access to computer systems is illegal — this server does not and cannot enforce authorization on your behalf.

Dual-audience design. Every offensive technique is paired with detection indicators and mitigations. Blue teamers, developers, and anyone building detection coverage will find the methodology and ATT&CK data as useful as the red team workflows.


Overview

An offline methodology engine for authorized penetration testing, CTFs, and security research, built on MITRE ATT&CK, the OWASP Testing Guide, and annotated payload templates. Generate a phased test plan, map techniques to a target, analyze HTTP responses for leaks, and generate or encode payloads, each paired with detection and mitigation context.

Tools

ToolDescription
pentest_get_guideStep-by-step authorized-testing methodology playbook for a chosen attack vector, phase-filterable, with detection and mitigation per technique.
pentest_analyze_responseAnalyzes raw HTTP response headers/body from authorized probing for leakage, fingerprinting, and misconfiguration.
pentest_lookup_techniqueLooks up a MITRE ATT&CK technique by ID or keyword, with detection data, mitigations, and procedure examples.
pentest_lookup_groupLooks up a MITRE ATT&CK threat group or software entry by ID or name, with aliases and technique usage.
pentest_map_techniquesRanks ATT&CK techniques and OWASP test cases against a target profile (stack, services, auth type, OS).
pentest_generate_payloadsGenerates annotated payload templates for a vulnerability category and injection context, with optional WAF bypass variants and encoding.
pentest_encode_payloadApplies an ordered encoding chain to a payload string with decode-path tracing.

Capability reference

pentest_get_guide tool

  • vector: auth_bypass, idor, ssrf, xss, sqli, xxe, path_traversal, cors, csrf, open_redirect, deserialization, race_condition, ssti, command_injection, or jwt_attack; phase: all (default), recon, enumeration, exploitation, or post_exploitation
  • Playbook techniques carry detection and mitigation, with owasp_references, attack_technique_ids, and context-derived nextToolSuggestions
  • Optional target_context (stack, waf, recon_notes) narrows the playbook

pentest_analyze_response tool

  • Supply response_headers (≤20,000 characters), response_body (≤10,000 characters), or both; optional status_code (100–599) and context (≤2,000 characters). Missing both response fields returns no_input
  • Findings carry category, severity (info/low/medium/high), detection, and remediation, ordered by severity descending
  • fingerprints (server_software, framework, language, database, cloud_provider, other) and nextToolSuggestions support follow-up calls

pentest_lookup_technique tool

  • Supply an ATT&CK ID (T1190, T1059.001) or keyword; include_subtechniques defaults to true
  • Returns tactics, platforms, description, detection (summary, data_sources, indicators), mitigations, procedure examples, and attack_version
  • Returns no_match when the ID or keyword resolves to nothing

pentest_lookup_group tool

  • Supply an ATT&CK group ID (G0007), software ID (S0002), or name/keyword; returns no_match when nothing resolves
  • type distinguishes group from software; results include aliases, description (≤800 characters), and attack_version
  • techniques_used returns up to 20 techniques with procedure context and technique_id for pentest_lookup_technique

pentest_map_techniques tool

  • Supply at least one of stack, services, auth_type (jwt/session_cookie/api_key/oauth2/basic_auth/ntlm/kerberos/none/unknown), or os (linux/windows/macos/unknown); otherwise returns no_profile
  • ranked_techniques carries relevance_score, relevance_rationale, detection_opportunity, mitigation_summary, and optional pentest_guide_vector; owasp_test_cases returns up to 10 cases
  • limit caps techniques at 1–50 (default 15); enrichment (truncated, shown, cap) discloses the cap

pentest_generate_payloads tool

  • category: xss, sqli, ssrf, xxe, path_traversal, ssti, command_injection, open_redirect, csrf, deserialization, jwt, ldap_injection, nosql_injection, or http_header; injection_context: html_attribute, html_body, js_string, js_template, js_script_block, url_parameter, url_path, sql_where, sql_integer, xml_element, xml_attribute, http_header, json_value, cookie_value, file_name, or generic
  • count caps templates at 1–20 (default 5); each carries detection_signature and mitigation, with optional encoding applied to every template
  • waf_profile: cloudflare, aws_waf, modsecurity_crs, imperva, akamai, f5_bigip_asm, nginx_modsecurity, fortinet_fortiwaf, none (default), or unknown; profiles other than none add waf_bypass_note

pentest_encode_payload tool

  • payload accepts up to 10,000 characters; chain applies 1–6 steps left to right from url, double_url, html_entity, unicode, hex, base64, js_escape, null_byte, mixed_case, or comment_break
  • Returns intermediate_steps and detection_note; explain (default true) adds decode_path and bypass_rationale
  • Returns encoding_error when a transform fails

Features

Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.

Methodology-specific:

  • Fully offline at runtime — no external API calls, no credentials required; all data loaded at startup, zero I/O during request handling
  • MITRE ATT&CK Enterprise embedded at build time via scripts/refresh-attack.ts and indexed in memory by ID/keyword; fails fast with an actionable error if the data file is missing
  • OWASP Testing Guide methodology and payload template library curated as structured TypeScript modules, one per vector/category
  • WAF bypass variants keyed by WAF product and attack vector, referencing public research
  • All tools annotated readOnlyHint: true, openWorldHint: false — deterministic output from a bounded embedded dataset

Agent-friendly output:

  • authorized_use_reminder rendered as the first line of content[] on every guide/payload/encoding response — consistent framing regardless of which surface a client forwards
  • Techniques and payloads require detection and mitigation context; response findings require detection and remediation
  • attack_version echoed on every ATT&CK-backed response so callers can reason about data vintage
  • nextToolSuggestions pre-filled with arguments derived from the current context, reducing agent planning overhead
  • pentest-guide supports response-evidence review and ATT&CK detection coverage assessment; available through plugin installs and the MCP resource skill://pentest-guide/SKILL.md

Build-time data step

The server embeds MITRE ATT&CK Enterprise data (~20 MB JSON) fetched by a one-time script into a gitignored path. Self-hosters and Docker builders must run this step before the server will start:

sh
bun run scripts/refresh-attack.ts

This downloads the latest ATT&CK Enterprise JSON from the MITRE GitHub release endpoint, writes it to src/data/attack/enterprise.json (gitignored), and updates src/data/attack/version.ts with a version string such as Enterprise v16.1. The version file is committed; the JSON is not (too large for git history).

The Dockerfile handles this automatically — the build stage runs scripts/refresh-attack.ts before the TypeScript compile, so docker build produces a self-contained image.

If you clone the repo and skip this step, attack-service will fail fast at startup with an actionable error message pointing to scripts/refresh-attack.ts.

Run the script quarterly (or before each release) to pull the latest ATT&CK version.


Getting started

Connect to the hosted instance:

sh
claude mcp add --transport http pentest-mcp-server https://pentest.caseyjhand.com/mcp

Or run it locally:

sh
claude mcp add pentest-mcp-server -- npx -y @cyanheads/pentest-mcp-server

For other clients, add this to the MCP config file:

json
{  "mcpServers": {    "pentest-mcp-server": {      "command": "npx",      "args": ["-y", "@cyanheads/pentest-mcp-server"]    }  }}

No API keys required. For Docker or a source build, see Running the server.


Configuration

No API keys required. The server is fully offline at runtime.

VariableDescriptionDefault
MCP_TRANSPORT_TYPETransport: stdio or http.stdio
MCP_HTTP_PORTPort for HTTP server.3010
MCP_AUTH_MODEAuth mode: none, jwt, or oauth.none
MCP_LOG_LEVELLog level: debug, info, notice, warning, error.info
PENTEST_ENABLE_PAYLOAD_GENERATIONEnable pentest_generate_payloads and pentest_encode_payload; when false they are hidden from clients.true
LOGS_DIRDirectory for log files (Node.js only).<project-root>/logs
OTEL_ENABLEDEnable OpenTelemetry instrumentation (spans, metrics, completion logs).false
LOG_TOOL_FAILURE_PAYLOADSLog failed-call arguments and results (key names redacted; free-form values can still contain secrets).false
OTEL_EXPORTER_OTLP_LOGS_ENDPOINTOTLP log export destination.—

See .env.example for the full list of optional overrides.

With PENTEST_ENABLE_PAYLOAD_GENERATION=false, the two payload tools are absent from MCP discovery and calls.


Running the server

Local development

Requires Bun v1.4.0 or higher (or Node.js v24+), with ATT&CK data seeded before startup.

sh
git clone https://github.com/cyanheads/pentest-mcp-server.gitcd pentest-mcp-server && bun installcp .env.example .env
  • Build and run:

    sh
    # Seed ATT&CK data (first time, or to update)bun run scripts/refresh-attack.ts
    # Buildbun run rebuild
    # Runbun run start:stdio# orbun run start:http
  • Run checks and tests:

    sh
    bun run devcheck   # Lint, format, typecheck, security auditbun run test       # Vitest test suitebun run lint:mcp   # Validate MCP definitions

Docker

sh
# Build — ATT&CK data is fetched during the build stagedocker build -t pentest-mcp-server .docker run --rm -p 3010:3010 pentest-mcp-server

The Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/pentest-mcp-server. OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them. The ATT&CK data refresh runs automatically in the build stage.


Project structure

Directory / FilePurpose
src/index.tscreateApp() entry point — registers tools and initializes services.
skills/pentest-guide/Published response-evidence and ATT&CK coverage guide, also served as an MCP resource.
src/services/attack/MITRE ATT&CK service — loads and indexes the embedded enterprise JSON at startup.
src/services/methodology/OWASP Testing Guide methodology service — vector branches for pentest_get_guide.
src/services/payload/Payload template service — keyed by category and injection context.
src/services/encoding/Encoding chain executor — pure TypeScript transforms.
src/services/response-analysis/Pattern library for information leakage and fingerprinting detection.
src/mcp-server/tools/definitions/Tool definitions (*.tool.ts) — one file per tool.
src/data/attack/enterprise.json (gitignored, fetched by scripts/refresh-attack.ts) + committed version.ts.
src/data/owasp/Curated OWASP TG v4.2 methodology content as TypeScript modules.
src/data/payloads/Annotated payload templates by vulnerability category.
src/data/waf-bypass/WAF bypass variants keyed by product and attack vector.
src/data/encodings/Encoding transform functions.
src/data/patterns/Regex patterns and metadata for response leakage detection.
scripts/refresh-attack.tsDownloads ATT&CK Enterprise JSON and updates the version string. Run once after cloning, then quarterly.
scripts/copy-attack.tsCopies the seeded ATT&CK dataset into dist/ after compilation.
tests/Unit and integration tests mirroring src/.
docs/design.mdDesign document — tool surface, data strategy, and architectural decisions.

Development guide

See CLAUDE.md for development guidelines and architectural rules. The short version:

  • Handlers throw and the framework catches; catch only to translate an owned operational failure into a declared ctx.fail contract
  • Use ctx.log for request-scoped logging and keep request handling stateless and deterministic
  • Register new tools via the barrel in src/mcp-server/tools/index.ts
  • External source boundary: validate raw data, normalize to a domain type, then return the output schema; never fabricate missing fields
  • authorized_use_reminder is a required output field on every tool that produces methodology or payload content — render it as the first line of every content[] response in format()
  • Keep detection and mitigation context required on techniques and payloads, and detection and remediation required on response findings

Contributing

Issues are welcome. Run checks and tests before submitting:

sh
bun run devcheckbun run test

License

Apache-2.0 — see LICENSE for details.

來源:README.md,提交 0015795

工具

7

pentest_get_guide

Pentest Guide

Return an authorized-testing methodology for a selected vector and optional target context. The playbook covers reconnaissance, enumeration, exploitation, and post-exploitation phases with objectives, techniques, detection signals, mitigations, common pitfalls, references, and context-derived tool suggestions across 15 vectors.

輸入參數phasevector必填target_context

pentest_analyze_response

Pentest Analyze Response

Analyze an HTTP response from authorized probing for information leakage, fingerprinting signals, and related exposure. Structured findings cover version disclosures, stack traces, debug headers, internal paths, authentication patterns, CORS configuration, detection signals, remediation, and associated methodology vectors.

輸入參數contextstatus_coderesponse_bodyresponse_headers

pentest_lookup_technique

Pentest Lookup Technique

Look up a MITRE ATT&CK technique by exact ID or keyword. Results include tactics, platforms, description, detection data, public procedure examples, mitigations, related sub-techniques, and dataset version.

輸入參數query必填include_subtechniques

pentest_lookup_group

Pentest Lookup Group

Look up a MITRE ATT&CK threat group or software entry by ID, name, or keyword. Results include ATT&CK identity, aliases, type, description, and associated techniques with procedure-level context from public ATT&CK reporting.

輸入參數query必填

pentest_map_techniques

Pentest Map Techniques

Rank ATT&CK techniques and OWASP test cases against an authorized target profile of technology stack, exposed services, authentication type, and operating system. Results include profile-specific relevance, detection opportunities, mitigations, and associated methodology vectors.

輸入參數oslimitstackservicesauth_type

pentest_generate_payloads

Pentest Generate Payloads

Generate context-specific payload templates for authorized systems. Each template includes its vulnerability category, context rationale, WAF/IDS detection signature, mitigation, optional WAF research note, and optional encoded variant.

輸入參數countcategory必填encodingwaf_profileinjection_context必填

pentest_encode_payload

Pentest Encode

Transform a payload string through an ordered encoding chain for authorized filter research. Results include the final value, intermediate values, optional decode path and rationale, and detection guidance. All transforms are local; no live probing occurs.

輸入參數chain必填explainpayload必填

版本歷史

5
  1. v0.3.0最新Oct 30, 2026
  2. v0.2.0Oct 15, 2026
  3. v0.1.10Oct 9, 2026
  4. v0.1.9Sep 21, 2026
  5. v0.1.8Sep 16, 2026

評分

已滿足適用檢查項的 100%

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

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分