
mcp-server-normahub
io.github.normahubcc/mcp-server-normahub
Multi-model LLM chat, comparison, routing, cost estimation, and image generation via Norma.
Documentation
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
- Live catalog (
GET /api/v1/public/models): models, endpoints, cache discounts, and USD pricing stay synchronized with a30-model non-video snapshot fallback. - Multi-protocol routing:
/v1/messages-only models likeclaude-opus-5-5work alongside/v1/chat/completionsmodels. - Cross-model comparison (
normahub_compare_models): run the same prompt across2–4models in parallel and inspect latency, tokens, and USD cost. - Hardened HTTP transport:
127.0.0.1loopback bind by default, Host & Origin DNS-rebinding guards, timing-safe Bearer auth,1 MiBlimit, cleanSIGTERMdrain.
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).
| Tool | Purpose | Hints |
|---|---|---|
normahub_list_models | Filter & paginate live catalog | readOnly |
normahub_recommend_model | Cost/capability model router | readOnly |
normahub_estimate_cost | Project token/cache or image USD | readOnly |
normahub_get_balance | Verify key & read balance | readOnly |
normahub_prompt_model | Prompt LLM (JSON & /v1/messages) | openWorld |
normahub_compare_models | Parallel 2-4 model comparison | openWorld |
normahub_generate_image | Generate images (image/URL) | openWorld |
Resources & Dynamic Prompts
- Resources:
normahub://models,normahub://models/{id}(live completion), keylessnormahub://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
| Variable | Default | Purpose |
|---|---|---|
NORMAHUB_API_KEY | - | API key for paid tools |
NORMAHUB_BASE_URL | api.normahub.cc/v1 | HTTPS gateway base URL |
NORMAHUB_CATALOG_URL | Public models API | Override live catalog URL |
NORMAHUB_DEFAULT_MODEL | claude-sonnet-5-5 | Default LLM ID |
NORMAHUB_DEFAULT_IMAGE_MODEL | Flagship model | Default image model ID |
NORMAHUB_TIMEOUT_MS | 120000 | Full-body timeout (ms) |
NORMAHUB_OFFLINE | 0 | Use snapshot only when 1 |
NORMAHUB_ALLOW_INSECURE_HTTP | 0 | Permit remote http:// |
NORMAHUB_MCP_AUTH_TOKEN | - | Static HTTP Bearer token |
NORMAHUB_MCP_PASSTHROUGH_AUTH | 0 (1 Docker) | Forward client Bearer |
NORMAHUB_MCP_ALLOWED_HOSTS | Loopback + host | Host header allowlist |
NORMAHUB_MCP_ALLOWED_ORIGINS | Loopback | CORS Origin allowlist |
NORMAHUB_MCP_ENABLE_LEGACY_SSE | 0 | Enable /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
@normahub/mcp-servernpm install @normahub/mcp-serverghcr.io/normahubcc/mcp-server:1.0.0docker pull ghcr.io/normahubcc/mcp-server:1.0.0:undefined