A Model Context Protocol (MCP) server that provides curl functionality for making HTTP requests and downloading files, optimized for GPT model compatibility with clean, simple JSON responses.
-
curl_request: Make HTTP requests to any URL with support for:
- Multiple HTTP methods (GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS)
- Custom headers
- Request data/body
- Timeout configuration
- User-agent customization
- Redirect following
- Response header inclusion
- Response size limiting (NEW) - prevents excessive output by truncating large responses
-
curl_download: Download files from URLs with:
- Custom output path specification
- Timeout configuration
- Redirect following
- Progress tracking
- Simplified response format by default - returns just the data without metadata wrappers
- Automatic JSON parsing when response is valid JSON
- Clean, minimal error messages
- Better handling of large JSON arrays and objects
- Direct data passthrough for easier processing by AI models
- Added
max_response_size
parameter (default: 800KB) - Automatically truncates large responses to prevent system overload
- Provides metadata about truncation (original size, truncated size, warning messages)
- Safely handles very large API responses (like Binance exchange info)
- Increased internal buffer size to handle large responses before truncation
- Additional safety checks to prevent system memory issues
- Improved error messages and truncation notifications
- Install Node.js dependencies:
cd C:\claude\curl-mcp-server
npm install
- Make sure
curl
is installed and available in your system PATH.
Add this to your Claude Desktop configuration file (usually located at %APPDATA%\Claude\claude_desktop_config.json
):
{
"mcpServers": {
"curl-mcp-server": {
"command": "node",
"args": ["C:\\claude\\curl-mcp-server\\index.js"],
"env": {}
}
}
}
{
"tool": "curl_request",
"args": {
"url": "https://api.github.com/users/octocat"
}
}
All responses now return clean JSON or text data directly, making it easier for GPT models to process:
{
"tool": "curl_request",
"args": {
"url": "https://fapi.binance.com/fapi/v1/exchangeInfo"
}
}
Returns the actual API response directly without metadata wrappers.
{
"tool": "curl_request",
"args": {
"url": "https://fapi.binance.com/fapi/v1/exchangeInfo",
"max_response_size": 500000
}
}
{
"tool": "curl_request",
"args": {
"url": "https://httpbin.org/post",
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer your-token"
},
"data": "{\"name\": \"John\", \"email\": \"john@example.com\"}"
}
}
{
"tool": "curl_download",
"args": {
"url": "https://example.com/file.zip",
"output_path": "C:\\downloads\\file.zip"
}
}
{
"tool": "curl_request",
"args": {
"url": "https://api.example.com/large-dataset",
"method": "GET",
"max_response_size": 1000000,
"headers": {
"Accept": "application/json"
}
}
}
The server now automatically limits response sizes to prevent overwhelming the system:
- Default limit: 800KB (800,000 bytes)
- Customizable: Use
max_response_size
parameter - Truncation info: When responses are truncated, you'll receive:
truncated: true
original_size
: Original response size in bytestruncated_size
: Size after truncationtruncation_note
: Human-readable truncation messagewarning
: Advice about using the max_response_size parameter
For JSON APIs, returns the parsed JSON directly:
{
"result": [...], // Direct API response
"timestamp": "2024-01-01T00:00:00Z"
}
For text responses, returns the raw text:
Plain text response from the server
For errors, returns a simple error object:
{
"error": "Connection timeout"
}
- This server executes curl commands locally, so ensure you trust the URLs being accessed
- Be cautious with file download paths to avoid overwriting important files
- Consider running in a sandboxed environment for additional security
- Response size limiting helps prevent memory exhaustion attacks
- curl not found: Make sure curl is installed and in your system PATH
- Permission denied: Ensure the output directory exists and is writable
- Timeout errors: Increase the timeout value for slow connections
- Large responses: Use the
max_response_size
parameter to control truncation - Memory issues: The server now handles large responses safely with automatic truncation
url
(required): Target URLmethod
: HTTP method (default: "GET")headers
: Object with custom headersdata
: Request body datatimeout
: Request timeout in seconds (default: 30)follow_redirects
: Follow redirects (default: true)include_headers
: Include response headers (default: false)user_agent
: Custom user agent (default: "curl-mcp-server/1.1.0")max_response_size
: Max response size in bytes (default: 800000)
- Node.js (v14 or higher)
- curl (system dependency)
- @modelcontextprotocol/sdk
- v1.2.0: Optimized for GPT models - simplified response format by default, automatic JSON parsing, cleaner output
- v1.1.0: Added response size limiting, better error handling, increased buffer size
- v1.0.0: Initial release with basic curl functionality
MIT License