Curl MCP - 自然语言 Curl 命令生成器
使用自然语言(支持英文和西班牙文)执行 curl 命令。
环境要求
- Python 3.13 或更高版本
- curl(通常在 Linux 系统中已预装)
- Git
安装步骤
- 克隆仓库:
- 创建并激活虚拟环境:
- 安装依赖:
- 启动 MCP 服务器:
配置
将以下内容添加到你的 MCP 设置中:
注意:将
/path/to/your/curl-mcp
替换为你克隆仓库的实际路径。使用方法
- 启动 MCP 服务器:
- 服务器现在可以接收英文或西班牙文的自然语言命令。以下是一些示例:
基础示例:
- "获取 https://example.com 的头部信息"
- "显示 https://api.example.com 的原始响应"
- "下载 https://example.com 并保存为 page.html"
高级示例:
- 头部信息与认证:
- "向 https://api.example.com 发送请求,包含头部 Authorization: Bearer mytoken"
- "使用基本认证 user:password 获取 https://api.example.com"
- 数据处理:
- "向 https://api.example.com/users 发送 POST 请求,数据为 name=John 和 age=25"
- "向 https://upload.example.com 发送表单数据,包含文件 image.jpg"
- "向 https://api.example.com 发送 URL 编码数据 user=test+name"
- 安全与选项:
- "忽略 SSL 验证获取 https://example.com"
- "请求 https://api.example.com,超时时间为 30 秒"
- "通过代理 localhost:8080 获取 https://example.com"
- 用户代理:
- "以 Chrome 身份获取 https://example.com"
- "以 iPhone 身份请求 https://mobile.example.com"
- Author:waytomcp
- URL:https://www.waytomcp.com/article/MartinPSDev/curl-mcp
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!