MCP HTTP请求/MCP HTTP请求工具
全面的HTTP客户端MCP(模型上下文协议)服务器,用于API测试、web自动化和安全测试。提供功能齐全的HTTP工具,具有详细的日志记录功能。
为API 测试和 Web 自动化和安全测试设计提供的全功能 HTTP 客户端 MCP 服务器,具备完整的 HTTP 工具和详细的日志记录功能。
Features / 特性
- 完整的HTTP方法支持/完整的 HTTP 方法支持:获取、发布、放置、删除、补丁、头部、选项
- Advanced Security Testing / 高级安全测试: Raw request tool for penetration testing, SQL injection, XSS testing / 原始请求工具,用于渗透测试、SQL 注入、XSS 测试
- Full Parameter Support / 全参数支持: Headers, cookies, body, timeout for all methods / 所有方法支持 Headers、Cookies、Body、超时设置
- Automatic Logging / 自动日志记录:所有请求和响应都记录到
~/mcp_requests_logs// 所有请求和响应自动记录到~/mcp_requests_logs/ - Precision Guarantee / 精确保证: Raw mode preserves every character exactly as provided / 原始模式完全保留每个字符
- MCP兼容/MCP兼容:适用于Claude Code、Cursor和其他MCP客户端/兼容 克劳德代码、光标和其他 MCP 客户端
Installation / 安装
pip install mcp-requestUsage / 使用方法
使用光标/克劳德代码/在 光标/克劳德代码中使用
添加到MCP配置(~/.cursor/mcp_servers.json 或类似):
添加到你的 MCP 配置文件 (~/.cursor/mcp_servers.json 或类似文件):
{
"mcpServers": {
"mcp-request": {
"command": "mcp-request",
"type": "stdio"
}
}
}Available Tools / 可用工具
- http_get -GET请求,完全支持/全功能 GET 请求
- http_post -POST请求,完全支持/全功能 POST 请求
- http_put -完全支持PUT请求/全功能 PUT 请求
- http_delete -完全支持删除请求/全功能 删除请求
- http_patch -PATCH请求,全力支持/全功能 补丁请求
- http_head -HEAD请求,全力支持/全功能 HEAD 请求
- http_options -OPTIONS请求并获得全力支持/全功能 选项请求
- http_raw_request - 🔒 Raw HTTP requests for security testing / 🔒 用于安全测试的原始 HTTP 请求
Example Usage / 使用示例
# Basic GET request / 基础 GET 请求
http_get("https://api.example.com/users")
# POST with data and headers / 带数据和请求头的 POST 请求
http_post(
url="https://api.example.com/login",
body='{"username":"test","password":"test"}',
headers={"Content-Type": "application/json"}
)
# Security testing with raw request / 使用原始请求进行安全测试
http_raw_request(
url="https://vulnerable-site.com/search",
method="POST",
raw_body="q=test' OR 1=1--",
headers={"Content-Type": "application/x-www-form-urlencoded"}
)安全测试功能/安全测试特性
这 http_raw_request 该工具专为安全测试而设计:
http_raw_request 工具专为安全测试设计:
- Absolute Precision / 绝对精确:每个字符都完全保留/每个字符完全保留
- No Encoding / 无编码: Special characters (', ", \\, %, &, =) sent as-is / 特殊字符 (', ", \\, %, &, =) 原样发送
- Complete Headers / 完整请求头:不截断长cookie或令牌/不截断长 饼干或 代币
- Raw Payloads / 原始载荷:非常适合SQL注入、XSS、CSRF测试/完美适用于 SQL 注入、XSS、CSRF测试
Logging / 日志记录
所有HTTP请求和响应都会自动记录到:
所有 HTTP 请求和响应自动记录到:
- Location / 位置:
~/mcp_requests_logs/ - Format / 格式: JSON with timestamps, complete request/response details / JSON 格式,包含时间戳和完整的请求/响应详情
- Filename / 文件名:
requests_YYYYMMDD_HHMMSS.log
View logs with / 查看日志:
tail -f ~/mcp_requests_logs/requests_*.logRequirements / 系统要求
- Python≥3.13
- httpx≥0.25.0
- mcp\[cli\]≥1.9.4
License / 许可证
MIT许可证
贡献/贡献
欢迎投稿!此工具仅用于防御安全测试和合法的API测试目的。
欢迎贡献!此工具仅用于防御性安全测试和合法的 API 测试目的。
