@jinghuichen/mcp-server-http-request
v1.0.1
Published
MCP (Model Context Protocol) server for HTTP requests - supports GET, POST, PUT, DELETE methods
Maintainers
Readme
@jinghuichen/mcp-server-http-request
MCP (Model Context Protocol) HTTP 请求服务器。让 Claude 等 AI 助手能够发起 HTTP API 调用。
功能特性
- 支持 HTTP 方法:GET、POST、PUT、DELETE
- 支持自定义请求头
- 支持 JSON 请求体
- 返回响应状态和内容
安装
npm install -g @jinghuichen/mcp-server-http-request或使用 npx:
npx @jinghuichen/mcp-server-http-request配置
在 MCP 客户端配置中添加:
{
"mcpServers": {
"http-tool": {
"type": "stdio",
"command": "npx",
"args": [
"@jinghuichen/mcp-server-http-request"
],
"env": {}
}
}
}或全局安装后:
{
"mcpServers": {
"http-tool": {
"type": "stdio",
"command": "mcp-server-http-request",
"args": [],
"env": {}
}
}
}工具:http_request
参数说明
| 参数 | 类型 | 必填 | 描述 |
|------|------|------|------|
| url | string | 是 | 请求的 URL |
| method | string | 否 | HTTP 方法:GET、POST、PUT、DELETE(默认:GET) |
| headers | object | 否 | 请求头,键值对形式 |
| body | string | 否 | 请求体(JSON 字符串) |
使用示例
// GET 请求
{
"url": "https://api.example.com/users"
}
// POST 请求(带请求体)
{
"url": "https://api.example.com/users",
"method": "POST",
"headers": {
"Content-Type": "application/json"
},
"body": "{\"name\": \"张三\"}"
}许可证
MIT
