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

mcp-webapi-bridge

v1.0.2

Published

MCP (Model Context Protocol) WebAPI bridge agent for HTTP proxy. Connects MCP clients to servers via HTTP requests and SSE (Server-Sent Events).

Readme

mcp-webapi-bridge

MCP (Model Context Protocol) WebAPI bridge agent for HTTP proxy. Connects MCP clients to servers via HTTP requests and SSE (Server-Sent Events).

安装

全局安装

npm install -g mcp-webapi-bridge

本地安装

npm install mcp-webapi-bridge

使用方法

作为命令行工具

全局安装后,可以直接使用 mcp-webapi-bridge 命令:

mcp-webapi-bridge <targetUrl> [token]

作为本地依赖

npx mcp-webapi-bridge <targetUrl> [token]

参数说明

  • <targetUrl>: MCP 服务器的目标 URL,例如 http://127.0.0.1:7001/mcp/task/168f2f91-150b-4480-b0f6-5166f4896245
  • [token]: 可选的认证令牌,格式为自定义的token,比如: Bearer your-token

IDE中的MCP配置

不需要npm install ,直接使用 npx

{
  "mcpServers": {
    "law-search-server": {
      "command": "npx",
      "args": [
        "mcp-webapi-bridge",
        "http://127.0.0.1:7001/mcp/task/168f2f91-150b-4480-b0f6-5166f4896245/sse",
        "c14bccba-5b6c-4042-8799-352c3c994ae3"
      ]
    }
  }
}

环境变量

也可以通过环境变量设置配置:

MCP_TARGET_URL=<url> MCP_TOKEN=<token> mcp-webapi-bridge

示例

# 基本用法
mcp-webapi-bridge http://127.0.0.1:7001/mcp/task/xxx

# 带认证令牌
mcp-webapi-bridge http://127.0.0.1:7001/mcp/task/xxx "Bearer your-token"

# 使用环境变量
MCP_TARGET_URL=http://127.0.0.1:7001/mcp/task/xxx MCP_TOKEN="Bearer your-token" mcp-webapi-bridge

功能特性

  • 连接到 MCP 服务器的 SSE (Server-Sent Events) 流
  • 处理 SSE 消息并提取 endpoint URL
  • 从 stdin 读取 MCP 客户端的请求
  • 将请求转发到 MCP 服务器
  • 将服务器的响应转发到 stdout

工作原理

  1. 工具启动后,会连接到指定的 MCP 服务器 URL
  2. 建立 SSE 连接,接收服务器发送的消息
  3. 从消息中提取 endpoint URL,用于后续的请求发送
  4. 从 stdin 读取 MCP 客户端的请求
  5. 将请求转发到提取的 endpoint URL
  6. 将服务器的响应通过 stdout 发送回 MCP 客户端

故障排除

常见问题

  1. 错误: targetUrl is required
    • 原因:未提供目标 URL
    • 解决:提供 MCP 服务器的 URL 作为命令行参数或设置 MCP_TARGET_URL 环境变量
  2. SSE connection error
    • 原因:无法连接到 MCP 服务器
    • 解决:检查目标 URL 是否正确,服务器是否运行,网络连接是否正常
  3. No endpoint received
    • 原因:服务器未发送 endpoint URL
    • 解决:检查 MCP 服务器是否正常运行,是否正确配置

日志

工具会将连接状态、错误信息等输出到 stderr,便于调试。

注意事项

  • 工具需要保持运行状态以维持 SSE 连接
  • 请确保提供的 token 具有足够的权限访问 MCP 服务器
  • 工具仅支持 HTTP 协议,不支持 HTTPS

许可证

MIT License