convez.ai
MCP ServerIntegração & APIsAvançado
alexalexiuc

my-hub: MCP Server Multi-tenant com Dashboard

alexalexiuc/my-hub

MCP hub self-hosted com autenticação segura e dashboard de dados pessoais

Ver no GitHub
InicialPluginScore · de 0 a 100

Hub MCP auto-hospedado que expõe dois servidores (Calorias e Todo) para agentes Claude, protegido por OAuth 2.1 + PKCE. Inclui dashboard Next.js para gerenciar dados pessoais, clientes autenticados e logs de requisições. Arquitetura monorepo em TypeScript com Fastify, PostgreSQL e Docker.

Instalação

$npx convez-ai alexalexiuc/my-hub

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
0
Forks
1
Acompanhando
0
Saúde
28%
Último commit
há 2 dias
Versão
—
Issues abertas
4
Contribuidores
4

Casos de uso

  • Conectar Claude ou outros clientes MCP a dados pessoais (calorias, tarefas) de forma segura
  • Gerenciar múltiplos clientes OAuth e rastrear requisições via dashboard
  • Construir um servidor MCP pronto para produção com infraestrutura completa (auth, DB, UI)

Veredito

Exemplo sólido e bem arquitetado de um MCP server em produção com monorepo, autenticação OAuth 2.1 e dashboard administrativo. Ideal para quem quer entender a integração de agentes Claude com dados pessoais em ambiente seguro e self-hosted.

README

A tradução para o português deste README ainda está na fila.

my-hub

A self-hosted personal MCP (Model Context Protocol) hub that gives Claude AI agents access to your personal data — calorie tracking, todos, and more — through a secure OAuth 2.1 layer.

What it does

my-hub runs two MCP servers behind a single authenticated endpoint:

  • Calories — log meals, track macros, set weight goals, record body measurements, and get AI-driven progress analysis over rolling 7 or 30-day windows
  • Todo — manage a simple personal todo list

Claude (or any MCP-compatible client) connects to the hub, authenticates via OAuth 2.1 + PKCE, and can then call tools and read resources to answer questions like "how are my calories this week?" or "add milk to my shopping list".

A Next.js dashboard (hub) lets you view and manage all your data in one place: meal history with charts, weight trends, OAuth clients, invite tokens, and MCP request logs.

Packages

PackagePurpose
packages/mcp-serverFastify HTTP server — MCP transport, OAuth endpoints, tool & resource registration
packages/hubNext.js admin dashboard — data UI, OAuth client management, request monitoring
packages/sharedDrizzle ORM schema, service layer, shared types — the single source of truth for all DB access
packages/e2ePlaywright end-to-end tests

Tech stack

  • Runtime: Node.js 24+, TypeScript (ESM, strict)
  • MCP: @modelcontextprotocol/sdk 1.x
  • API server: Fastify
  • Frontend: Next.js 16 App Router, React 18, Tailwind CSS, Recharts
  • Database: PostgreSQL 18, Drizzle ORM
  • Auth: OAuth 2.1 + PKCE, NextAuth.js (Google OAuth for the dashboard)
  • Build: Turbo, tsup, pnpm workspaces
  • Testing: Vitest (unit), Playwright (e2e)
  • Infra: Docker Compose, Traefik (reverse proxy + TLS)

Quick start

Prerequisites

  • Node.js 24+, pnpm 9+
  • Docker & Docker Compose (for the database)
  • A PostgreSQL 18 instance or use the local Compose stack

1. Install dependencies

pnpm install

2. Configure environment

cp .env.example .env
# Fill in the required values — see comments in .env.example

Key variables:

VariableDescription
DATABASE_URLPostgreSQL connection string
MCP_SERVER_PORTPort for the MCP/Fastify server (default 3001)
HUB_PORTPort for the Next.js dashboard (default 3000)
NEXTAUTH_SECRETRandom secret for NextAuth session signing
GOOGLE_CLIENT_ID / SECRETGoogle OAuth credentials for dashboard login
MCP_JWT_SECRETSecret for signing MCP session tokens
ENCRYPTION_KEYKey for encrypting stored OAuth tokens

3. Run database migrations

pnpm db:migrate

4. Start in development mode

pnpm dev

This starts both the MCP server (:3001) and the hub dashboard (:3000) in watch mode via Turbo.

MCP servers

Calories (/api/calories/mcp)

Resources

URIDescription
calories://profileTDEE, calorie targets (goal/min/max), and latest body measurements
calories://todayAll meals logged today with macro totals and progress vs target
calories://history-7daysRolling 7-day summary — per-day calories & macros, weight logs, period averages
calories://history-30daysSame structure as history-7days but covering the last 30 days

Tools

ToolDescription
calories_log_mealLog a meal; supports multi-item entries in one call
calories_get_mealsRetrieve individual meal entries (with meal_ids for deletion)
calories_delete_mealDelete a meal by meal_id
calories_update_profileSet demographics, activity level, and weight goal
calories_get_daily_summaryFull calorie/macro breakdown for a specific date
calories_get_historyCalorie and weight history for a custom date range
calories_log_measurementLog a body measurement (weight, waist, etc.)
calories_get_measurementsRetrieve measurement entries by type and/or date range
calories_get_measurement_typesList available measurement types with units
calories_delete_measurementDelete a measurement entry by ID

Todo (/api/todo/mcp)

ToolDescription
todo_addAdd a new todo item
todo_mark_doneMark a todo as done by ID
todo_listList all todos (open and completed)

Connecting Claude to your hub

  1. In the dashboard, go to OAuth Clients and register a new client for Claude.ai
  2. In Claude.ai settings, add an MCP server pointing to https://your-domain/api/calories/mcp (or /api/todo/mcp)
  3. Authorise via the OAuth flow — Claude will then have access to your tools and resources

Deployment

The infra/ directory contains Docker Compose files for each environment:

# Local — direct ports, no Traefik
pnpm start:local

# Production — pulls images from GHCR, Traefik for TLS + routing
pnpm start:prod

Services:

ServiceImageDefault port
dbpostgres:185432 (internal)
mcpNode.js / Fastify3001
hubNext.js3000
proxyTraefik80 / 443

See docs/server-setup.md for VPS provisioning and docs/mcp-oauth-flow.md for the full OAuth 2.1 + PKCE flow.

Development

pnpm build        # Build all packages
pnpm typecheck    # TypeScript type-check
pnpm lint         # ESLint
pnpm lint:fix     # ESLint with auto-fix
pnpm format       # Prettier
pnpm test         # Vitest unit tests
pnpm test:e2e     # Playwright e2e tests
pnpm db:generate  # Generate Drizzle migrations from schema changes
pnpm db:migrate   # Apply pending migrations
pnpm db:studio    # Open Drizzle Studio

Change order when modifying across packages:

  1. packages/shared — schema, services, types first
  2. packages/mcp-server — tools and resources
  3. packages/hub — UI pages
  4. infra/ — Docker / Traefik config

License

MIT

Ver o original no GitHub

Bom para

Relacionados