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

@qazll/mcp-http-requester

v1.1.6

Published

MCP server for making HTTP requests and maintaining error messages

Downloads

126

Readme

@qazll/mcp-http-requester

MCP 服务器,用于发送 HTTP 请求和维护报错消息。基于 Model Context Protocol (MCP) 标准实现,通过 stdio 传输与 MCP 客户端通信。

功能

提供以下四个工具:

1. http_request

发送 HTTP 请求,支持 GET/POST/PUT/DELETE/PATCH 方法。

| 参数 | 类型 | 必填 | 默认值 | 说明 | | ---------- | ------- | -- | ------- | ----------------------------- | | url | string | 是 | - | 请求 URL | | method | string | 否 | GET | HTTP 方法 | | headers | object | 否 | {} | 请求头键值对 | | params | object | 否 | {} | 查询参数键值对 | | body | string | 否 | - | 请求体(JSON 字符串或表单字符串) | | bodyType | string | 否 | json | 请求体类型:json / form / raw | | timeout | integer | 否 | 30 | 超时秒数 | | insecure | boolean | 否 | false | 是否跳过 SSL 证书验证 |

2. get_env_info

获取环境信息,返回 env 中配置的网关地址、租户 ID 以及生成的可用 AUTH_TOKEN。无需参数。

返回字段:

| 字段 | 说明 | | --------------- | --------------------- | | GATEWAY_URL | 环境配置的网关地址 | | ORGANIZATION_ID | 环境配置的租户 ID | | AUTH_TOKEN | 通过 OAuth2 生成的可用 access_token |

3. get_access_token

通过 OAuth2 密码模式获取 HZero 平台 access_token,自动缓存并在有效期内复用。无需参数。

4. maintain_error_message

报错消息维护,自动完成「获取 token → 查询编码是否已维护 → 未维护则创建」的流程。

| 参数 | 类型 | 必填 | 说明 | | ------------- | ------ | -- | ---- | | messageCode | string | 是 | 消息编码 | | message | string | 是 | 消息描述 |

返回状态:

  • CREATED — 新建成功
  • EXISTS — 编码已存在且描述一致,无需重复创建
  • CONFLICT — 编码已存在但描述不同,需修改编码

环境配置

通过 MCP 客户端的 env 字段注入环境变量:

| 环境变量 | 默认值 | 说明 | | ---------------------- | ------------------------- | ---------------------------------------------- | | GATEWAY_URL | https://127.0.0.1:30080 | 网关地址 | | USERNAME | admin | OAuth2 用户名 | | PASSWORD | Admin@123! | OAuth2 密码 | | ORGANIZATION_ID | 0 | 租户 ID | | COMMON_SERVICE_ROUTE | tznc | 公共服务路由 | | AUTH_TOKEN | - | 默认 Authorization 令牌(http_request 工具自动附加到请求头) |

安装与使用

安装依赖

npm install

发布到 npm

npm login
npm publish --access public

在 MCP 客户端中配置

以 Claude Desktop 为例,编辑配置文件:

{
  "mcpServers": {
    "http-requester": {
      "command": "node",
      "args": ["path/to/mcp-http-requester/index.js"],
      "env": {
        "GATEWAY_URL": "https://your-gateway.com",
        "USERNAME": "your-username",
        "PASSWORD": "your-password",
        "ORGANIZATION_ID": "0",
        "COMMON_SERVICE_ROUTE": "tznc"
      }
    }
  }
}

通过 npx 运行

{
  "mcpServers": {
    "tarzan-tools": {
      "command": "npx",
      "args": [
        "-y",
        "@qazll/mcp-http-requester@latest"
      ],
      "env": {
        "GATEWAY_URL": "https://your-gateway.com",
        "USERNAME": "your-username",
        "PASSWORD": "your-password",
        "ORGANIZATION_ID": "0",
        "COMMON_SERVICE_ROUTE": "tznc"
      }
    }
  }
}

项目结构

mcp-http-requester/
├── package.json          # 项目配置
├── README.md            # 项目文档
└── src/                 # 源代码目录
    ├── index.js         # MCP 服务器主入口
    ├── config/          # 配置模块
    │   └── env.js       # 环境配置(ENV_CONFIG、getEnvConfig)
    ├── services/        # 服务层
    │   ├── token.js     # Token 管理服务(getAccessToken、缓存机制)
    │   └── errorMessage.js  # 报错消息服务(查询/保存接口)
    └── handlers/        # 处理器层
        ├── httpRequest.js  # HTTP 请求工具处理器
        └── tools.js     # 其他工具处理器(get_env_info、get_access_token、maintain_error_message)

技术栈

  • MCP SDK — Model Context Protocol 服务端实现
  • Axios — HTTP 请求库
  • Node.js ES Modules

许可证

私有包,未公开发布。