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

@yan-sheng-li/mcp-center

v1.0.15

Published

MCP Server management tool that aggregates multiple MCP servers

Downloads

729

Readme

MCP Center

MCP Center is a local MCP gateway with a built-in Web UI. It manages multiple child MCP servers, keeps their configuration in one place, and exposes a single Streamable HTTP MCP endpoint for your MCP client to connect to.

MCP Center can aggregate capabilities from:

  • HTTP MCP servers
  • local stdio MCP servers
  • WebSocket bridge clients that connect back to MCP Center

It currently republishes these MCP capabilities through the main endpoint:

  • tools
  • resources
  • resource templates
  • prompts

WebSocket bridge clients currently contribute tools only. Resources, resource templates, and prompts from WebSocket bridge clients are not exposed.

To avoid collisions, every exposed capability is prefixed with the child server name:

  • tool: exa_web_search_exa
  • resource: filesystem_file:///tmp/a.txt
  • prompt: docs_summarize
  • WebSocket bridge tool: my_agent_search

Usage Model

Run MCP Center directly with npx, then connect your MCP client to the HTTP endpoint it starts:

  1. Start mcp-center with npx @yan-sheng-li/mcp-center
  2. Open the Web UI to add or edit HTTP/stdio child MCP servers
  3. Optionally let remote/local agents connect as WebSocket bridge clients
  4. Point your MCP client at http://localhost:3000/mcp

Quick Start

1. Start MCP Center

npx @yan-sheng-li/mcp-center

This command executes the package's CLI entry directly. No global install is required.

By default it uses ~/.mcp-center/mcp.json. If the file does not exist, it will be created automatically as:

{
  "servers": []
}

You can also pass a custom config path:

npx @yan-sheng-li/mcp-center --config /path/to/mcp.json

Or:

npx @yan-sheng-li/mcp-center /path/to/mcp.json

2. Open the Web UI

Open:

http://localhost:3000/ui

From the UI you can:

  • add HTTP or stdio child MCP servers
  • edit server config
  • enable or disable a configured server
  • delete a configured server
  • probe a server before saving to inspect tools/resources/templates/prompts
  • selectively enable only part of a configured server's capabilities
  • view connection status and loaded capabilities
  • view connected WebSocket bridge clients as read-only, auto-registered servers

3. Connect your MCP client to MCP Center

Use this endpoint:

http://localhost:3000/mcp

Your MCP client must support Streamable HTTP transport.

Server Profiles

MCP Center supports server profiles for scene-based switching. Create profiles to define which servers are enabled for different use cases:

  • Create a profile with a subset of servers (e.g., "Writing" profile with only docs/search tools)
  • Quickly switch between profiles without manually toggling individual servers
  • Useful when you need different server combinations for different tasks

Profile Operations

From the Web UI (http://localhost:3000/ui):

  • Click "+ New Profile" to create a profile and select which servers to include
  • Click "Manage Profiles" to edit, delete, or activate/deactivate profiles
  • Click the profile dropdown to quickly switch between profiles

Profile API

  • GET /api/profiles - list all profiles and active profile
  • POST /api/profiles - create a new profile
  • PUT /api/profiles/:name - update a profile
  • DELETE /api/profiles/:name - delete a profile
  • POST /api/profiles/activate - activate a profile (enables only selected servers)
  • POST /api/profiles/deactivate - deactivate profile (enable all servers)

Backup & Restore

MCP Center supports exporting and restoring your configuration and usage data:

  • Export a ZIP backup containing mcp.json and stats.db
  • Import a backup ZIP to restore configuration
  • Useful for migrating to a new machine or backing up before major changes

Backup Operations

From the Web UI (http://localhost:3000/ui):

  • Click "Backup" to download a timestamped ZIP backup
  • Click "Restore" to upload and restore from a backup ZIP

Backup API

  • GET /api/backup/export - download backup ZIP
  • POST /api/backup/import - upload and restore from ZIP

Statistics Dashboard

MCP Center tracks tool usage and provides a visual dashboard:

  • Overview of total calls, unique tools, and active servers
  • Per-tool usage statistics and call counts
  • Timeline chart showing usage over time
  • Recent call history

Access Dashboard

Open http://localhost:3000/dashboard to view the statistics dashboard with ECharts visualizations.

Stats API

  • GET /api/stats/overview - overview statistics (total calls, unique tools, active servers)
  • GET /api/stats/tools - per-tool usage statistics
  • GET /api/stats/timeline - usage over time
  • GET /api/stats/recent - recent call history
  • Optional ?period=24h|7d|30d query parameter (default: 24h)

WebSocket Bridge

MCP Center also starts a WebSocket bridge server on the same port:

ws://localhost:3000/ws/:serverName

A WebSocket bridge client connects to this URL and behaves like a lightweight MCP server over a JSON-RPC WebSocket connection. MCP Center performs an MCP-style handshake, lists the client's tools, auto-registers the connected client as a server, and exposes those tools through the normal Streamable HTTP MCP endpoint at /mcp.

This is useful when a tool provider cannot be launched by MCP Center as stdio and cannot be reached as an HTTP MCP server, for example:

  • a browser extension or desktop app that can open an outbound WebSocket connection
  • a remote worker behind NAT/firewall that can connect out to MCP Center
  • a long-running app that wants to dynamically publish tools while it is connected

Bridge lifecycle

  1. Start MCP Center.
  2. A bridge client connects to ws://localhost:3000/ws/<serverName>.
  3. MCP Center sends initialize to the bridge client.
  4. MCP Center sends tools/list to discover tools.
  5. The bridge client appears in the Web UI as a WSBRIDGE server.
  6. Tools are exposed to MCP clients with the same server-name prefix rule, for example agent1_echo.
  7. When an MCP client calls that tool through /mcp, MCP Center forwards a tools/call request over the WebSocket.
  8. When the WebSocket disconnects, the bridge server is removed from the loaded capability list.

If another WebSocket connects with the same serverName, the previous connection for that name is closed and replaced.

Bridge protocol

The bridge connection uses JSON-RPC 2.0 messages over WebSocket.

After the WebSocket upgrade, MCP Center sends:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "initialize",
  "params": {
    "protocolVersion": "2025-03-26",
    "capabilities": {},
    "clientInfo": {
      "name": "mcp-center",
      "version": "1.0.0"
    }
  }
}

The bridge client should return a JSON-RPC result, for example:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "protocolVersion": "2025-03-26",
    "capabilities": {
      "tools": {}
    },
    "serverInfo": {
      "name": "my-agent",
      "version": "1.0.0"
    }
  }
}

MCP Center then sends tools/list:

{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/list"
}

The bridge client should return tools in normal MCP shape:

{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "tools": [
      {
        "name": "echo",
        "description": "Echo input text",
        "inputSchema": {
          "type": "object",
          "properties": {
            "text": {
              "type": "string"
            }
          },
          "required": ["text"]
        }
      }
    ]
  }
}

When an MCP client calls the exposed tool, for example my_agent_echo, MCP Center forwards the original tool name to the bridge client:

{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "name": "echo",
    "arguments": {
      "text": "hello"
    }
  }
}

The bridge client should return a normal MCP tool result:

{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "hello"
      }
    ]
  }
}

If a request fails, return a JSON-RPC error:

{
  "jsonrpc": "2.0",
  "id": 3,
  "error": {
    "code": -32000,
    "message": "Something went wrong"
  }
}

Minimal bridge client example

Install ws in your client project, then run this script while MCP Center is running:

import WebSocket from 'ws';

const serverName = 'demo-agent';
const ws = new WebSocket(`ws://localhost:3000/ws/${encodeURIComponent(serverName)}`);

const tools = [
  {
    name: 'echo',
    description: 'Echo input text',
    inputSchema: {
      type: 'object',
      properties: {
        text: { type: 'string' }
      },
      required: ['text']
    }
  }
];

ws.on('open', () => {
  console.log(`Connected to MCP Center as ${serverName}`);
});

ws.on('message', (data) => {
  const msg = JSON.parse(data.toString());
  if (!msg || msg.jsonrpc !== '2.0' || msg.id == null) return;

  if (msg.method === 'initialize') {
    ws.send(JSON.stringify({
      jsonrpc: '2.0',
      id: msg.id,
      result: {
        protocolVersion: msg.params?.protocolVersion || '2025-03-26',
        capabilities: { tools: {} },
        serverInfo: { name: serverName, version: '1.0.0' }
      }
    }));
    return;
  }

  if (msg.method === 'tools/list') {
    ws.send(JSON.stringify({
      jsonrpc: '2.0',
      id: msg.id,
      result: { tools }
    }));
    return;
  }

  if (msg.method === 'tools/call') {
    const { name, arguments: args = {} } = msg.params || {};
    if (name === 'echo') {
      ws.send(JSON.stringify({
        jsonrpc: '2.0',
        id: msg.id,
        result: {
          content: [
            { type: 'text', text: String(args.text ?? '') }
          ]
        }
      }));
    } else {
      ws.send(JSON.stringify({
        jsonrpc: '2.0',
        id: msg.id,
        error: { code: -32601, message: `Unknown tool: ${name}` }
      }));
    }
  }
});

ws.on('close', () => console.log('Disconnected from MCP Center'));
ws.on('error', (err) => console.error('WebSocket error:', err));

After the script connects, open http://localhost:3000/ui. You should see demo-agent with type WSBRIDGE. MCP clients connected to http://localhost:3000/mcp can call the tool as:

demo-agent_echo

WebSocket bridge notes and limits

  • Bridge servers are not stored in mcp.json; they are auto-registered while connected.
  • Bridge servers are shown in the UI as read-only entries.
  • Only tools are loaded from bridge clients.
  • Tool calls over the bridge time out after 60 seconds.
  • Handshake/list requests time out after 15 seconds.
  • MCP Center sends WebSocket ping frames every 30 seconds as keepalive.
  • Server names are taken from the URL path and sanitized only when constructing aggregated tool names: characters outside [a-zA-Z0-9_-] become _.
  • There is no authentication or authorization on /ws/:serverName in the current implementation. If exposing MCP Center beyond localhost, put it behind a trusted network boundary or reverse proxy that enforces access control.