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

@lvdaxianer/mcp-http-gateway

v1.0.6

Published

MCP HTTP Gateway - 将 LLM 工具调用转发到 HTTP REST API,支持熔断器、降级策略、缓存、Mock、SQLite 日志。版本策略:偶数版本(如 1.0、1.2)为稳定版,奇数版本(如 1.1、1.3)为快速迭代版。

Readme

MCP HTTP Gateway

中文文档

A HTTP gateway service based on MCP protocol that forwards LLM tool call requests to HTTP REST interfaces.


Dual Mode (Dual Transport Mode)

Dual mode starts both STDIO and SSE transport modes simultaneously, allowing different clients to connect at the same time:

  • Claude Code connects via STDIO
  • VSCode / Other tools connect via SSE

Start Command

node dist/cli.cjs --transport=dual --sse-port=11114 --http-port=11115 --config=./tools.json

Port Allocation

| Mode | SSE Port | Dashboard Port | Description | |------|----------|---------------|-------------| | dual | --sse-port (default 11114) | --http-port (default 11115) | SSE + STDIO running together | | sse | --sse-port (default 11114) | SSE port - 1 | SSE mode only | | stdio | None | --http-port (default 11112) | STDIO mode only |

MCP Configuration (Dual Mode)

{
  "mcpServers": {
    "http-gateway": {
      "type": "sse",
      "url": "http://localhost:11114/sse",
      "description": "HTTP API Gateway (Dual Mode)"
    }
  }
}

Access URLs After Startup

========================================
MCP HTTP Gateway Started
========================================
SSE Connection:     http://localhost:11114/sse
Dashboard:          http://localhost:11115/dashboard
Health:             http://localhost:11115/health
========================================

Global Safety Usage

Configuration Priority Mechanism

Configuration priority ensures safe configuration management:

CLI Parameters > SQLite Database > Config File > Default Values

Priority Explanation:

| Source | Description | Safety | |--------|-------------|--------| | CLI Parameters | Passed via command line, highest priority | ✅ Most secure, unaffected by config files | | SQLite Database | Runtime persisted configuration | ✅ Secure, audit trail available | | Config File | tools.json file | ⚠️ Requires file permission control | | Default Values | Built-in default configuration | ⚠️ Only as fallback |

Circuit Breaker Protection

Prevent cascading failures, protect backend service stability:

{
  "circuitBreaker": {
    "enabled": true,
    "failureThreshold": 5,    // Trigger after 5 consecutive failures
    "successThreshold": 2,    // Recover after 2 consecutive successes
    "halfOpenTime": 30000     // Try recovery after 30s
  }
}

State Flow:

  • CLOSED → Normal state, requests forwarded normally
  • OPEN → Circuit breaker state, reject all requests, trigger fallback
  • HALF_OPEN → Half-open state, allow limited requests to probe recovery

Fallback Strategy

Safe fallback chain when request fails:

Request Failed → Cache Fallback (ignore TTL) → Mock Fallback → Return Error

Configuration Example:

{
  "fallback": {
    "enabled": true,
    "useExpiredCache": true,  // Use expired cache as fallback
    "useMockAsFallback": true // Use Mock data as fallback
  }
}

Security Best Practices

  1. No Hardcoded Secrets: Use tokens config or environment variables
  2. Log Sanitization: Sensitive info not logged
  3. Parameterized Queries: Prevent SQL injection
  4. Input Validation: All external inputs must be validated

Configuration Reference

📖 Full configuration parameters: See CONFIG_EN.md for detailed parameter descriptions, types, required/optional, and defaults.


Quick Start

# Install
npm install @lvdaxianer/mcp-http-gateway

# Start in Dual Mode
npx @lvdaxianer/mcp-http-gateway --transport=dual --config=./tools.json

License

MIT