Skip to main content
Glama

gtwmcp — MCP Gateway

CI npm version node license dependencies

A zero-dependency MCP gateway. Connect multiple AI harnesses to multiple MCP servers through a single, centrally-managed stdio interface. No overhead, no bloat — just the Node.js stdlib. Secrets stay in the OS keychain, never in config files.

Architecture

Install

npm install -g gtwmcp

Requires Node.js >= 22.

Related MCP server: Multi MCP

Quick Start

Add a stdio MCP server:

$ gtwmcp add github --type stdio --command npx --args "-y,@modelcontextprotocol/server-github" --description "GitHub MCP"
Server "github" added.

Add an SSE MCP server with OAuth:

$ gtwmcp add jira --type sse --url https://mcp.jira.example.com/sse --oauth --description "Jira MCP"
Server "jira" added.

List servers:

$ gtwmcp list
NAME    TYPE   STATUS       DESCRIPTION
------  -----  -----------  -----------
github  stdio  ✅ enabled   GitHub MCP
jira    sse    ✅ enabled   Jira MCP

Authenticate an OAuth server:

$ gtwmcp auth jira
[jira] https://mcp.jira.example.com/sse
  ✅ Token valid (expires in 45m)

$ gtwmcp auth --force          # re-authenticate all OAuth servers

List tools from a server:

$ gtwmcp get jira
jira (sse) — https://mcp.jira.example.com/sse
Listing tools...

  1. search_jira_issues: Search Jira issues using JQL
  2. get_jira_issue: Get a specific Jira issue

2 tools available.

CLI Reference

gtwmcp add    <name>    Add or update an MCP server
gtwmcp remove <name>    Remove an MCP server
gtwmcp get    <name>    List tools and descriptions from a server
gtwmcp list             List all servers with status
gtwmcp auth   [name]    Authenticate OAuth servers (--force to re-auth)
gtwmcp enable <name>    Enable a server
gtwmcp disable <name>   Disable a server
gtwmcp serve            Start the MCP gateway in stdio mode

Gateway

The gateway (gtwmcp serve) speaks MCP over stdio to the client. On startup it:

  1. Reads ~/.gtwmcp.json

  2. Connects to all enabled upstream servers in parallel

  3. Calls initialize and tools/list on each

  4. Prefixes every tool with the server name: <server>__<tool>

  5. Applies allow/block list filters

  6. Presents a single consolidated tool list

Gateway

Tool Filtering

Control which tools are exposed via environment variables:

Variable

Behavior

GTWMCP_ALLOW_LIST

Only matching tools pass

GTWMCP_BLOCK_LIST

All tools except matching pass

Both set

Allow first, then block removes from that subset

Neither set

All tools pass

Patterns support trailing * wildcard:

# Expose only read tools
GTWMCP_ALLOW_LIST="github__read_*,github__search_*,github__list_*"

# Expose everything except destructive tools
GTWMCP_BLOCK_LIST="github__delete_*,github__admin_*"

Configuration

~/.gtwmcp.json:

{
  "version": 1,
  "servers": {
    "github": {
      "type": "stdio",
      "enabled": true,
      "description": "GitHub MCP server",
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_xxxxxxxxxxxx"
      }
    },
    "jira": {
      "type": "sse",
      "enabled": true,
      "description": "Jira MCP",
      "url": "https://mcp.jira.example.com/sse",
      "headers": {
        "X-Custom-Header": "value"
      },
      "oauth": true
    }
  }
}
  • stdio: command, args, optional env and description

  • sse: url, optional headers, oauth, and description

  • "oauth": true means all OAuth data lives in the OS keychain (never in this file)

OAuth

The gateway supports Authorization Code Flow with PKCE for SSE servers.

OAuth Flow

At runtime, gtwmcp serve auto-refreshes expired tokens before each call.

Keychain

Platform

Backend

macOS

/usr/bin/security (Keychain)

Linux

secret-tool (libsecret)

Use with Claude Code

Point Claude Code's MCP config at the gateway:

{
  "mcpServers": {
    "gtwmcp": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "gtwmcp", "serve"]
    }
  }
}

All your upstream MCP tools appear prefixed and unified in Claude Code.

Development

npm install
npm run check   # syntax validation
npm test        # 57 tests

Zero external dependencies. Node.js 22+ stdlib only.

A
license - permissive license
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    A Model Context Protocol server manager that acts as a proxy/multiplexer, enabling connections to multiple MCP servers simultaneously and providing JavaScript code execution with access to all connected MCP tools. Supports both stdio and HTTP transports with OAuth authentication, batch tool invocation, and dynamic server management.
    Last updated
    36
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    A flexible proxy server that aggregates multiple backend MCP servers into a single interface using STDIO or SSE transports. It supports dynamic server management via an HTTP API and utilizes namespacing to prevent tool conflicts across connected services.
    Last updated
    3
    1
    MIT
  • A
    license
    -
    quality
    B
    maintenance
    Self-hosted MCP proxy and aggregation platform. Register multiple upstream MCP servers and expose them through a single unified endpoint with namespace routing, multi-transport support (HTTP/SSE, stdio, OpenAPI→MCP), per-tool overrides, and a web admin UI.
    Last updated
    15
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Aggregates multiple upstream MCP servers into a single stdio-only runtime with a compact surface exposing only invoke and read.
    Last updated
    2
    2
    MIT

View all related MCP servers

Related MCP Connectors

  • Real-time chat hub for AI agents — Claude Code, Cursor, Cline, Codex over MCP or REST.

  • Real-time chat hub for AI agents — Claude Code, Cursor, Cline, Codex over MCP or REST.

  • Streamable HTTP MCP server for Google Calendar and Sheets with OAuth login.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pcandido/gtwmcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server