Skip to main content
Glama
yuz0101

@gammainfra/mcp-server

by yuz0101

@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.

Related MCP server: TianGong-AI-MCP

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.

Available Tools

4 tools
chat_completionsA

Send a chat completion request to GammaInfra and receive the model response plus routing metadata. Smart routing picks the best-fit model when model='gammainfra/auto'; pin a specific model like 'openai/gpt-5-mini' for direct dispatch. Returns the OpenAI-shape response in a 'response' field and routing decisions (provider, endpoint, cost in USD, router version, fallback chain) in a 'routing_meta' field. Streaming is not supported via MCP; the request always uses stream=false.

ParametersJSON Schema
NameRequiredDescriptionDefault
modelYesModel name. Use 'gammainfra/auto' to let the router pick, 'gammainfra/fast' for latency, 'gammainfra/cheap' for cost, or pin a specific provider/model like 'openai/gpt-5-mini' or 'anthropic/claude-opus-4-7'.
toolsNo
top_pNo
regionNoConstrain endpoint region: 'us', 'eu', 'apac', or specific AWS region like 'us-east-1'. Sent as X-GammaInfra-Region header.
messagesYesConversation messages in OpenAI shape.
max_tokensNo
preferenceNoCoarse routing preference. Sent as X-GammaInfra-Preference header.
temperatureNo
tool_choiceNo
cost_qualityNoContinuous cost-vs-quality dial. 0.0 = pure quality, 1.0 = pure cost. Sent as X-GammaInfra-Cost-Quality header.
max_latency_msNoCap total wall-clock time (including fallback retries) in ms. Sent as X-GammaInfra-Max-Latency-Ms header.
response_formatNo
presence_penaltyNo
frequency_penaltyNo
max_completion_tokensNo

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Without annotations, the description proactively discloses key behaviors: smart routing vs direct dispatch, the return format (response + routing_meta fields), and streaming unsupported. It could mention error or rate limit behavior, but the provided info is substantial and non-contradictory.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise (3 sentences) and front-loaded with the core action. Every sentence adds value without redundancy, making it efficient for an agent to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 15 parameters and no output schema or annotations, the description only covers the core functionality and response structure. It fails to explain advanced routing features (preference, cost_quality, max_latency) and other common parameters needed for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With schema description coverage at only 40%, many parameters lack explanations. The description only clarifies the 'model' parameter and implicitly sets stream=false. It does not explain parameters like tools, temperature, cost_quality, or max_latency_ms, leaving a significant gap for the agent.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Send a chat completion request' and the resource 'to GammaInfra' with specific routing logic for model selection. It distinguishes from sibling tools (get_status, list_models, get_balance) which serve different purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains when to use 'gammainfra/auto' vs pinning a specific model, and explicitly notes that streaming is not supported via MCP. However, it does not provide explicit alternative tools for streaming or when not to use this tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_balanceA

Return the authenticated customer's GammaInfra balances: managed (USD) and currency. Pass include_byok=true to also fetch the BYOK (USD if enrolled) balance; when omitted, byok_balance_usd is null and no BYOK request is made. With include_byok=true, BYOK is reported inline as a byok_error string if the BYOK endpoint fails (e.g., customer has no BYOK enrollment).

ParametersJSON Schema
NameRequiredDescriptionDefault
include_byokNoAlso fetch the BYOK (bring-your-own-key) balance. Off by default to avoid an extra request — and a guaranteed 404 — for customers without BYOK enrollment. When false, byok_balance_usd is null with no byok_error.

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It discloses the conditional BYOK request, error handling (byok_error), and default behavior (null when omitted). It implies read-only access via 'authenticated customer' and idempotency but could explicitly state that it is a safe read operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences efficiently convey purpose and parameter behavior with no redundant text. Every sentence adds necessary detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (1 optional param, no output schema), the description covers the input behavior and high-level output (balances, BYOK field). It could explicitly mention the response structure (e.g., object with fields like managed_usd, currency, byok_balance_usd) but is adequate for a straightforward read operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% for the single parameter, but the description adds value beyond the schema by explaining the effect of include_byok on the response (including BYOK balance, null vs value, error handling).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Return') and the resource ('the authenticated customer's GammaInfra balances: managed (USD) and currency'), with a specific scope and differentiation from sibling tools (get_status, chat_completions, list_models).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains when to use the include_byok parameter and the behavior for both true and false cases. It implicitly states the tool's purpose for balance retrieval but does not explicitly exclude alternatives or provide when-not-to-use guidance, which is acceptable given unrelated siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_statusA

Return GammaInfra's current health: overall state, per-provider health (latency p50 + state), and 24-hour request count. Useful before kicking off a long agent loop. No parameters.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It describes what is returned but does not explicitly state that the operation is read-only or free of side effects. However, the nature of a health check implies safety, so score is adequate but not high.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, no wasted words. Front-loads the purpose and includes a usage hint. Every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema, but description fully describes the return values (overall state, per-provider health, request count). For a simple health check tool, this is complete and sufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist and description explicitly states 'No parameters', matching the schema. Baseline is 4 for 0 parameters, and the description adds value by confirming this.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states the tool returns GammaInfra's health with specific details (overall state, per-provider health, request count). Distinguishes from sibling tools (chat_completions, list_models, get_balance) which serve different purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly suggests using before long agent loops, providing clear context. No when-not-to or alternative tools mentioned, but sibling tools are sufficiently distinct, so minimal guidance needed.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_modelsA

List every model available on GammaInfra with pricing and capability flags. Covers OpenAI, Anthropic, Google, Mistral, Groq, DeepSeek, xAI, and Amazon Bedrock today; plus the meta-models gammainfra/auto, gammainfra/fast, and gammainfra/cheap. No parameters.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It discloses that the list may change ('today') and states it is a read operation, but it does not mention auth needs, rate limits, or return format. Adequate but not comprehensive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and front-loaded, with two short sentences that cover all essential information without wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter list tool with no output schema, the description adequately covers what models are included and what information they have (pricing, capability flags). It does not describe the exact return format, but the output is implied. Lacks some detail but is mostly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, and the schema coverage is 100%. The description adds the explicit statement 'No parameters,' which reaffirms but does not significantly add beyond the schema. Baseline is 4.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool lists every model on GammaInfra, covering specific providers and meta-models, with pricing and capability flags. It distinguishes itself from sibling tools like get_status, chat_completions, and get_balance.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool is for discovering available models, but it does not explicitly provide when to use it versus alternatives or when not to use it. The context is clear but lacks exclusion guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv0.1.1
    • First observedchat_completions
    • First observedget_balance
    • First observedget_status
    • First observedlist_models

TDQS

A4.2/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: health status, chat completions, model listing, and balance checking. No overlap.

Naming Consistency4/5

Names follow a verb_noun pattern (get_status, list_models, get_balance) except chat_completions which is a noun phrase, but still readable and consistent in style.

Tool Count5/5

Four tools is well-scoped for the server's purpose—covering health, chat, models, and balance without bloat or deficiency.

Completeness4/5

Covers core operations (chat, model discovery, status, balance), but lacks features like usage history or streaming support, which are minor gaps.

Maintenance

ActivityInactive
ResponsivenessUnresponsive

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol server that bridges MCP clients with local LLM services, enabling seamless integration with MCP-compatible applications through standard tools like chat completion, model listing, and health checks.
    -
  • F
    license
    Not graded
    quality
    Not graded
    maintenance
    High-performance Model Context Protocol server supporting multiple LLM providers (OpenRouter, OpenAI, Groq) with WebSocket API and conversation history persistence.
    -