Curl MCP Server

Curl MCP Server

An MCP server that enables AI assistants to make HTTP requests and download files using curl, allowing them to interact with web APIs and content.

Category
访问服务器

Tools

curl_get

Make an HTTP GET request using curl

curl_post

Make an HTTP POST request using curl

curl_put

Make an HTTP PUT request using curl

curl_delete

Make an HTTP DELETE request using curl

curl_download

Download a file using curl

curl_advanced

Execute curl with custom arguments (advanced usage)

README

MCP Server for Curl

npm version npm downloads

A Model Context Protocol (MCP) server that provides curl functionality, allowing AI assistants to make HTTP requests directly from their environment.

Features

  • HTTP Methods: Support for GET, POST, PUT, DELETE requests
  • File Downloads: Download files with curl
  • Advanced Options: Custom headers, timeouts, redirects, and more
  • JSON Support: Built-in JSON data handling for POST/PUT requests
  • User Agent: Custom User-Agent string support
  • Security: Safe subprocess execution with input validation

Installation

Method 1: NPM Installation (Recommended)

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

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

Method 2: From Source

# 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

Method 3: Direct from GitHub

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

Configuration

Claude Desktop Setup

Add to your Claude Desktop configuration file:

Location:

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

Configuration:

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

Alternative: Using npx (no global install needed)

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

Local Development Setup

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

After adding the configuration, restart Claude Desktop to load the MCP server.

Available Tools

1. curl_get

Make HTTP GET requests.

Parameters:

  • url (string): The URL to make the GET request to
  • headers (array, optional): HTTP headers in the format 'Header: Value'
  • timeout (number, optional): Request timeout in seconds
  • follow_redirects (boolean, optional): Whether to follow redirects
  • user_agent (string, optional): Custom User-Agent string

Example:

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

2. curl_post

Make HTTP POST requests with data.

Parameters:

  • url (string): The URL to make the POST request to
  • json_data (object, optional): JSON object to send as POST data
  • data (string, optional): Data to send in the POST request body
  • headers (array, optional): HTTP headers
  • content_type (string, optional): Content-Type header
  • timeout (number, optional): Request timeout in seconds
  • follow_redirects (boolean, optional): Whether to follow redirects

Example:

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

3. curl_put

Make HTTP PUT requests.

Parameters:

  • url (string): The URL to make the PUT request to
  • json_data (object, optional): JSON object to send as PUT data
  • data (string, optional): Data to send in the PUT request body
  • headers (array, optional): HTTP headers
  • content_type (string, optional): Content-Type header
  • timeout (number, optional): Request timeout in seconds
  • follow_redirects (boolean, optional): Whether to follow redirects

Example:

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

4. curl_delete

Make HTTP DELETE requests.

Parameters:

  • url (string): The URL to make the DELETE request to
  • headers (array, optional): HTTP headers
  • timeout (number, optional): Request timeout in seconds
  • follow_redirects (boolean, optional): Whether to follow redirects

Example:

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

5. curl_download

Download files.

Parameters:

  • url (string): The URL of the file to download
  • output_filename (string, optional): Output filename
  • resume (boolean, optional): Resume partial download if file exists
  • timeout (number, optional): Request timeout in seconds
  • follow_redirects (boolean, optional): Whether to follow redirects

Example:

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

6. curl_advanced

Execute curl with custom arguments (advanced users).

Parameters:

  • args (array): Array of curl arguments (excluding 'curl' itself)

Example:

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

Usage Examples

Make a GET request

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

POST JSON data

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

Download a file

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

Development

Prerequisites

  • Node.js 18.0.0 or higher
  • npm package manager
  • curl command-line tool

Building

npm run build

Testing

Test the server manually:

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

Run tests:

npm test

Linting

npm run lint
npm run lint:fix

Project Structure

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

Verification

Test that the server is working:

# Test the built server
node build/index.js

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

Troubleshooting

Common Issues

  1. "Command not found" error

    • Ensure mcp-curl is installed globally: npm install -g @247arjun/mcp-curl
    • Or use npx: "command": "npx", "args": ["@247arjun/mcp-curl"]
  2. "Permission denied" error

    • Check file permissions: chmod +x build/index.js
    • Rebuild the project: npm run build
  3. MCP server not appearing in Claude

    • Verify JSON syntax in configuration file
    • Restart Claude Desktop completely
    • Check that the command path is correct
  4. "curl command not found"

    • Install curl on your system (usually pre-installed on macOS/Linux)
    • Windows users: Install via package manager or download from curl website

Debugging

Enable verbose logging by setting environment variable:

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

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

Security Notes

  • Input validation and sanitization for all curl arguments
  • Restricted file operations in advanced mode
  • Safe subprocess execution using spawn instead of shell
  • No arbitrary shell command execution
  • Input validation with Zod schemas

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选