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.
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 endpointcomplete(prompt, model, max_tokens, temperature): Send a completion request to the downstream LLM provider
MCP Resources
models://list: Returns the list of available modelsconfig://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 modelCompletionRequest: Dataclass for completion request payloadsGatewayConfig: Dataclass for gateway configuration
adapters.http
HTTPAdapter: HTTP client for downstream API communicationModelListAdapter: Adapter for fetching model list from remote endpoints
services.gateway
ModelService: Service for managing model discovery and cachingCompletionService: Service for handling completion requestsConfigService: Service for managing gateway configuration
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45580e40affa91e32a1bf965417d0ef05c9f68cade064866be5d5b44cf46ac7f
|
|
| MD5 |
b10e54b92ccda2148a11af0b6de60fa6
|
|
| BLAKE2b-256 |
495d3a1934a12ed1af97d0ed0c5c946e0e93ebff39718685c22b7433a9453eea
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_llm_gateway-0.1.0.tar.gz -
Subject digest:
45580e40affa91e32a1bf965417d0ef05c9f68cade064866be5d5b44cf46ac7f - Sigstore transparency entry: 1212176355
- Sigstore integration time:
-
Permalink:
daedalus/mcp-llm-gateway@4bedbd417ab3d2a68b7361fed8b0b80b45af192b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/daedalus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@4bedbd417ab3d2a68b7361fed8b0b80b45af192b -
Trigger Event:
release
-
Statement type:
File details
Details for the file mcp_llm_gateway-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mcp_llm_gateway-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06a030777b809ac267648783fac1e472f107ba7dd3f4d653c81f0fe184f2f772
|
|
| MD5 |
eeec66421da8aec6edcc8cb8ed953970
|
|
| BLAKE2b-256 |
03c53e2d1c1e51ce1ca85405b06575bcf8f3fd434f41d3f40fa1da851172ea4f
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_llm_gateway-0.1.0-py3-none-any.whl -
Subject digest:
06a030777b809ac267648783fac1e472f107ba7dd3f4d653c81f0fe184f2f772 - Sigstore transparency entry: 1212176497
- Sigstore integration time:
-
Permalink:
daedalus/mcp-llm-gateway@4bedbd417ab3d2a68b7361fed8b0b80b45af192b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/daedalus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@4bedbd417ab3d2a68b7361fed8b0b80b45af192b -
Trigger Event:
release
-
Statement type: