{"id":32662884,"url":"https://github.com/arch3rpro/mcp-pst-server","last_synced_at":"2025-11-04T00:02:19.031Z","repository":{"id":321195626,"uuid":"1084872852","full_name":"arch3rPro/MCP-PST-Server","owner":"arch3rPro","description":"轻量级MCP Server工具，旨在让AI-Agent或AI客户端能够无缝地调用 Windows 环境中的各种渗透测试工具。A lightweight MCP server tool designed to let AI agents or clients seamlessly invoke various penetration testing tools in a Windows environment.","archived":false,"fork":false,"pushed_at":"2025-10-28T09:53:31.000Z","size":15,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-28T11:29:29.106Z","etag":null,"topics":["ai","ai-agents","mcp","mcp-server","pentest-tool","pentesting-windows"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arch3rPro.png","metadata":{"files":{"readme":"README-ZH.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-28T09:28:49.000Z","updated_at":"2025-10-28T09:59:51.000Z","dependencies_parsed_at":"2025-10-28T11:29:30.925Z","dependency_job_id":"e997c311-5a2f-40f6-a706-57ccd99dab79","html_url":"https://github.com/arch3rPro/MCP-PST-Server","commit_stats":null,"previous_names":["arch3rpro/mcp-pst-server"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/arch3rPro/MCP-PST-Server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arch3rPro%2FMCP-PST-Server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arch3rPro%2FMCP-PST-Server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arch3rPro%2FMCP-PST-Server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arch3rPro%2FMCP-PST-Server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arch3rPro","download_url":"https://codeload.github.com/arch3rPro/MCP-PST-Server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arch3rPro%2FMCP-PST-Server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":282057025,"owners_count":26606736,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-31T02:00:07.401Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","ai-agents","mcp","mcp-server","pentest-tool","pentesting-windows"],"created_at":"2025-10-31T21:00:30.619Z","updated_at":"2025-10-31T21:01:44.244Z","avatar_url":"https://github.com/arch3rPro.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eMCP-PST-Server\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cem\u003eWindows渗透测试工具MCP服务\u003c/em\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"README-ZH.md\"\u003e\u003cstrong\u003e中文文档 \u003c/strong\u003e\u003c/a\u003e | \n  \u003ca href=\"README.md\"\u003e\u003cstrong\u003eEnglish README\u003c/strong\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n**PST MCP 服务器**是一个轻量级的 API 网桥，旨在将 MCP 客户端（例如：Cherry Studio, Claude Desktop）与 API 服务器连接起来，从而在 Windows 终端上执行命令。通过这种方式，AI Agent 或 AI 客户端能够无缝地调用 Windows 环境中的各种渗透测试工具，实现 **AI 辅助渗透测试**。\n\n这使得 AI 能够运行 `nmap`、`ehole` 等终端工具，通过 `curl`、`gobuster` 等工具与 Web 应用程序交互，实时解决 **CTF Web 挑战**，并协助解决 **HTB 或 THM 机器**。\n\n## 目录结构\n\n- `pst_server.py`：Windows API 服务端（端点：`/api/tools/\u003ctool\u003e`, `/api/command`, `/health`）\n- `mcp_server.py`：MCP 客户端，封装工具为 MCP 工具并转发至 API Server\n\n---\n\n## 🔍 使用案例\n\n目标是通过以下方式实现 AI 驱动的网络安全测试：\n\n- 让 MCP 与 OpenAI、Claude、DeepSeek 或任何其他模型等 AI 端点进行交互。\n- 暴露一个 API，用于在 Windows 机器上执行命令。\n- 使用 AI 建议并运行终端命令来解决 CTF 挑战或自动化渗透测试任务。\n- 允许 MCP 应用程序发送自定义请求（例如 `curl`、`nmap`、`ehole` 等）并接收结构化输出。\n\n---\n\n## 🚀 功能\n\n- 🧠 **AI 端点集成**：将您的 Windows 机器连接到您喜欢的任何 MCP，例如 Claude Desktop 或 Cherry-Studio。\n- 🖥️ **命令执行 API**：暴露一个受控 API，用于在您的 Windows 机器上执行终端命令。\n- 🕸️ **Web 挑战支持**：AI 可以与网站和 API 交互，通过 `curl` 和 AI 所需的任何其他工具捕获标志。\n- 🔐 **专为攻击性安全专业人员设计**：非常适合红队成员、漏洞赏金猎人或 CTF 玩家自动化常见任务。\n\n---\n\n## 🛠️ 快速安装配置\n\n### PST 服务端（Pentest-Windows 机器上）\n```bash\ngit clone https://github.com/arch3rPro/MCP-PST-Server.git\ncd MCP-PST-Server\npip install -r requirements.txt\npython3 pst_server.py\n```\n\n### MCP 客户端（您可以在 Windows 或 Linux 上运行）\n- 您需要运行 `python3 /absolute/path/to/mcp_server.py http://WINDOWS_IP:5100`\n\n#### Claude Desktop 配置：\n编辑 claude_desktop_config.json\n\n```json\n{\n    \"mcpServers\": {\n        \"pst_mcp\": {\n            \"command\": \"python3\",\n            \"args\": [\n                \"/absolute/path/to/mcp_server.py\",\n                \"--server\",\n                \"http://WINDOWS_IP:5100/\"\n            ]\n        }\n    }\n}\n```\n\n#### [Cherry Studio](https://github.com/CherryHQ/cherry-studio) 配置：\n```json\n{\n    \"mcpServers\": {\n        \"PST-MCP\": {\n            \"name\": \"pst_mcp\",\n            \"type\": \"stdio\",\n            \"isActive\": true,\n            \"command\": \"python3\",\n            \"args\": [\n                \"/absolute/path/to/mcp_server.py\",\n                \"--server\",\n                \"http://localhost:5100\"\n            ]\n        }\n    }\n}\n```\n\n\n## 安装常用渗透工具（使用 Scoop 与 PST-Bucket）\n\n1. 安装 Scoop：https://scoop.sh/\n2. 添加 PST-Bucket：\n   - `scoop bucket add ar https://github.com/arch3rPro/PST-Bucket`\n3. 安装工具（示例，按需精简/扩展）：\n   - `scoop install nmap httpx ffuf feroxbuster fscan hydra hackbrowserdata`\n   - `scoop install subfinder dnsx naabu nuclei katana bbot`\n   - `scoop install masscan nikto gobuster john ehole`\n   - `scoop install metasploit`（如不可用，参考官方安装包）\n   - 可选：`pip install sqlmap`\n   - Netcat：使用 `ncat`（随 `nmap` 安装），或 `nc`（可选）\n\n\u003e 推荐：直接使用Pentest-Windows 环境镜像（含大量工具）：https://github.com/arch3rPro/Pentest-Windows\n\n## PST-API 配置选项\n\nPST API 服务器支持各种命令行选项进行配置：\n\n### 命令行选项\n\n```bash\npython pst_server.py [选项]\n```\n- `--host 主机`: 服务器主机地址（默认：0.0.0.0）\n- `--port 端口`: 服务器端口号（默认：5100）\n- `--timeout 秒数`: 命令执行超时时间，以秒为单位（默认：180）\n- `--debug`: 启用调试模式以获取详细日志\n\n### 启动 API 服务器\n\n- 进入目录：`/absolute/path/to/MCP-PST-Server`\n- 使用默认设置启动：\n  - `python pst_server.py`\n- 使用自定义设置启动：\n  - `python pst_server.py --host 0.0.0.0 --port 5100 --timeout 300 --debug`\n- 健康检查（PowerShell）：\n  - `Invoke-RestMethod -Uri http://localhost:5100/health -Method GET`\n\n## MCP Server 配置选项\n\nMCP 客户端支持多种传输模式，并可以使用各种参数进行配置：\n\n### 传输模式\n\n1. **STDIO 模式（默认）**：标准输入/输出通信，适用于大多数 MCP 客户端，如 Claude Desktop\n2. **SSE 模式**：服务器发送事件传输，适用于基于 Web 的客户端\n3. **HTTP 模式**：直接 HTTP API 访问，适用于自定义集成\n\n### 命令行选项\n\n```bash\npython mcp_server.py [选项]\n```\n\n- `--server URL`: PST API 服务器 URL（默认：http://localhost:5100）\n- `--timeout 秒数`: 请求超时时间，以秒为单位（默认：300）\n- `--host 主机`: MCP 服务器主机（默认：127.0.0.1）\n- `--port 端口`: MCP 服务器端口（默认：8000）\n- `--path 路径`: stdio 模式的 MCP 服务器访问路径（默认：/mcp）\n- `--transport 模式`: 传输模式 - studio（stdio）、sse 或 http（默认：studio）\n- `--debug`: 启用调试日志\n\n### 启动 MCP 客户端\n\n- **STDIO 模式（默认）**：\n  ```bash\n  python3 mcp_server.py --server http://localhost:5100 --debug\n  ```\n\n- **SSE 模式**：\n  ```bash\n  python3 mcp_server.py --server http://localhost:5100 --transport sse --host 0.0.0.0 --port 8000 --path /sse\n  ```\n\n- **HTTP 模式**：\n  ```bash\n  python3 mcp_server.py --server http://localhost:5100 --transport http --host 0.0.0.0 --port 8000 --path /mcp\n  ```\n\n### 自定义集成配置（HTTP 模式）：\n\n- Nmap：\n  ```powershell\n  $body = @{ target=\"scanme.nmap.org\"; scan_type=\"-sV\"; ports=\"\"; additional_args=\"-T4 -Pn\" } | ConvertTo-Json\n  Invoke-RestMethod -Uri http://localhost:5100/api/tools/nmap -Method POST -Body $body -ContentType \"application/json\"\n  ```\n\n- FFUF：\n  ```powershell\n  $body = @{ url=\"http://target\"; wordlist=\"C:\\wordlists\\common.txt\"; additional_args=\"\" } | ConvertTo-Json\n  Invoke-RestMethod -Uri http://localhost:5100/api/tools/ffuf -Method POST -Body $body -ContentType \"application/json\"\n  ```\n\n- ProjectDiscovery：\n  ```powershell\n  # Subfinder\n  $body = @{ domain=\"example.com\"; list_file=\"\"; additional_args=\"-all -silent\" } | ConvertTo-Json\n  Invoke-RestMethod -Uri http://localhost:5100/api/tools/subfinder -Method POST -Body $body -ContentType \"application/json\"\n\n  # DNSX\n  $body = @{ domain=\"example.com\"; list_file=\"\"; additional_args=\"-a -resp -silent\" } | ConvertTo-Json\n  Invoke-RestMethod -Uri http://localhost:5100/api/tools/dnsx -Method POST -Body $body -ContentType \"application/json\"\n\n  # Naabu\n  $body = @{ host=\"example.com\"; list_file=\"\"; ports=\"\"; additional_args=\"-silent\" } | ConvertTo-Json\n  Invoke-RestMethod -Uri http://localhost:5100/api/tools/naabu -Method POST -Body $body -ContentType \"application/json\"\n\n  # Nuclei\n  $body = @{ target=\"http://example.com\"; list_file=\"\"; template=\"\"; tags=\"\"; severity=\"\"; additional_args=\"-silent\" } | ConvertTo-Json\n  Invoke-RestMethod -Uri http://localhost:5100/api/tools/nuclei -Method POST -Body $body -ContentType \"application/json\"\n\n  # Katana\n  $body = @{ url=\"http://example.com\"; list_file=\"\"; depth=\"3\"; additional_args=\"-silent\" } | ConvertTo-Json\n  Invoke-RestMethod -Uri http://localhost:5100/api/tools/katana -Method POST -Body $body -ContentType \"application/json\"\n  ```\n\n- Afrog：\n  ```powershell\n  $body = @{ target=\"http://example.com\"; list_file=\"\"; pocs=\"\"; additional_args=\"\" } | ConvertTo-Json\n  Invoke-RestMethod -Uri http://localhost:5100/api/tools/afrog -Method POST -Body $body -ContentType \"application/json\"\n  ```\n\n- Ehole（指纹识别）：\n  ```powershell\n  $body = @{ target=\"http://example.com\"; list_file=\"\"; fingerprints=\"\"; output=\"\"; additional_args=\"\" } | ConvertTo-Json\n  Invoke-RestMethod -Uri http://localhost:5100/api/tools/ehole -Method POST -Body $body -ContentType \"application/json\"\n  ```\n\n- Nikto：\n  ```powershell\n  $body = @{ target=\"http://example.com\"; port=\"\"; ssl=$false; additional_args=\"\" } | ConvertTo-Json\n  Invoke-RestMethod -Uri http://localhost:5100/api/tools/nikto -Method POST -Body $body -ContentType \"application/json\"\n  ```\n\n- Gobuster（目录模式）：\n  ```powershell\n  $body = @{ mode=\"dir\"; url=\"http://example.com\"; wordlist=\"C:\\wordlists\\common.txt\"; additional_args=\"\" } | ConvertTo-Json\n  Invoke-RestMethod -Uri http://localhost:5100/api/tools/gobuster -Method POST -Body $body -ContentType \"application/json\"\n  ```\n\n- Masscan：\n  ```powershell\n  $body = @{ target=\"192.168.1.0/24\"; ports=\"80,443\"; rate=\"1000\"; iface=\"\"; additional_args=\"\" } | ConvertTo-Json\n  Invoke-RestMethod -Uri http://localhost:5100/api/tools/masscan -Method POST -Body $body -ContentType \"application/json\"\n  ```\n\n- John（破解示例）：\n  ```powershell\n  $body = @{ hash_file=\"C:\\hashes\\passwd.txt\"; wordlist=\"C:\\wordlists\\rockyou.txt\"; format=\"\"; mask=\"\"; rules=$false; additional_args=\"\" } | ConvertTo-Json\n  Invoke-RestMethod -Uri http://localhost:5100/api/tools/john -Method POST -Body $body -ContentType \"application/json\"\n  ```\n\n- Metasploit（msfconsole -x）：\n  ```powershell\n  $body = @{ msf_cmd=\"version; exit\"; rc_file=\"\"; additional_args=\"\" } | ConvertTo-Json\n  Invoke-RestMethod -Uri http://localhost:5100/api/tools/metasploit -Method POST -Body $body -ContentType \"application/json\"\n  ```\n\n- Netcat：\n  ```powershell\n  # 监听\n  $body = @{ mode=\"listen\"; listen_port=\"4444\"; additional_args=\"\" } | ConvertTo-Json\n  Invoke-RestMethod -Uri http://localhost:5100/api/tools/netcat -Method POST -Body $body -ContentType \"application/json\"\n  # 连接\n  $body = @{ mode=\"client\"; host=\"127.0.0.1\"; port=\"4444\"; additional_args=\"\" } | ConvertTo-Json\n  Invoke-RestMethod -Uri http://localhost:5100/api/tools/netcat -Method POST -Body $body -ContentType \"application/json\"\n  ```\n\n- 通用命令：\n  ```powershell\n  $body = @{ command=\"whoami\" } | ConvertTo-Json\n  Invoke-RestMethod -Uri http://localhost:5100/api/command -Method POST -Body $body -ContentType \"application/json\"\n  ```\n\n## 安全说明\n\n- 仅在合法授权范围内使用所有工具与功能。\n- 所有命令参数均直接传入底层工具，请谨慎控制输入，避免注入与误操作。\n- 执行超时默认 180s，在启动时通过 `--timeout` 可调整。\n\n## 迭代计划\n\n- 根据 PST-Bucket 中的工具清单添加更多端点（例如 `afrog`, `ehole`, `fscan` 等）。\n- 为各工具增加参数校验与输出解析，提高稳定性与可读性。\n\n## ⚠️ 免责声明：\n本项目仅用于教育和道德测试目的。严禁滥用所提供的信息或工具——包括未经授权的访问、利用或恶意活动——是严格禁止的。\n作者对滥用不承担任何责任。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farch3rpro%2Fmcp-pst-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farch3rpro%2Fmcp-pst-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farch3rpro%2Fmcp-pst-server/lists"}