Mcp Llm Gateway

io.github.daedalus由 GitHub 账号 daedalus 发布v0.1.0更新于 Oct 24, 2026

MCP-compatible LLM gateway that proxies completion requests.

已验证STDIO仅桌面开发者工具AI 与机器学习

概览

AI 生成的概览

本地 MCP 网关,让助手列出模型并向兼容 OpenAI 的 LLM 服务商发送补全请求。

可以做什么
从配置的远程端点或默认模型目录列出可用模型,并以资源形式读取同一列表。向兼容 OpenAI 的下游服务商发送补全请求,可指定模型、最大 token 数和温度。以资源形式读取当前网关配置。
适用场景
适合希望让助手通过自有的兼容 OpenAI 端点或模型网关转发补全请求,或在该端点提供的多个模型之间选择与比较的场景。
运行要求
以本地 Python 进程运行,从 PyPI 安装(pip install mcp-llm-gateway),使用 stdio 传输。需要设置 DOWNSTREAM_URL 和 DEFAULT_MODEL 环境变量;MODEL_LIST_URL、API_KEY 和 TIMEOUT 为可选。需要能访问下游服务商的网络。
安装前请注意
API_KEY 环境变量会被透传给下游服务商,应视为机密。补全请求会发送到配置的下游 URL,提示内容会离开本机交给该第三方。config://info 资源会暴露当前网关配置,可能包含端点信息。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Mcp Llm Gateway,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

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

bash
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:

bash
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

bash
git clone https://github.com/daedalus/mcp-llm-gateway.gitcd mcp-llm-gatewaypip install -e ".[test]"
# run testspytest
# formatruff format src/ tests/
# lintruff check src/ tests/
# type checkmypy 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

来源:README.md,提交 eef35d0

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分