glama-gateway-mcp
Enables access to Google models through the Glama AI gateway, with tools for listing models, chat completions, streaming completions, and request-status lookup.
Enables access to OpenAI models (such as openai/gpt-4o) through the Glama AI gateway, with tools for listing models, chat completions, streaming completions, and request-status lookup.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@glama-gateway-mcp List the models available through the Glama gateway."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
glama-gateway-mcp
A Models Context Protocol (MCP) server that exposes the Glama AI gateway (https://gateway.glama.ai/v1, an OpenAI-compatible endpoint for 100+ models) as MCP tools. Standard library only, Python 3.9+, no model downloads.
Statement of need
MCP clients (Claude Desktop, Cursor, and a growing list of agent runtimes)
each expect an MCP server per capability. When a research project needs to
call language models across many providers — openai/..., anthropic/...,
google/..., and dozens more — wiring every client to every provider is a
tangle of credentials and bespoke plugins. Glama centralizes provider access
behind one OpenAI-compatible API, but it does not, by itself, hand a model
to an MCP client.
glama-gateway-mcp closes exactly that seam. It is a thin, dependency-free
MCP server that fronts the gateway: an agent (or IDE, or personal assistant)
talks MCP to this one server and gains openai/gpt-4o, anthropic/claude-2,
and any other gateway model through four tools — listing models, chat
completion, streaming completion, and request-status lookup. One API key, one
credential, one endpoint for every connected application.
Distinguishing design choices:
stdio MCP, implemented on the stdlib — the protocol layer uses only
json,urllibandsys, so it runs anywhere Python runs and is trivial to audit.OpenAI-compatible request/response shapes — the gateway returns raw gateway bodies, so no field mapping is ever wrong.
Server-side stream reassembly — MCP clients that cannot hold a live SSE stream still receive the full completion text plus usage metadata.
Clean JSON-RPC errors — a missing key, unreachable gateway, or unknown tool yields a readable MCP error instead of a hang or silent failure.
Related MCP server: GPTProto MCP
Install
pip install .
# development:
pip install -e ".[dev]"Requires Python 3.9+. Runtime dependencies: none.
Usage
Export your Glama key, then run the server:
export GLAMA_API_KEY="your_key_here"
export GLAMA_DEFAULT_MODEL="openai/gpt-4o" # optional
glama-mcpor run it as a module:
python -m glama_mcpConnect any MCP client to the glama-mcp stdio command. The exposed tools:
Tool | Purpose |
| list models available through the gateway |
| one-shot chat completion |
| streamed completion (reassembled) |
| status of a completion request by id |
Per-application wiring
Ready-to-paste mcpServers blocks for individual applications live in
configs/: Celebrum, Samvit, Collabuild, S-AI, hermes-agent,
teddy-techlearn, health-quest, ai-content-studio, and the portfolio site.
Each block registers this server for that application's MCP client.
{
"mcpServers": {
"glama-gateway": {
"command": "glama-mcp",
"env": { "GLAMA_API_KEY": "your_key_here" }
}
}
}Verifying the server by hand
printf '%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' \
'{"jsonrpc":"2.0","id":2,"method":"tools/list"}' \
| python -m glama_mcpTests
python -m pytestThe suite covers the gateway client (payload shapes, SSE reassembly), protocol handshake, tool discovery and dispatch, error handling, missing-key behaviour, and a full stdio round trip.
Contributing
See CONTRIBUTING.md. Keep it dependency-free and Python 3.9 compatible; every change needs a test.
JOSS paper
Submission materials in paper/: paper.md, paper.bib, and
JOSS_SUBMISSION_READINESS.md (records which gates are met and which still
require calendar time).
License
MIT — see LICENSE.
AI usage disclosure
Code and documentation were drafted with generative-AI assistance and reviewed by the human maintainer, who made the design decisions. This disclosure is kept in line with the JOSS AI usage policy.
Available Tools
4 toolsglama_chat_completionC
Run a chat completion against the Glama gateway. messages is an array of {role, content} objects.
Inputs: messages (required), model, max_tokens, temperature.
glama_list_modelsA
List the models available through the Glama gateway (OpenAI-format model ids).
Inputs: no named parameters.
glama_request_statusC
Look up the status of a completion request by id.
Inputs: request_id (required).
glama_stream_completionB
Streamed chat completion; deltas are reassembled into one text answer with usage metadata.
Inputs: messages (required), model.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
list_models and request_status are clearly distinct, but chat_completion and stream_completion overlap in purpose as they both perform chat completions. The descriptions clarify streaming vs. non-streaming, so an agent can differentiate them, though some ambiguity remains.
All tool names share the glama_ prefix and follow a consistent snake_case verb_noun pattern. The naming is predictable and uniform across the set.
Four tools is well-scoped for a gateway-focused server covering model discovery, completion, streaming, and status lookup. Each tool has a clear, non-redundant role.
The core workflow of listing models and running both standard and streaming completions is covered, plus status lookup for async requests. Minor additions like request cancellation or model details would improve completeness, but no critical gap exists.
Maintenance
Related MCP Connectors
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
Connect MCP clients to 2,000+ AI models without managing provider API keys.
MCP gateway: one connection for your AI apps, with tool policies, PII redaction and audit logs.
The OpenRouter for tools. One MCP connection gives any AI agent 254 hosted tools, pay per call.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables MCP clients to call any OpenAPI-defined API by automatically converting its operations into tools, with built-in support for authentication, rate limiting, and response handling.7Apache 2.0

GPTProto MCPofficial
AlicenseAqualityCmaintenanceEnables AI hosts to discover GPTProto models, retrieve live pricing, make documented API requests, submit custom generations, and poll asynchronous tasks through local MCP tools.917 npmMIT
litellm-admin-mcpofficial
AlicenseNot gradedqualityBmaintenanceEnables agents to administer a LiteLLM gateway by creating and managing keys, model deployments, teams, budgets, and spending through MCP.4MIT- AlicenseNot gradedqualityCmaintenanceEnables AI agents to browse products, look up orders, and place orders through MCP tools, with API-key authentication, rate limiting, and idempotent order operations.MIT