I built a self-hosted MCP server registry and proxy in TypeScript

작성자

카테고리:

← 피드로
DEV Community · Diya · 2026-06-14 개발(SW)

Diya

The official MCP registry is written in Go and cloud-hosted.
I wanted something I could self-host, written in TypeScript,
that my team could run inside our own infra.

So I built mcp-hub.

What it does

  • Register any MCP server (SSE, HTTP, stdio transports)
  • Proxy all tool calls through one endpoint with auth forwarding
  • Stream every tool call live via WebSocket (Socket.io)
  • Monitor server health async via BullMQ jobs

Stack

  • NestJS — API framework
  • PostgreSQL — server registry + tool call logs
  • Redis — WebSocket pub/sub + BullMQ transport
  • BullMQ — async health check queue
  • Socket.io — real-time log streaming

How it works

Register a server once:

curl -X POST http://localhost:3000/api/v1/servers 
  -H 'Content-Type: application/json' 
  -d '{
    "name": "github-mcp",
    "url": "http://my-mcp-server:8080",
    "transport": "http"
  }'

Enter fullscreen mode Exit fullscreen mode

Then proxy any tool call through mcp-hub:

curl -X POST http://localhost:3000/api/v1/proxy/{serverId}/call 
  -H 'Content-Type: application/json' 
  -d '{ "tool": "create_issue", "input": { "title": "Bug" } }'

Enter fullscreen mode Exit fullscreen mode

Every call is logged to PostgreSQL and streamed live over WebSocket.

Run it in one command

git clone https://github.com/DIYA73/mcp-hub
cd mcp-hub
cp .env.example .env
docker compose up

Enter fullscreen mode Exit fullscreen mode

API at http://localhost:3000/api/v1
WebSocket at ws://localhost:3000/logs

Why I built this

I’m running multiple MCP servers locally and needed a central
place to register them, forward calls, and see what’s happening
in real time. Nothing TypeScript-native existed.

GitHub: https://github.com/DIYA73/mcp-hub

Feedback welcome — especially if you’re running MCP servers in prod.

원문에서 계속 ↗

코멘트

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다