Sign inSign up

superbizon007/curl-mcp

By superbizon007

•Updated 6 months ago

exposes libcurl capabilities as tools.

Image
Machine learning & AI
0

296

superbizon007/curl-mcp repository overview

⁠curl-mcp

An MCP (Model Context Protocol) server that exposes libcurl capabilities as tools. Built on curl_cffi⁠, it supports browser fingerprint impersonation for HTTP/HTTPS and direct low-level access to FTP, SMTP, IMAP, SFTP, WebSocket, and MQTT protocols.

⁠Tools

⁠HTTP / HTTPS
ToolDescription
open_urlFetch a URL; stores HTML, cookies, and request/response headers. Supports browser impersonation to bypass TLS fingerprinting.
get_snapshotReturn the HTML source of the last fetched page.
find_elementQuery the last page with a CSS selector; returns matching element HTML, text, and attributes.
get_cookiesList all stored cookies.
set_cookieAdd or update a cookie in persistent storage.
delete_cookiesDelete all stored cookies.
get_network_requestsReturn the log of tracked network requests from the last session.
⁠FTP / FTPS
ToolDescription
ftp_listList a directory. URL must end with / (e.g. ftp://ftp.example.com/pub/).
ftp_downloadDownload a file. Binary files are returned as base64.
⁠SMTP / SMTPS
ToolDescription
smtp_sendSend an email. Accepts from_addr, to_addrs list, subject, and body.
⁠IMAP / IMAPS
ToolDescription
imap_listList mailboxes or messages. URL format: imap://host/INBOX.
imap_fetchFetch a message by UID. URL format: imap://host/INBOX;UID=1.
⁠SFTP / SCP
ToolDescription
sftp_downloadDownload a file or list a directory (trailing /). Supports password and private key auth.
⁠WebSocket (WS / WSS)
ToolDescription
ws_send_receiveConnect, send a text frame, and return the server's response. Accepts optional HTTP headers for the handshake.
⁠MQTT / MQTTS
ToolDescription
mqtt_publishPublish a payload to a topic. URL encodes the topic: mqtt://broker/my/topic.
mqtt_subscribeSubscribe to a topic and return one received message.

⁠Configuration

Copy .env.example to .env and adjust as needed:

# Bearer token required on all requests except /health (leave blank to disable auth)
AUTH_TOKEN=your-secret-token-here

# Browser to impersonate for HTTP/HTTPS requests
# Options: chrome131, chrome124, firefox133, safari17_0, edge101, ...
IMPERSONATE=chrome131

# Optional proxy for HTTP/HTTPS traffic
# HTTP_PROXY=http://proxy.example.com:8080
# HTTPS_PROXY=http://proxy.example.com:8080
# NO_PROXY=localhost,127.0.0.1,.local

DEBUG=false

⁠Docker

⁠Build
docker build -f Dockerfile.ubuntu -t curl-mcp .
⁠Run
docker run -d \
  --name curl_mcp \
  -p 8000:8000 \
  -v $(pwd)/storage:/app/storage \
  -e AUTH_TOKEN=your-secret-token \
  curl-mcp
⁠Docker Compose
cp .env.example .env
# edit .env as needed
docker compose up -d

Check health:

curl http://localhost:8000/health

View logs:

docker compose logs -f

Stop:

docker compose down

⁠Connecting an MCP Client

The server uses SSE transport. Configure your MCP client with:

URL:    http://localhost:8000/sse
Header: Authorization: Bearer <AUTH_TOKEN>
⁠Claude Desktop example (claude_desktop_config.json)
{
  "mcpServers": {
    "curl-mcp": {
      "url": "http://localhost:8000/sse",
      "headers": {
        "Authorization": "Bearer your-secret-token"
      }
    }
  }
}

⁠Usage Examples

Fetch a web page with Chrome impersonation:

{"name": "open_url", "arguments": {"url": "https://example.com", "impersonate": "chrome131"}}

FTP directory listing:

{"name": "ftp_list", "arguments": {"url": "ftp://ftp.gnu.org/"}}

Send email:

{
  "name": "smtp_send",
  "arguments": {
    "url": "smtp://mail.example.com",
    "from_addr": "[email protected]",
    "to_addrs": ["[email protected]"],
    "subject": "Hello",
    "body": "Message body.",
    "username": "[email protected]",
    "password": "secret"
  }
}

WebSocket echo:

{"name": "ws_send_receive", "arguments": {"url": "wss://echo.example.com/", "message": "ping"}}

MQTT publish:

{"name": "mqtt_publish", "arguments": {"url": "mqtt://broker.example.com/sensors/temp", "payload": "23.5"}}

⁠Development

Install dependencies and run tests:

pip install -r requirements.txt
pytest

Run the server locally (without Docker):

uvicorn app.server:app --host 0.0.0.0 --port 8000 --reload

⁠Storage

Cookies and page snapshots are persisted in a SQLite database at ./storage/curl_mcp.db. The Docker volume mount (-v $(pwd)/storage:/app/storage) keeps this data across container restarts.

Tag summary

Content type

Image

Digest

sha256:1388b4068…

Size

200.4 MB

Last updated

6 months ago

docker pull superbizon007/curl-mcp