@gammainfra/mcp-server

@gammainfra/mcp-server

Model Context Protocol (MCP) server for GammaInfra — intelligent LLM routing across every major provider via one OpenAI-shape API.

Category
访问服务器

README

@gammainfra/mcp-server

Model Context Protocol (MCP) server for GammaInfra — intelligent LLM routing across every major provider via one OpenAI-shape API.

Drop this server into Claude Code, Claude Desktop, Cursor, Cline, Continue, or any MCP-compatible host, and your agent gets direct tool access to:

  • 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.
  • list_models — full model catalog with pricing and capability flags.
  • get_balance — managed + BYOK balances.
  • get_status — overall + per-provider health, 24h request count.

Quickstart

  1. Get a GammaInfra API key — sign up free at https://gammainfra.com/signup ($3 trial credit, no credit card).
  2. Add the server to your MCP client config (instructions per client below).
  3. Restart the client. The four tools become available to your agent immediately.

Installation

The server runs via npx — no manual install needed. The first invocation downloads and caches the package.

Claude Code

claude mcp add gammainfra \
  --env GAMMAINFRA_API_KEY=sk-gammainfra-... \
  -- npx -y @gammainfra/mcp-server

Or edit ~/.claude.json and add to the mcpServers block:

{
  "mcpServers": {
    "gammainfra": {
      "command": "npx",
      "args": ["-y", "@gammainfra/mcp-server"],
      "env": { "GAMMAINFRA_API_KEY": "sk-gammainfra-..." }
    }
  }
}

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "gammainfra": {
      "command": "npx",
      "args": ["-y", "@gammainfra/mcp-server"],
      "env": { "GAMMAINFRA_API_KEY": "sk-gammainfra-..." }
    }
  }
}

Restart Claude Desktop. The "GammaInfra" server should appear in the tools menu.

Cursor

Edit ~/.cursor/mcp.json:

{
  "mcpServers": {
    "gammainfra": {
      "command": "npx",
      "args": ["-y", "@gammainfra/mcp-server"],
      "env": { "GAMMAINFRA_API_KEY": "sk-gammainfra-..." }
    }
  }
}

Cline (VS Code)

Open Cline's settings (gear icon → MCP Servers tab) and add:

{
  "gammainfra": {
    "command": "npx",
    "args": ["-y", "@gammainfra/mcp-server"],
    "env": { "GAMMAINFRA_API_KEY": "sk-gammainfra-..." },
    "disabled": false
  }
}

Environment variables

Var Required Default Description
GAMMAINFRA_API_KEY yes Your GammaInfra API key, format sk-gammainfra-{32_chars}.
GAMMAINFRA_BASE_URL no https://api.gammainfra.com/v1 Override for staging/dev.

Tool reference

chat_completions

Send a chat completion request and receive the model response plus routing metadata.

Parameters:

Name Type Required Description
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.
messages array yes OpenAI-shape conversation messages.
temperature number no 0..2.
max_tokens int no
max_completion_tokens int no GPT-5 family requires this instead of max_tokens.
cost_quality float no 0.0..1.0 continuous dial. Sent as X-GammaInfra-Cost-Quality.
max_latency_ms int no 60..600000. Caps total wall-clock incl. fallback retries. Also enforced client-side as a hard request abort.
preference string no quality, cost, or latency.
region string no us, eu, apac, or specific AWS region.
tools, tool_choice, response_format, top_p, frequency_penalty, presence_penalty various no Standard OpenAI fields, forwarded as-is.

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, ... } }

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.

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.

list_models

No parameters. Returns the full model catalog including direct-pin slugs, per-token pricing, and capability flags (supports_tools, supports_vision).

get_balance

Name Type Required Description
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.

Returns { 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.

get_status

No parameters. Returns GammaInfra's current overall health, per-provider state and live p50 latency, and 24h request count.

Development

git clone https://github.com/yuz0101/gammainfra-mcp-server.git
cd gammainfra-mcp-server
npm install
npm run test          # 30 tests, ~1s
npm run build         # tsc → dist/
npm run typecheck

License

MIT — see LICENSE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选