{
  "markdown": "# @gammainfra/mcp-server\n\nModel Context Protocol (MCP) server for [GammaInfra](https://gammainfra.com) — intelligent LLM routing across every major provider via one OpenAI-shape API.\n\nDrop this server into Claude Code, Claude Desktop, Cursor, Cline, Continue, or any MCP-compatible host, and your agent gets direct tool access to:\n\n- **`chat_completions`** — call any supported model (or `gammainfra/auto` for smart routing) with cost, latency, and quality controls. Routing metadata (which provider served, exact cost in USD, fallback chain) is returned as a structured `routing_meta` field.\n- **`list_models`** — full model catalog with pricing and capability flags.\n- **`get_balance`** — managed + BYOK balances.\n- **`get_status`** — overall + per-provider health, 24h request count.\n\n## Quickstart\n\n1. Get a GammaInfra API key — sign up free at <https://gammainfra.com/signup> ($3 trial credit, no credit card).\n2. Add the server to your MCP client config (instructions per client below).\n3. Restart the client. The four tools become available to your agent immediately.\n\n## Installation\n\nThe server runs via `npx` — no manual install needed. The first invocation downloads and caches the package.\n\n### Claude Code\n\n```bash\nclaude mcp add gammainfra \\\n  --env GAMMAINFRA_API_KEY=sk-gammainfra-... \\\n  -- npx -y @gammainfra/mcp-server\n```\n\nOr edit `~/.claude.json` and add to the `mcpServers` block:\n\n```json\n{\n  \"mcpServers\": {\n    \"gammainfra\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@gammainfra/mcp-server\"],\n      \"env\": { \"GAMMAINFRA_API_KEY\": \"sk-gammainfra-...\" }\n    }\n  }\n}\n```\n\n### Claude Desktop\n\nEdit `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\\Claude\\claude_desktop_config.json` (Windows):\n\n```json\n{\n  \"mcpServers\": {\n    \"gammainfra\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@gammainfra/mcp-server\"],\n      \"env\": { \"GAMMAINFRA_API_KEY\": \"sk-gammainfra-...\" }\n    }\n  }\n}\n```\n\nRestart Claude Desktop. The \"GammaInfra\" server should appear in the tools menu.\n\n### Cursor\n\nEdit `~/.cursor/mcp.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"gammainfra\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@gammainfra/mcp-server\"],\n      \"env\": { \"GAMMAINFRA_API_KEY\": \"sk-gammainfra-...\" }\n    }\n  }\n}\n```\n\n### Cline (VS Code)\n\nOpen Cline's settings (gear icon → MCP Servers tab) and add:\n\n```json\n{\n  \"gammainfra\": {\n    \"command\": \"npx\",\n    \"args\": [\"-y\", \"@gammainfra/mcp-server\"],\n    \"env\": { \"GAMMAINFRA_API_KEY\": \"sk-gammainfra-...\" },\n    \"disabled\": false\n  }\n}\n```\n\n## Environment variables\n\n| Var | Required | Default | Description |\n|---|---|---|---|\n| `GAMMAINFRA_API_KEY` | yes | — | Your GammaInfra API key, format `sk-gammainfra-{32_chars}`. |\n| `GAMMAINFRA_BASE_URL` | no | `https://api.gammainfra.com/v1` | Override for staging/dev. |\n\n## Tool reference\n\n### `chat_completions`\n\nSend a chat completion request and receive the model response plus routing metadata.\n\n**Parameters:**\n\n| Name | Type | Required | Description |\n|---|---|---|---|\n| `model` | string | yes | `gammainfra/auto` for smart routing, `gammainfra/fast`/`gammainfra/cheap` for tier shortcuts, or pin a specific model like `openai/gpt-5-mini`. |\n| `messages` | array | yes | OpenAI-shape conversation messages. |\n| `temperature` | number | no | 0..2. |\n| `max_tokens` | int | no | |\n| `max_completion_tokens` | int | no | GPT-5 family requires this instead of `max_tokens`. |\n| `cost_quality` | float | no | 0.0..1.0 continuous dial. Sent as `X-GammaInfra-Cost-Quality`. |\n| `max_latency_ms` | int | no | 60..600000. Caps total wall-clock incl. fallback retries. Also enforced client-side as a hard request abort. |\n| `preference` | string | no | `quality`, `cost`, or `latency`. |\n| `region` | string | no | `us`, `eu`, `apac`, or specific AWS region. |\n| `tools`, `tool_choice`, `response_format`, `top_p`, `frequency_penalty`, `presence_penalty` | various | no | Standard OpenAI fields, forwarded as-is. |\n\n**Returns:** `{ response: <OpenAI response>, routing_meta: { provider, endpoint, cost_usd, input_cost_usd, output_cost_usd, router_version, logical_model, fallback_chain, attempted_count, request_id, ... } }`\n\n**Timeout note:** Every request has a 10-minute client-side hard timeout (via `AbortController`) so a hung upstream can't wedge the MCP process. For `chat_completions`, a supplied `max_latency_ms` replaces that default as the hard abort bound.\n\n**Streaming note:** MCP tool responses are non-streaming. The server always sends `stream: false` to the upstream and does not accept a `stream` parameter on the tool input (it's rejected by schema validation). For streaming, use the GammaInfra HTTP API directly.\n\n### `list_models`\n\nNo parameters. Returns the full model catalog including direct-pin slugs, per-token pricing, and capability flags (`supports_tools`, `supports_vision`).\n\n### `get_balance`\n\n| Name | Type | Required | Description |\n|---|---|---|---|\n| `include_byok` | boolean | no | Default `false`. Also fetch the BYOK balance. Off by default to avoid an extra request — and a guaranteed 404 — for customers without BYOK enrollment. |\n\nReturns `{ managed_balance_usd, byok_balance_usd, currency }`. With `include_byok` omitted/false, `byok_balance_usd` is `null` and no BYOK request is made (no `byok_error`). With `include_byok: true`, if BYOK isn't enrolled, `byok_balance_usd` is `null` and a `byok_error` field describes the cause.\n\n### `get_status`\n\nNo parameters. Returns GammaInfra's current overall health, per-provider state and live p50 latency, and 24h request count.\n\n## Development\n\n```bash\ngit clone https://github.com/yuz0101/gammainfra-mcp-server.git\ncd gammainfra-mcp-server\nnpm install\nnpm run test          # 30 tests, ~1s\nnpm run build         # tsc → dist/\nnpm run typecheck\n```\n\n## License\n\nMIT — see [LICENSE](./LICENSE).\n",
  "bytes": 5832,
  "sha": "bd29491d411250da1ced61bea848071f81193ab3d7cb6a78229d01b968d87e9e",
  "repo_slug": "yuz0101/gammainfra-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_com_gammainfra_mcp_server_cac79dfc/readme"
}