npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ktwo/mcp-curl

v1.0.2

Published

MCP server providing HTTP request tools similar to curl

Readme

MCP Curl Server

一个基于 Model Context Protocol (MCP) 的 HTTP 请求工具服务器,提供类似 curl 的功能,可以执行各种 HTTP 请求。

功能特性

  • 支持多种 HTTP 方法:GET、POST、PUT、DELETE、PATCH、HEAD
  • 自定义请求头
  • 支持 JSON 和文本请求体
  • 自动处理 JSON 响应
  • 支持超时设置
  • 支持重定向控制
  • 详细的响应信息(状态码、响应头、响应体)

安装

cd mcp-curl
npm install

使用方法

安装

方式 1:使用 npx(推荐)

无需安装,直接在 Claude Desktop 配置中使用:

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

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

方式 2:全局安装

npm install -g @ktwo/mcp-curl

然后在配置中使用:

{
  "mcpServers": {
    "mcp-curl": {
      "command": "mcp-curl"
    }
  }
}

方式 3:本地开发

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

独立运行(测试)

npm start

可用工具

1. http_get

执行 HTTP GET 请求,用于获取资源。

参数:

  • url (必需): 请求的 URL 地址
  • headers (可选): 请求头对象
  • timeout (可选): 超时时间(毫秒),默认 30000
  • followRedirects (可选): 是否跟随重定向,默认 true

示例:

{
  "url": "https://api.example.com/users",
  "headers": {
    "Authorization": "Bearer token123"
  }
}

2. http_post

执行 HTTP POST 请求,用于创建资源或提交数据。

参数:

  • url (必需): 请求的 URL 地址
  • body (可选): 请求体,可以是对象或字符串
  • headers (可选): 请求头对象
  • timeout (可选): 超时时间(毫秒),默认 30000
  • followRedirects (可选): 是否跟随重定向,默认 true

示例:

{
  "url": "https://api.example.com/users",
  "body": {
    "name": "John Doe",
    "email": "[email protected]"
  },
  "headers": {
    "Authorization": "Bearer token123"
  }
}

3. http_put

执行 HTTP PUT 请求,用于更新资源。

参数:

  • url (必需): 请求的 URL 地址
  • body (可选): 请求体,可以是对象或字符串
  • headers (可选): 请求头对象
  • timeout (可选): 超时时间(毫秒),默认 30000
  • followRedirects (可选): 是否跟随重定向,默认 true

4. http_delete

执行 HTTP DELETE 请求,用于删除资源。

参数:

  • url (必需): 请求的 URL 地址
  • headers (可选): 请求头对象
  • timeout (可选): 超时时间(毫秒),默认 30000
  • followRedirects (可选): 是否跟随重定向,默认 true

5. http_patch

执行 HTTP PATCH 请求,用于部分更新资源。

参数:

  • url (必需): 请求的 URL 地址
  • body (可选): 请求体,可以是对象或字符串
  • headers (可选): 请求头对象
  • timeout (可选): 超时时间(毫秒),默认 30000
  • followRedirects (可选): 是否跟随重定向,默认 true

6. http_head

执行 HTTP HEAD 请求,只获取响应头不获取响应体。

参数:

  • url (必需): 请求的 URL 地址
  • headers (可选): 请求头对象
  • timeout (可选): 超时时间(毫秒),默认 30000
  • followRedirects (可选): 是否跟随重定向,默认 true

响应格式

成功响应:

{
  "success": true,
  "status": 200,
  "statusText": "OK",
  "headers": {
    "content-type": "application/json",
    "content-length": "123"
  },
  "body": "响应内容",
  "url": "https://api.example.com/users"
}

失败响应:

{
  "success": false,
  "error": "错误信息",
  "type": "错误类型"
}

使用示例

在 Claude Desktop 中,你可以这样使用:

  1. 获取数据
使用 http_get 工具获取 https://jsonplaceholder.typicode.com/posts/1
  1. 创建数据
使用 http_post 工具向 https://jsonplaceholder.typicode.com/posts 发送数据:
{
  "title": "Test Post",
  "body": "This is a test",
  "userId": 1
}
  1. 自定义请求头
使用 http_get 工具访问 https://api.github.com/user,
添加 Authorization 头:Bearer YOUR_TOKEN

注意事项

  • 自动处理 JSON 请求体和响应
  • 对于非 JSON 内容类型,返回文本
  • 默认添加 User-Agent: MCP-Curl/1.0
  • 超时默认为 30 秒
  • 自动跟随重定向(可配置)

License

MIT