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

@taraksh011/mcphub

v1.7.1

Published

Single MCP gateway - one endpoint for all your AI coding CLIs

Readme

mcphub

Single MCP gateway for all your AI coding CLIs.

Instead of configuring every CLI (OpenCode, Claude Code, Cursor, Zed, Pi) with its own MCP server setup, run one hub and point them all at a single URL.

npm install -g @taraksh011/mcphub
mcphub add my-server --stdio "npx -y some-mcp-server"
mcphub start

All tools from all servers appear under http://localhost:5431/mcp.


Quick Start

# 1. Install
npm install -g @taraksh011/mcphub

# 2. Add your first server (e.g., filesystem access)
mcphub add filesystem --stdio "npx -y @modelcontextprotocol/server-filesystem /tmp"

# 3. Start the hub
mcphub start

# 4. Configure your CLI to use http://localhost:5431/mcp

That's it! Your CLI now has access to all tools from all configured servers.


Installation

Global Install (Recommended)

npm install -g @taraksh011/mcphub
mcphub --help

Run Without Installing

npx @taraksh011/mcphub <command>

Core Concepts

| Concept | Description | |---------|-------------| | Hub | Single HTTP/SSE endpoint that aggregates multiple MCP servers | | Backend | An MCP server (stdio or HTTP) connected to the hub | | Tool | Individual capability from a backend (namespaced as backend:tool) | | Config | JSON file at ~/.config/mcphub/config.json |


Adding MCP Servers

Stdio Servers (Run as Child Processes)

# Basic
mcphub add filesystem --stdio "npx -y @modelcontextprotocol/server-filesystem /tmp"

# With environment variables
mcphub add github --stdio "npx -y @modelcontextprotocol/server-github" -e GITHUB_TOKEN=xxx

# Custom working directory
mcphub add my-tools --stdio "npx -y @my/mcp-server" --cwd /path/to/project

HTTP Servers (Remote)

# Public server
mcphub add context7 --url https://mcp.context7.com/mcp

# Private server
mcphub add internal --url https://mcp.internal.company.com/mcp

List & Manage Servers

mcphub list              # Show all configured servers
mcphub disable github    # Disable without removing
mcphub enable github     # Re-enable
mcphub remove old-server # Remove completely

Running the Hub

Foreground (Development)

mcphub start
# Listens on http://127.0.0.1:5431/mcp

Background Daemon

mcphub start --daemon
# Runs in background, logs to ~/.config/mcphub/hub.log

Custom Port / Host

mcphub start --port 8080
mcphub start --host 0.0.0.0  # ⚠️ Exposes all tools without auth - trusted networks only

Status & Health

mcphub status              # Shows PID, port, host, server list
curl http://localhost:5431/health  # JSON health check

Boot-Time Service (Auto-Start)

mcphub can run as a background service so it starts automatically. By default it installs per-user (no sudo required); pass --system for a system-wide install that requires root.

Per-User Install (Default - no sudo)

mcphub install-service
# Writes ~/.config/systemd/user/mcphub.service; starts at your login

The service starts when you log in. To start it at boot without logging in (Linux), enable lingering once:

loginctl enable-linger $USER

System-Wide Install (requires sudo)

mcphub install-service --system
# Writes /etc/systemd/system/mcphub.service, runs as your user via User=

Version Pinning

mcphub install-service --pin-version           # per-user, pinned
mcphub install-service --system --pin-version # system-wide, pinned

| Mode | Behavior | Best For | |------|----------|----------| | Default (auto-update, per-user) | Uses ~/.local/share/pnpm/bin/mcphub shim. Picks up new versions on restart. No root needed. | Daily use, always want latest | | --pin-version | Uses absolute node + script path. Stays on exact version until you re-run install-service. | CI/CD, reproducible deploys | | --system | Installs system-wide under /etc/systemd/system (needs sudo). | Shared machines, boot before login |

Check Status

systemctl --user status mcphub    # per-user (Linux)
systemctl status mcphub           # system-wide (Linux)
launchctl list | grep mcphub      # macOS

Uninstall

mcphub uninstall-service           # per-user
mcphub uninstall-service --system  # system-wide (needs sudo)

Per-Tool Control

Hide individual tools without removing the whole server:

mcphub tools                    # List all tools with disabled state
mcphub tools disable github create_issue
mcphub tools enable github create_issue

Disabled tools:

  • Show [disabled] in mcphub tools
  • Are filtered from tools/list RPC
  • Return error if called directly

OAuth-Protected HTTP Servers

Some servers (e.g., Cloudflare) require OAuth:

mcphub add cloudflare --url https://mcp.cloudflare.com/mcp
mcphub auth cloudflare

Flow: RFC 9728 discovery → dynamic client registration → browser consent on http://localhost:8765/callback → tokens saved to ~/.config/mcphub/tokens/<name>.json.


Configuring Your CLI

All CLIs connect to http://localhost:5431/mcp.

OpenCode

~/.config/opencode/opencode.jsonc:

{
  "mcp": {
    "MCPHub": {
      "type": "remote",
      "url": "http://localhost:5431/mcp"
    }
  }
}

Pi (Terminal AI)

~/.pi/agent/mcp.json:

{
  "mcpServers": {
    "MCPHub": { "url": "http://localhost:5431/mcp" }
  }
}

Claude Code

claude mcp add --transport http mcphub http://localhost:5431/mcp

Cursor

.cursor/mcp.json in your project:

{
  "mcpServers": {
    "MCPHub": { "type": "http", "url": "http://localhost:5431/mcp" }
  }
}

Zed

~/.config/zed/settings.json:

{
  "mcp_servers": {
    "MCPHub": { "url": "http://localhost:5431/mcp" }
  }
}

Config File

Location:

  • Linux: ~/.config/mcphub/config.json
  • macOS: ~/Library/Application Support/mcphub/config.json
  • Windows: %APPDATA%\mcphub\config.json

Override with --config:

mcphub --config /path/to/config.json start

Or set MCPHUB_CONFIG env var.

Example Config

{
  "port": 5431,
  "mcpServers": {
    "filesystem": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"],
      "enabled": true
    },
    "github": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": { "GITHUB_TOKEN": "xxx" }
    },
    "context7": {
      "type": "http",
      "url": "https://mcp.context7.com/mcp"
    }
  }
}

HTTP server options:

  • url - MCP Streamable HTTP endpoint.
  • heartbeatMs - (optional) when set, mcphub sends a ping every heartbeatMs ms to keep the backend session alive. Useful when the server enforces a short idle timeout (mcphub automatically reconnects and retries if a session still expires).

Shell Environment Variables

API keys from your shell rc files work under systemd too. mcphub loads export KEY=VALUE lines from:

  • ~/.bashrc
  • ~/.zshrc
  • ~/.profile

Variables already set in the environment take precedence.

# In ~/.bashrc or ~/.zshrc
export GITHUB_TOKEN="ghp_xxx"
export ANTHROPIC_API_KEY="sk-xxx"

CLI Reference

Usage: mcphub [options] [command]

Options:
  -V, --version           Output version number
  -c, --config <path>     Config file path
  -h, --help              Display help for command

Commands:
  start [options]         Start mcphub
    -p, --port <port>     Port number (default: 5431)
    --host <host>         Host to bind (default: 127.0.0.1)
    -d, --daemon          Run as daemon

  stop                    Stop the hub daemon
  restart [options]       Restart the hub daemon (background)

  add [options] <name>    Add a server
    --stdio <command>     Command for stdio server
    --url <url>           URL for HTTP server
    -e, --env <env...>    Environment variables (KEY=VALUE)
    --cwd <path>          Working directory (stdio only)

  remove <name>           Remove a server
  list                    List configured servers
  enable <names...>       Enable servers
  disable <names...>      Disable servers

  tools                   List all tools across servers
  tools disable <server> <tool>   Disable a tool
  tools enable <server> <tool>    Enable a tool

  status                  Show hub status (PID, port, servers)
  auth <name>             Authenticate OAuth-protected HTTP server
  config                  Show config file path

  install-service [--pin-version] [--system]   Install as boot-time service (per-user default; --system for system-wide)
  uninstall-service [--system]                 Remove boot-time service (--system for system-wide)

Troubleshooting

Service Won't Start

# Check logs
journalctl --user -u mcphub -f   # per-user (Linux)
journalctl -u mcphub -f          # system-wide (Linux)
tail -f ~/.config/mcphub/hub.log # Daemon mode

# Verify binary
mcphub --version
which mcphub

Per-user installs only run inside your login session. If the service doesn't start at boot, enable lingering once: loginctl enable-linger $USER.

Port Already in Use

mcphub stop
# Or change port
mcphub start --port 5432

Server Shows as Failed

mcphub status
# Check the "Failed backends" section
# Common issues: wrong URL, missing env vars, network unreachable

Links

  • MCP Protocol: https://modelcontextprotocol.io
  • Issues: https://github.com/taraksh01/mcphub/issues
  • Source: https://github.com/taraksh01/mcphub