Skip to main content
Glama
mcp-llm-gateway
by daedalus

MCP LLM Gateway

MCP-compatible LLM gateway that proxies completion requests to downstream OpenAI-compatible providers.

PyPI Python Ruff

mcp-name: io.github.daedalus/mcp-llm-gateway

Install

pip install mcp-llm-gateway

Related MCP server: MCP Token Bridge

Usage

Configuration

Set the following environment variables:

  • DOWNSTREAM_URL: Base URL for the OpenAI-compatible downstream API (required)

  • DEFAULT_MODEL: Default model to use for completions (required)

  • MODEL_LIST_URL: URL to fetch available models from (optional, defaults to models.dev)

  • API_KEY: Optional API key for downstream (passthrough)

  • TIMEOUT: Request timeout in seconds (optional, default: 60)

MCP Server

Run the MCP server with stdio transport:

mcp-llm-gateway

MCP Tools

The server exposes the following tools:

  • list_models(): List all available models from the remote endpoint

  • complete(prompt, model, max_tokens, temperature): Send a completion request to the downstream LLM provider

MCP Resources

  • models://list: Returns the list of available models

  • config://info: Returns current gateway configuration

Development

git clone https://github.com/daedalus/mcp-llm-gateway.git
cd mcp-llm-gateway
pip install -e ".[test]"

# run tests
pytest

# format
ruff format src/ tests/

# lint
ruff check src/ tests/

# type check
mypy src/

API

core.models

  • Model: Dataclass representing an available LLM model

  • CompletionRequest: Dataclass for completion request payloads

  • GatewayConfig: Dataclass for gateway configuration

adapters.http

  • HTTPAdapter: HTTP client for downstream API communication

  • ModelListAdapter: Adapter for fetching model list from remote endpoints

services.gateway

  • ModelService: Service for managing model discovery and caching

  • CompletionService: Service for handling completion requests

  • ConfigService: Service for managing gateway configuration

Available Tools

2 tools
completeA

Send a completion request to the downstream LLM provider.

Proxies the request to the configured OpenAI-compatible downstream endpoint.

Inputs: prompt (required), model, provider, max_tokens, +1 more. Returns: object

list_modelsA

List all available models from the configured providers.

Fetches models from the configured providers, with caching. Can filter by provider ID.

Inputs: provider. Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools serve clearly distinct purposes: one for sending completion requests and one for listing models. There is no overlap or ambiguity between them.

    Naming Consistency2/5

    The naming convention is inconsistent: 'complete' is a bare verb, while 'list_models' follows a verb_noun pattern. Consistency would improve predictability.

    Tool Count3/5

    With only 2 tools, the surface is minimal for an LLM gateway. While it covers basic completion and model listing, it feels thin compared to typical gateways that offer more features.

    Completeness2/5

    The gateway lacks many expected operations such as streaming, token counting, embeddings, or health checks. This is a significant gap for a production-ready LLM gateway.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • -
      license
      C
      quality
      Not graded
      maintenance
      Enables interaction with OpenAI-compatible APIs (like Ollama) through MCP tools. Provides access to chat completions, model listings, and embeddings generation from local or remote OpenAI-style endpoints.
      3
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      Bridges MCP tool calls with OpenAI-compatible HTTP endpoints, allowing MCP clients to forward chat completion requests through a unified FastAPI server that returns responses with MCP-specific headers.
      1
      -