Token导航 LogoToken导航TokenDH.com
MCP Curl logo
运维云端未说明官方级别未说明来源级核验

MCP Curl

MCP Server

一个提供curl功能的MCP服务器,允许AI助手直接从其环境发起HTTP请求。

工具数

6

提示词数

0

GitHub Stars

2

资源数

0
安全执行JavaScriptClaudeClaude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

247arjun

提供方

247arjun

最后核验

2026/5/17 20:21

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

用于Curl的MCP服务器

](https://badge.fury.io/js/@247arjun%2Fmcp-curl) ](https://www.npmjs.com/package/@247arjun/mcp-curl)

提供curl功能的模型上下文协议(MCP)服务器,允许AI助手直接从其环境中发出HTTP请求。

特性

  • HTTP方法:支持GET、POST、PUT、DELETE请求
  • 文件下载:使用curl下载文件
  • 高级选项:自定义标头、超时、重定向等
  • JSON支持:用于POST/PUT请求的内置JSON数据处理
  • 用户代理:自定义用户代理字符串支持
  • 安全:通过输入验证安全执行子流程

安装

方法1:NPM安装(推荐)

# Install globally
npm install -g @247arjun/mcp-curl

# Or install locally in your project
npm install @247arjun/mcp-curl

方法2:来源

# Clone the repository
git clone https://github.com/247arjun/mcp-curl.git
cd mcp-curl

# Install dependencies
npm install

# Build the project
npm run build

# Optional: Link globally
npm link

方法3:直接从GitHub

# Install directly from GitHub
npm install -g git+https://github.com/247arjun/mcp-curl.git

配置

Claude桌面设置

添加到您的Claude Desktop配置文件中:

地点:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • 窗户: %APPDATA%/Claude/claude_desktop_config.json

配置:

{
  "mcpServers": {
    "mcp-curl": {
      "command": "mcp-curl",
      "args": []
    }
  }
}

替代方案:使用npx(无需全局安装)

{
  "mcpServers": {
    "mcp-curl": {
      "command": "npx",
      "args": ["@247arjun/mcp-curl"]
    }
  }
}

地方发展设置

{
  "mcpServers": {
    "mcp-curl": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-curl/build/index.js"]
    }
  }
}

添加配置后,重新启动Claude Desktop以加载MCP服务器。

可用工具

1. curl_get

发出HTTP GET请求。

参数:

  • url (string):向其发出GET请求的URL
  • headers (数组,可选):HTTP标头格式为“Header:Value”
  • timeout (数字,可选):请求超时(秒)
  • follow_redirects (布尔值,可选):是否遵循重定向
  • user_agent (string,可选):自定义用户代理字符串

例子:

{
  "url": "https://api.example.com/data",
  "headers": ["Authorization: Bearer token"],
  "timeout": 30,
  "follow_redirects": true,
  "user_agent": "MyApp/1.0"
}

2. curl_post

使用数据发出HTTP POST请求。

参数:

  • url (string):向其发出POST请求的URL
  • json_data (object,可选):作为POST数据发送的JSON对象
  • data (string,可选):POST请求正文中要发送的数据
  • headers (数组,可选):HTTP标头
  • content_type (字符串,可选):Content-Type标头
  • timeout (数字,可选):请求超时(秒)
  • follow_redirects (布尔值,可选):是否遵循重定向

例子:

{
  "url": "https://api.example.com/data",
  "json_data": {"key": "value"},
  "headers": ["Content-Type: application/json"]
}

3. curl_put

发出HTTP PUT请求。

参数:

  • url (string):向其发出PUT请求的URL
  • json_data (object,可选):作为PUT数据发送的JSON对象
  • data (string,可选):在PUT请求体中发送的数据
  • headers (数组,可选):HTTP标头
  • content_type (字符串,可选):Content-Type标头
  • timeout (数字,可选):请求超时(秒)
  • follow_redirects (布尔值,可选):是否遵循重定向

例子:

{
  "url": "https://api.example.com/data/123",
  "data": "raw data",
  "content_type": "text/plain"
}

4. curl_delete

发出HTTP DELETE请求。

参数:

  • url (string):向其发出DELETE请求的URL
  • headers (数组,可选):HTTP标头
  • timeout (数字,可选):请求超时(秒)
  • follow_redirects (布尔值,可选):是否遵循重定向

例子:

{
  "url": "https://api.example.com/data/123",
  "headers": ["Authorization: Bearer token"]
}

5. curl_download

下载文件。

参数:

  • url (string):要下载的文件的URL
  • output_filename (字符串,可选):输出文件名
  • resume (布尔值,可选):如果文件存在,则恢复部分下载
  • timeout (数字,可选):请求超时(秒)
  • follow_redirects (布尔值,可选):是否遵循重定向

例子:

{
  "url": "https://example.com/file.zip",
  "output_filename": "downloaded_file.zip",
  "resume": true
}

6. curl_advanced

使用自定义参数执行curl(高级用户)。

参数:

  • args (array):curl参数数组(不包括'curl'本身)

例子:

{
  "args": ["-X", "PATCH", "-H", "Content-Type: application/json", "-d", "{\"status\":\"updated\"}", "https://api.example.com/items/1"]
}

使用示例

发出GET请求

{
  "tool": "curl_get",
  "url": "https://api.example.com/users",
  "headers": ["Authorization: Bearer your-token"]
}

POST JSON数据

{
  "tool": "curl_post",
  "url": "https://api.example.com/users",
  "json_data": {
    "name": "John Doe",
    "email": "john@example.com"
  }
}

下载文件

{
  "tool": "curl_download",
  "url": "https://example.com/file.zip",
  "output_filename": "download.zip"
}

发展

先决条件

  • Node.js 18.0.0或更高版本
  • npm包管理器
  • curl命令行工具

建筑

npm run build

测试

手动测试服务器:

echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/list", "params": {}}' | node build/index.js

运行测试:

npm test

代码检查

npm run lint
npm run lint:fix

项目结构

mcp-curl/
├── src/
│   └── index.ts          # Main server implementation
├── build/
│   └── index.js          # Compiled JavaScript
├── test/
│   └── basic.test.js     # Basic functionality tests
├── examples/
│   └── test-server.js    # Example usage
├── .github/
│   └── workflows/
│       └── ci.yml        # CI/CD pipeline
├── package.json          # Project configuration
├── tsconfig.json         # TypeScript configuration
├── .eslintrc.json        # ESLint configuration
├── LICENSE               # MIT License
├── DEPLOYMENT.md         # Deployment guide
├── CONTRIBUTING.md       # Contribution guidelines
├── CHANGELOG.md          # Version history
└── README.md             # This file

验证

测试服务器是否正常工作:

# Test the built server
node build/index.js

# Should show: "Curl MCP Server running on stdio"
# Press Ctrl+C to exit

故障排除

常见问题

  1. “找不到命令”错误

- 确保mcp-curl已全局安装: npm install -g @247arjun/mcp-curl - 或者使用npx: "command": "npx", "args": ["@247arjun/mcp-curl"]

  1. “权限被拒绝”错误

- 检查文件权限: chmod +x build/index.js - 重建项目: npm run build

  1. MCP服务器未出现在Claude中

- 验证配置文件中的JSON语法 - 完全重新启动克劳德桌面 - 检查命令路径是否正确

  1. “找不到curl命令”

- 在您的系统上安装curl(通常预装在macOS/Linux上) - Windows用户:通过软件包管理器安装或从curl网站下载

调试

通过设置环境变量启用详细日志记录:

# For development
DEBUG=1 node build/index.js

# Test with sample input
echo '{"jsonrpc": "2.0", "method": "initialize", "params": {}}' | node build/index.js

安全说明

  • 对所有curl参数进行输入验证和清理
  • 高级模式下的受限文件操作
  • 使用spawn而不是shell安全执行子流程
  • 不执行任意shell命令
  • 使用Zod模式进行输入验证

目录标签

目录标签

安全执行JavaScriptClaudeHTTP请求本地部署AI工具集成文件下载JSON处理

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

token

部署方式(deploymentType,部署类型)

remote-capable

工具数量(toolCount,工具数)

6

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明tokenremote-capable

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP