PluginBench
MCP Server
Stale
MIT

io.github.himorishige/hatago-mcp-hub MCP Server

io.github.himorishige/hatago-mcp-hub

Unified hub for managing multiple MCP servers with STDIO, HTTP, and SSE support.

What is the io.github.himorishige/hatago-mcp-hub MCP server?

Hatago MCP Hub is a lightweight hub that unifies access to multiple MCP (Model Context Protocol) servers from tools like Claude Code, Cursor, Windsurf, and VS Code. It supports local, NPX, and remote MCP servers with multi-transport connectivity (STDIO, HTTP, SSE) and includes features like environment variable expansion, tag-based filtering, and configuration inheritance.

Hatago MCP Hub acts as a relay point connecting AI tools to multiple MCP servers simultaneously. It eliminates the need to manage individual server connections by providing a single unified interface, supports both local and remote servers, and offers flexible configuration strategies for different environments and use cases.

How to install io.github.himorishige/hatago-mcp-hub

Copy-paste configuration for popular MCP clients.

transport: stdio
Config generated by PluginBench — verify against the source before use.
~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "hatago-mcp-hub": {
      "command": "npx",
      "args": [
        "-y",
        "@himorishige/hatago-mcp-hub"
      ]
    }
  }
}

Tools & capabilities

Tools this server exposes to the agent.

  • Server Management — Manage and route requests to multiple MCP servers (local, NPX, remote)
  • Multi-Transport Support — STDIO, HTTP, and SSE transport protocols for connecting to MCP servers
  • Remote MCP Proxy — Transparent connection to HTTP-based and SSE-based MCP servers
  • Configuration Management — Tag-based filtering, configuration inheritance, and environment variable expansion
  • Progress Notification Forwarding — Real-time progress updates from child servers
  • Built-in Resource Access — Access server snapshot via hatago://servers resource

Use cases

  • Connect Claude Code, Cursor, or Windsurf to multiple MCP servers with a single configuration
  • Manage development and production MCP server configurations using tag-based filtering or inheritance
  • Set up remote MCP server proxies for HTTP/SSE endpoints with custom headers and authentication
  • Monitor MCP server performance and tool availability via metrics endpoint
  • Dynamically load environment variables from files for secure credential management

io.github.himorishige/hatago-mcp-hub MCP server FAQ

What is Hatago MCP Hub?

Hatago MCP Hub is a lightweight relay hub that unifies access to multiple MCP servers. It allows you to connect tools like Claude Code, Cursor, and Windsurf to many MCP servers simultaneously through a single interface, supporting local, NPX, and remote servers.

Is Hatago MCP Hub free?

Yes, Hatago MCP Hub is open source under the MIT License and available for free on npm as @himorishige/hatago-mcp-hub.

How do I install it in Claude Code or Cursor?

For Claude Code: add the hatago server to .mcp.json with either STDIO mode (requires config file) or HTTP mode. For Cursor: use the same .mcp.json configuration. You can start with `npx @himorishige/hatago-mcp-hub init` to generate a config file.

Does Hatago MCP Hub require authentication?

Hatago itself does not require authentication, but individual MCP servers you connect may require credentials. You can pass environment variables (like GITHUB_TOKEN) through the configuration using ${VAR} syntax.

What transports does Hatago support?

Hatago supports STDIO (for local tools), HTTP (for remote access), and SSE (Server-Sent Events) for streaming connections. You can choose the appropriate transport when starting the server.

Can I use different configurations for different environments?

Yes, Hatago supports two strategies: tag-based filtering (group servers with tags and start with --tags flag) and configuration inheritance (extend base configs and override values for specific environments).

README (reference)

Source of truth, from the repository.

English | 日本語

🏮 Hatago MCP Hub

npm GitHub Release Ask DeepWiki

Hatago (旅籠) — A relay point connecting modern AI tools with MCP servers.

Overview

Hatago MCP Hub is a lightweight hub that unifies access to multiple MCP (Model Context Protocol) servers from tools like Claude Code, Codex CLI, Cursor, Windsurf, and VS Code.

Documentation

Dev.to: Getting Started with Multi-MCP Using Hatago MCP Hub — One Config to Connect Them All

✨ Features

🚀 Performance (v0.0.14)

  • 8.44x Faster Startup - 85.66ms → 10.14ms
  • 17% Smaller Package - 1.04MB → 854KB
  • Simplified Architecture - Direct server management without abstraction layers

🎯 Simple & Lightweight

  • Zero Configuration Start (HTTP mode) - npx @himorishige/hatago-mcp-hub serve --http
  • Non-invasive to Existing Projects - Doesn't pollute your project directory

🔌 Rich Connectivity

  • Multi-Transport Support - STDIO / HTTP / SSE
  • Remote MCP Proxy - Transparent connection to HTTP-based MCP servers
  • NPX Server Integration - Dynamic management of npm package MCP servers

🏮 Additional Features

Configuration Updates

  • Manual Restart Required - Configuration changes require server restart
  • Alternative Solutions:
    • Use process managers (PM2, nodemon) for auto-restart
    • Example: nodemon --exec "hatago serve --http" --watch hatago.config.json
    • Or with PM2: pm2 start "hatago serve" --watch hatago.config.json
  • Dynamic Tool List Updates - Supports notifications/tools/list_changed notification

Progress Notification Forwarding

  • Child Server Notification Forwarding - Transparent forwarding of notifications/progress
  • Long-running Operation Support - Real-time progress updates
  • Local/Remote Support - Works with many MCP server types

Built-in Internal Resource

  • hatago://servers - JSON snapshot of currently connected servers (id, status, type, tools, resources, prompts)

Enhanced Features

  • Environment Variable Expansion - Claude Code compatible ${VAR} and ${VAR:-default} syntax
  • Configuration Validation - Type-safe configuration with Zod schemas
  • Tag-based Server Filtering - Group and filter servers using tags
  • Configuration Inheritance - Extend base configurations with extends field for DRY principle

Minimal Hub Interface (IHub)

External packages (server/test-utils) use a thin IHub interface to avoid tight coupling with the concrete class.

import type { IHub } from '@himorishige/hatago-hub';
import { createHub } from '@himorishige/hatago-hub/node';

const hub: IHub = createHub({
  preloadedConfig: { data: { version: 1, mcpServers: {} } }
}) as IHub;
await hub.start();
hub.on('tool:called', (evt) => {
  /* metrics, logs */
});
await hub.stop();

Extracted modules for thin hub:

  • RPC handlers: packages/hub/src/rpc/handlers.ts
  • HTTP handler: packages/hub/src/http/handler.ts

📁 Project Structure

packages/
├── mcp-hub/        # Main npm package (@himorishige/hatago-mcp-hub)
├── server/         # Server implementation (@himorishige/hatago-server)
├── hub/            # Hub core (@himorishige/hatago-hub)
├── core/           # Shared types (@himorishige/hatago-core)
├── runtime/        # Runtime components (@himorishige/hatago-runtime)
├── transport/      # Transport layer (@himorishige/hatago-transport)
├── cli/            # CLI tools (@himorishige/hatago-cli)
├── hub-management/ # Management components (@himorishige/hatago-hub-management)
└── test-fixtures/  # Test utilities

📦 Installation

Quick Start (No Installation)

# Initialize configuration
npx @himorishige/hatago-mcp-hub init

# Start in STDIO mode (for Claude Code)
# NOTE: STDIO requires a config file path
npx @himorishige/hatago-mcp-hub serve --stdio --config ./hatago.config.json

# Or start in HTTP mode without a config (demo/dev)
npx @himorishige/hatago-mcp-hub serve --http

Global Installation

# Install globally
npm install -g @himorishige/hatago-mcp-hub

# Use with hatago command
hatago init
hatago serve

As Project Dependency

# Install as dependency
npm install @himorishige/hatago-mcp-hub

# Add to package.json scripts
{
  "scripts": {
    "mcp": "hatago serve"
  }
}

🚀 Usage

Claude Code, Codex CLI, Gemini CLI

STDIO Mode (Recommended)

Claude Code / Gemini CLI

Add to .mcp.json:

{
  "mcpServers": {
    "hatago": {
      "command": "npx",
      "args": [
        "@himorishige/hatago-mcp-hub",
        "serve",
        "--stdio",
        "--config",
        "./hatago.config.json"
      ]
    }
  }
}
Codex CLI

Add to ~/.codex/config.toml:

[mcp_servers.hatago]
command = "npx"
args = ["-y", "@himorishige/hatago-mcp-hub", "serve", "--stdio", "--config", "./hatago.config.json"]

HTTP Mode

Claude Code / Gemini CLI

Add to .mcp.json:

{
  "mcpServers": {
    "hatago": {
      "url": "http://localhost:3535/mcp"
    }
  }
}
Codex CLI

Add to ~/.codex/config.toml:

[mcp_servers.hatago]
command = "npx"
args = ["-y", "mcp-remote", "http://localhost:3535/mcp"]

MCP Inspector

For testing and debugging:

# Start in HTTP mode
hatago serve --http --port 3535

# Connect with MCP Inspector
# Endpoint: http://localhost:3535/mcp

Visit MCP Inspector

Metrics (opt-in)

Enable lightweight in-memory metrics and expose an HTTP endpoint:

HATAGO_METRICS=1 hatago serve --http --port 3535
# Then visit: http://localhost:3535/metrics

Notes:

  • Metrics are disabled by default and add near-zero overhead when off.
  • JSON logs are available when HATAGO_LOG=json (respecting HATAGO_LOG_LEVEL).

⚙️ Configuration

Basic Configuration

Create hatago.config.json:

{
  "$schema": "https://raw.githubusercontent.com/himorishige/hatago-mcp-hub/main/schemas/config.schema.json",
  "version": 1,
  "logLevel": "info",
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_TOKEN": "${GITHUB_TOKEN}"
      }
    }
  }
}

Remote Server Configuration

{
  "mcpServers": {
    "deepwiki": {
      "url": "https://mcp.deepwiki.com/sse",
      "type": "sse"
    },
    "custom-api": {
      "url": "https://api.example.com/mcp",
      "type": "http",
      "headers": {
        "Authorization": "Bearer ${API_KEY}"
      }
    }
  }
}

Configuration Strategies

Strategy 1: Tag-based Filtering

Group servers with tags in a single configuration file:

{
  "mcpServers": {
    "filesystem-dev": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "."],
      "tags": ["dev", "local"]
    },
    "github-prod": {
      "url": "https://api.github.com/mcp",
      "type": "http",
      "tags": ["production", "github"]
    },
    "database": {
      "command": "mcp-server-postgres",
      "tags": ["dev", "production", "database"]
    }
  }
}

Start with specific tags:

# Only start servers tagged as "dev"
hatago serve --tags dev

# Start servers with either "dev" or "test" tags
hatago serve --tags dev,test

# Japanese tags are supported
hatago serve --tags 開発,テスト

Strategy 2: Configuration Inheritance

Split configurations by environment using the extends field:

Base configuration (~/.hatago/base.config.json):

{
  "version": 1,
  "logLevel": "info",
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_TOKEN": "${GITHUB_TOKEN}"
      }
    },
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "."]
    }
  }
}

Work configuration (./work.config.json):

{
  "extends": "~/.hatago/base.config.json",
  "logLevel": "debug",
  "mcpServers": {
    "github": {
      "env": {
        "GITHUB_TOKEN": "${WORK_GITHUB_TOKEN}",
        "DEBUG": null
      }
    },
    "internal-tools": {
      "url": "https://internal.company.com/mcp",
      "type": "http",
      "headers": {
        "Authorization": "Bearer ${INTERNAL_TOKEN}"
      }
    }
  }
}

Features:

  • Inheritance: Child configs override parent values
  • Multiple parents: "extends": ["./base1.json", "./base2.json"]
  • Path resolution: Supports ~, relative, and absolute paths
  • Environment deletion: Use null to remove inherited env vars

Choosing a Strategy

StrategyTag-basedInheritance-based
FilesSingle configMultiple configs
Switch--tags option--config option
ManagementCentralizedDistributed
Best forTeam sharing, Simple setupsComplex environments, Personal customization

Environment Variable Expansion

Supports Claude Code compatible syntax:

  • ${VAR} - Expands to the value of VAR (error if undefined)
  • ${VAR:-default} - Uses default value if VAR is undefined

📋 Commands

hatago init

Create configuration file with interactive setup:

hatago init                    # Interactive mode
hatago init --mode stdio       # STDIO mode config
hatago init --mode http        # HTTP mode config
hatago init --force            # Overwrite existing

hatago serve

Start MCP Hub server:

hatago serve --stdio --config ./hatago.config.json  # STDIO mode (default, requires config)
hatago serve --http                                     # HTTP mode (config optional)
hatago serve --config custom.json  # Custom config
hatago serve --verbose         # Debug logging
hatago serve --tags dev,test   # Filter servers by tags
hatago serve --env-file ./.env # Load variables from .env before start (repeatable)
hatago serve --env-override    # Override existing env vars when using --env-file

Loading Environment Variables from Files

Use --env-file <path...> to load variables before config parsing. This helps resolve ${VAR} and ${VAR:-default} placeholders without exporting variables globally.

  • Format: KEY=VALUE, export KEY=VALUE, # comments, blank lines.
  • Quotes are stripped; supports escaped \n, \r, \t.
  • Paths: relative to CWD, ~/ expanded to home.
  • Precedence: files are applied in the given order; existing process.env keys are preserved unless --env-override is provided.

✨ Performance Improvements (v0.0.14)

  • 8.44x faster startup: 85.66ms → 10.14ms
  • 17% smaller package: 1.04MB → 854KB (181KB reduction)
  • Simplified architecture: Removed EnhancedHub and management layers
  • Trade-off: Built-in config watching removed (use nodemon/PM2 instead)

🔧 Advanced Usage

Programmatic API

import { startServer } from '@himorishige/hatago-mcp-hub';

// Start server programmatically
await startServer({
  mode: 'stdio',
  config: './hatago.config.json',
  logLevel: 'info'
});

Creating Custom Hub

import { createHub } from '@himorishige/hatago-mcp-hub';

const hub = createHub({
  mcpServers: {
    memory: {
      command: 'npx',
      args: ['@modelcontextprotocol/server-memory']
    }
  }
});

// Use hub directly in your application
const tools = await hub.listTools();

🏗️ Architecture

Client (Claude Code, etc.)
    ↓
Hatago Hub (Router + Registry)
    ↓
MCP Servers (Local, NPX, Remote)

Supported MCP Servers

Local Servers

  • Any executable MCP server
  • Python, Node.js, or binary servers
  • Custom scripts with MCP protocol

NPX Servers

  • @modelcontextprotocol/server-filesystem
  • @modelcontextprotocol/server-github
  • @modelcontextprotocol/server-memory
  • Any npm-published MCP server

Remote Servers

  • DeepWiki MCP (https://mcp.deepwiki.com/sse)
  • Any HTTP-based MCP endpoint
  • Custom API servers with MCP protocol

🐛 Troubleshooting

Common Issues

  1. "No onNotification handler set" warning

    • Normal in HTTP mode with StreamableHTTP transport
    • Hub handles notifications appropriately
  2. Server connection failures

    • Verify environment variables are set
    • Check remote server URLs are accessible
    • Use --verbose flag for detailed logs
  3. Tool name collisions

    • Hatago automatically prefixes with server ID
    • Original names preserved in hub

Debug Mode

# Enable verbose logging
hatago serve --verbose

# Check server status
hatago status

📚 Documentation

🤝 Contributing

Contributions are welcome! Please see our GitHub repository for more information.

📄 License

MIT License

🔗 Links

🙏 Credits

Built with the Hono and the Model Context Protocol SDK by Anthropic.

Related MCP servers

Control Windows desktop via MCP: mouse, keyboard, screenshots, clipboard, and apps.

0
TypeScript
View repository →

Japan business regulations, compliance, travel, protocols, memory — 10 knowledge domains, 23 tools.

0
HTML
MIT
View repository →

Japan Operations OS for AI agents — 14 knowledge domains, 31 tools via REST+MCP.

0
HTML
MIT
View repository →

Japan market intelligence — 22 MCP tools, 10 government/exchange data sources

0
Python
View repository →

AI fashion design MCP: generate concepts, models, fabrics & looks live on your StyTrix canvas.

0
View repository →

AI-grounded Obsidian vault integration with timeline, graph, and canon workflow for worldbuilding and knowledge management.

10
TypeScript
MIT
View repository →