Repository avatar
AI Tools
v1.0.0
active

mcp-server-normahub

io.github.normahubcc/mcp-server-normahub

Multi-model LLM chat, comparison, routing, cost estimation, and image generation via Norma.

Documentation

@normahub/mcp-server

MCP Node License: MIT normahubcc/mcp-server-normahub MCP server

Official Model Context Protocol (MCP) server for Norma — compare multiple LLMs side-by-side, route tasks by live price and context window, call OpenAI/Anthropic/Google/xAI/DeepSeek models, and generate images directly from your IDE or AI client.

Architecture

Norma MCP Server Architecture
  • Live catalog (GET /api/v1/public/models): models, endpoints, cache discounts, and USD pricing stay synchronized with a 30-model non-video snapshot fallback.
  • Multi-protocol routing: /v1/messages-only models like claude-opus-5-5 work alongside /v1/chat/completions models.
  • Cross-model comparison (normahub_compare_models): run the same prompt across 2–4 models in parallel and inspect latency, tokens, and USD cost.
  • Hardened HTTP transport: 127.0.0.1 loopback bind by default, Host & Origin DNS-rebinding guards, timing-safe Bearer auth, 1 MiB limit, clean SIGTERM drain.

Capabilities (7 Tools, 3 Resources, 3 Prompts)

Tools

Every tool declares standard MCP ToolAnnotations and validates both inputs and structuredContent outputs against JSON Schema (zod).

ToolPurposeHints
normahub_list_modelsFilter & paginate live catalogreadOnly
normahub_recommend_modelCost/capability model routerreadOnly
normahub_estimate_costProject token/cache or image USDreadOnly
normahub_get_balanceVerify key & read balancereadOnly
normahub_prompt_modelPrompt LLM (JSON & /v1/messages)openWorld
normahub_compare_modelsParallel 2-4 model comparisonopenWorld
normahub_generate_imageGenerate images (image/URL)openWorld

Resources & Dynamic Prompts

  • Resources: normahub://models, normahub://models/{id} (live completion), keyless normahub://status.
  • Prompts: second_opinion, review_code, cost_optimize_route.

Quick Start (Stdio Clients)

Requires Node.js >= 22 and an optional API key from normahub.cc/dashboard for paid inference tools (catalog browsing, recommendation, cost estimation, and status work keyless).

Claude Desktop & Cursor (claude_desktop_config.json / ~/.cursor/mcp.json)

{
  "mcpServers": {
    "normahub": {
      "command": "npx",
      "args": ["-y", "@normahub/mcp-server"],
      "env": {
        "NORMAHUB_API_KEY": "nr_hub_your_key_here"
      }
    }
  }
}

VS Code (.vscode/mcp.json)

{
  "inputs": [
    {
      "type": "promptString",
      "id": "normahub_api_key",
      "description": "Norma API key",
      "password": true
    }
  ],
  "servers": {
    "normahub": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@normahub/mcp-server"],
      "env": {
        "NORMAHUB_API_KEY": "${input:normahub_api_key}"
      }
    }
  }
}

See examples/ for Claude Code, Codex CLI, Windsurf, Zed, and Continue.dev.

Streamable HTTP & Docker

normahub-mcp-http binds 127.0.0.1:3001 (POST /mcp, GET /health). Non-loopback binding (0.0.0.0) refuses to start without NORMAHUB_MCP_AUTH_TOKEN, NORMAHUB_MCP_PASSTHROUGH_AUTH=1, or explicit --unsafe-no-auth.

# Shared key protected by static Bearer token
HOST=0.0.0.0 NORMAHUB_MCP_AUTH_TOKEN="strong-secret" \
  NORMAHUB_API_KEY="nr_hub_your_key" npx -y -p @normahub/mcp-server \
  normahub-mcp-http

# Per-caller API key passthrough via Docker (default in Dockerfile)
docker run -p 127.0.0.1:3001:3001 ghcr.io/normahubcc/mcp-server:1.0.0

Configuration Reference

VariableDefaultPurpose
NORMAHUB_API_KEY-API key for paid tools
NORMAHUB_BASE_URLapi.normahub.cc/v1HTTPS gateway base URL
NORMAHUB_CATALOG_URLPublic models APIOverride live catalog URL
NORMAHUB_DEFAULT_MODELclaude-sonnet-5-5Default LLM ID
NORMAHUB_DEFAULT_IMAGE_MODELFlagship modelDefault image model ID
NORMAHUB_TIMEOUT_MS120000Full-body timeout (ms)
NORMAHUB_OFFLINE0Use snapshot only when 1
NORMAHUB_ALLOW_INSECURE_HTTP0Permit remote http://
NORMAHUB_MCP_AUTH_TOKEN-Static HTTP Bearer token
NORMAHUB_MCP_PASSTHROUGH_AUTH0 (1 Docker)Forward client Bearer
NORMAHUB_MCP_ALLOWED_HOSTSLoopback + hostHost header allowlist
NORMAHUB_MCP_ALLOWED_ORIGINSLoopbackCORS Origin allowlist
NORMAHUB_MCP_ENABLE_LEGACY_SSE0Enable /sse + /messages

Development

npm ci --ignore-scripts
npm run lint
npm run typecheck
npm test            # 100% offline test suite
npm run update:snapshot
npm run check:release

MIT License

NPM
@normahub/mcp-server
Install Command
npm install @normahub/mcp-server
OCI
ghcr.io/normahubcc/mcp-server:1.0.0
Install Command
docker pull ghcr.io/normahubcc/mcp-server:1.0.0:undefined