Skip to main content

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

Project description

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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_llm_gateway-0.1.0.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_llm_gateway-0.1.0-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file mcp_llm_gateway-0.1.0.tar.gz.

File metadata

  • Download URL: mcp_llm_gateway-0.1.0.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mcp_llm_gateway-0.1.0.tar.gz
Algorithm Hash digest
SHA256 45580e40affa91e32a1bf965417d0ef05c9f68cade064866be5d5b44cf46ac7f
MD5 b10e54b92ccda2148a11af0b6de60fa6
BLAKE2b-256 495d3a1934a12ed1af97d0ed0c5c946e0e93ebff39718685c22b7433a9453eea

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_llm_gateway-0.1.0.tar.gz:

Publisher: pypi-publish.yml on daedalus/mcp-llm-gateway

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcp_llm_gateway-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_llm_gateway-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 06a030777b809ac267648783fac1e472f107ba7dd3f4d653c81f0fe184f2f772
MD5 eeec66421da8aec6edcc8cb8ed953970
BLAKE2b-256 03c53e2d1c1e51ce1ca85405b06575bcf8f3fd434f41d3f40fa1da851172ea4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_llm_gateway-0.1.0-py3-none-any.whl:

Publisher: pypi-publish.yml on daedalus/mcp-llm-gateway

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page