diff --git a/README.md b/README.md index 81b0b308..b700a19c 100644 --- a/README.md +++ b/README.md @@ -631,6 +631,30 @@ CyberStrikeAI supports two MCP transport modes: - Default listen address: `0.0.0.0:8081/mcp` - Accessible via `/api/mcp` endpoint +#### MCP HTTP Mode (IDE Integration) + +You can connect IDEs such as Cursor or Claude Desktop directly to the built-in HTTP MCP server: + +1. Ensure `mcp.enabled: true` in `config.yaml`, adjust `host`/`port` if you need a different bind address. +2. Start the main server (`./run.sh` or `go run cmd/server/main.go`). The MCP endpoint will be available at `http://:/mcp` (default `http://127.0.0.1:8081/mcp` when running locally). +3. In Cursor, open **Settings → Tools & MCP → Add Custom MCP**, choose HTTP, and set: + - `Base URL`: `http://127.0.0.1:8081/mcp` + - Optional headers (e.g., `Authorization`) if you enforce authentication in front of MCP. +4. Alternatively create `.cursor/mcp.json` in your project: + ```json + { + "mcpServers": { + "cyberstrike-ai-http": { + "transport": "http", + "url": "http://127.0.0.1:8081/mcp" + } + } + } + ``` +5. Restart the IDE; CyberStrikeAI’s tools will appear under the MCP tool list. + +> 🔐 **Security tip**: if you expose the MCP HTTP port beyond localhost, protect it with firewalls or authentication to prevent misuse. + #### 2. stdio Mode (New) - Communication via standard input/output (stdio) - Suitable for Cursor, Claude Desktop, and other IDE integrations diff --git a/README_CN.md b/README_CN.md index 2a0303b7..a36b1cee 100644 --- a/README_CN.md +++ b/README_CN.md @@ -1,7 +1,5 @@ # CyberStrikeAI -[English](README.md) | [中文](README_CN.md) - 🚀 **AI自主渗透测试平台** - 基于Golang构建,内置上百个安全工具,支持灵活扩展自定义工具,通过MCP协议实现AI智能决策与自动化执行,让安全测试像对话一样简单。 - web模式 ![详情预览](./img/效果.png) @@ -632,6 +630,30 @@ CyberStrikeAI 支持两种 MCP 传输模式: - 默认监听地址:`0.0.0.0:8081/mcp` - 可通过 `/api/mcp` 端点访问 +#### MCP HTTP 模式(IDE 集成) + +可将 Cursor、Claude Desktop 等 IDE 直接连接到内置的 HTTP MCP 服务: + +1. 确认 `config.yaml` 中 `mcp.enabled: true`,根据需要调整 `host` / `port`。 +2. 启动主服务(`./run.sh` 或 `go run cmd/server/main.go`),MCP 端点将暴露在 `http://:/mcp`(本地运行时推荐使用 `http://127.0.0.1:8081/mcp`)。 +3. 在 Cursor 中打开 **Settings → Tools & MCP → Add Custom MCP**,选择 HTTP,填写: + - `Base URL`: `http://127.0.0.1:8081/mcp` + - 如启用了鉴权,可在 Headers 中添加 `Authorization` 等字段。 +4. 或者在项目根目录创建 `.cursor/mcp.json`: + ```json + { + "mcpServers": { + "cyberstrike-ai-http": { + "transport": "http", + "url": "http://127.0.0.1:8081/mcp" + } + } + } + ``` +5. 重启 IDE 后即可在 MCP 工具列表中看到 CyberStrikeAI 的工具集。 + +> 🔐 **安全提示**:若将 MCP HTTP 端口开放给外部,请结合防火墙或认证机制,避免被未授权访问。 + #### 2. stdio 模式(新增) - 通过标准输入输出(stdio)进行通信 - 适用于 Cursor、Claude Desktop 等 IDE 集成