LLM Wrapper MCP Server

MCPAI代理

提供方 matdev83

AI代理 未标注 API Key 社区 / 第三方 ClaudeCursorGemini CLICodex
查看接入方式

Allow any MCP-capable LLM agent to communicate with or delegate tasks to any other LLM available through the OpenRouter.ai API.

一句话选型结论

按资料字段整理

LLM Wrapper MCP Server 属于AI代理类 MCP 服务器,传输方式未标注,API Key,可直接接入 Claude、Cursor、Gemini CLI 等,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类AI代理 传输方式未标注 鉴权API Key 部署方式未标注
GitHub 星标 未标注 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

AI代理
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量未标注暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

mcp llm llms llmops openrouter mcp servers mcp server

支持客户端

适用场景

mcpllmllms

安装与配置

未标注 API Key
上游未给出传输方式
pip install llm-wrapper-mcp-server

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    按官方文档确认运行环境(常见为 Node.js 或 Python),装好后再执行安装命令。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后随便调一个只读工具,确认能返回结果,再接入正式流程。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
给代理接外部能力

让代理在任务中途调用搜索、数据库等真实工具。

多步任务编排

把一串操作拆成步骤,由代理按顺序执行。

自动化重复流程

把固定流程交给代理跑,减少手工操作。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已适配 Claude、Cursor、Gemini CLI,换客户端不用重新研究配置。

先想清楚的地方

  • 使用前要准备好API Key对应的凭据,并按最小权限配置。
  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在AI代理场景里让模型直接调用外部能力的人。
  • 已经在用 Claude、Cursor 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
LLM Wrapper MCP Server当前 未标注 未标注 未标注 有 未标注
Filesystem 560c4363 13 未标注 本地部署 无 2026-05-17
Server Everything (everything) 11 stdio · 本地进程 本地部署 有 2026-05-17
Time 7365cb6d 2 SSE · 服务端推送 远程部署 有 2026-05-18
Everything Claude Code 未标注 stdio · 本地进程 本地部署 有 2026-05-17
Openmemory 557e1585 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

AI代理
字段来自项目仓库与公开索引,中文说明由本站标注
提供方matdev83上游标注的维护方 matdev83
分类AI代理本站按上游分类展示
连接方式未标注上游未给出传输方式
鉴权方式API Key远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · python本地安装时用到的包标识与运行时
部署类型未标注上游给出的部署形态
最近核验未标注上游最后核验时间

详细介绍

8.4 KB
来自项目仓库与上游目录的原文,未做删改

LLM Wrapper MCP Server

> "Allow any MCP-capable LLM agent to communicate with or delegate tasks to any other LLM available through the OpenRouter.ai API."

A Model Context Protocol (MCP) server wrapper designed to facilitate seamless interaction with various Large Language Models (LLMs) through a standardized interface. This project enables developers to integrate LLM capabilities into their applications by providing a robust and flexible STDIO-based server that handles LLM calls, tool execution, and result processing.

Features

  • Implements the Model Context Protocol (MCP) specification for standardized LLM interactions.
  • Provides an STDIO-based server for handling LLM requests and responses via standard input/output.
  • Supports advanced features like tool calls and results through the MCP protocol.
  • Configurable to use various LLM providers (e.g., OpenRouter, local models) via API base URL and model parameters.
  • Designed for extensibility, allowing easy integration of new LLM backends.
  • Integrates with llm-accounting for robust logging, rate limiting, and audit functionalities, enabling monitoring of remote LLM usage, inference costs, and inspection of queries/responses for debugging or legal purposes.

Dependencies

This project relies on the following key dependencies:

Core Dependencies

  • pydantic: Data validation and settings management using Python type hints.
  • pydantic-settings: Pydantic's settings management for environment variables and configuration.
  • python-dotenv: Reads key-value pairs from a .env file and sets them as environment variables.
  • requests: An elegant and simple HTTP library for Python.
  • tiktoken: A fast BPE tokeniser for use with OpenAI's models.
  • llm-accounting: For robust logging, rate limiting, and audit functionalities.

Development Dependencies

  • pytest: A mature full-featured Python testing framework.

  • black: An uncompromising Python code formatter.

  • isort: A Python utility / library to sort imports alphabetically, and automatically separate into sections and by type.
  • mypy: An optional static type checker for Python.
  • pytest-mock: A pytest plugin that provides a mocker fixture for easier mocking.

Installation

The llm-wrapper-mcp-server package is available on PyPI and can be installed via pip:```bash
pip install llm-wrapper-mcp-server


Alternatively, for local development or to install from source:

1. Create and activate a virtual environment:```bash
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  1. Install the package:```bash
    pip install -e .

## Configuration

Create a `.env` file in the project root with the following variable:```env
OPENROUTER_API_KEY=your_openrouter_api_key_here

The server is configured to use OpenRouter by default. The API key is loaded from the OPENROUTER_API_KEY environment variable. The specific LLM model and API base URL are primarily configured via command-line arguments when running the server (see below).

Default settings if not overridden by CLI arguments:

  • API Base URL for LLMClient: (can be overridden by LLM_API_BASE_URL env var or --llm-api-base-url CLI arg)
  • Default Model for LLMClient: perplexity/llama-3.1-sonar-small-128k-online (can be overridden by --model CLI arg)

Usage

Textual Overview:

  • Agent Software communicates with the LLM Wrapper MCP Server via the MCP Protocol (stdin/stdout).
  • The LLM Wrapper MCP Server interacts with LLM providers (e.g., OpenRouter.ai) for LLM API calls and responses.
  • The server also integrates with an LLM Accounting System for logging and auditing.
  • Main components:
  • MCP Communication Handler
  • LLM Client
  • Tool Executor
  • LLM Accounting Integration

Running the Server

To run the server, execute the following command:```bash
python -m llm_wrapper_mcp_server [OPTIONS]


For example:```bash
python -m llm_wrapper_mcp_server --model your-org/your-model-name --log-level DEBUG

Run python -m llm_wrapper_mcp_server --help to see all available command-line options for configuring the server.

This server operates as a Model Context Protocol (MCP) STDIO server, communicating via standard input and output. It does not open a network port for MCP communication.

MCP Communication

The server communicates using JSON-RPC messages over stdin and stdout. It supports the following MCP methods:

  • initialize: Handshake to establish protocol version and server capabilities.
  • tools/list: Lists available tools. The main server provides an llm_call tool.
  • tools/call: Executes a specified tool.
  • resources/list: Lists available resources (currently none).
  • resources/templates/list: Lists available resource templates (currently none).

The llm_call tool takes prompt (string, required) and optionally model (string) as arguments to allow per-call model overrides if the specified model is permitted.

Client Interaction Example (Python)

You can interact with the STDIO MCP server using any language that supports standard input/output communication. Here's a Python example using the subprocess module:```python
import subprocess
import json
import time

def send_request(process, request):
"""Sends a JSON-RPC request to the server's stdin."""
request_str = json.dumps(request) + "\n"
process.stdin.write(request_str.encode('utf-8'))
process.stdin.flush()

def read_response(process):
"""Reads a JSON-RPC response from the server's stdout."""
line = process.stdout.readline().decode('utf-8').strip()
if line:
return json.loads(line)
return None

if name == "main":
# Start the MCP server as a subprocess
# Ensure you have the virtual environment activated or the package installed globally
server_process = subprocess.Popen(
["python", "-m", "llm_wrapper_mcp_server"], # Add any CLI args here if needed
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE, # Capture stderr for debugging
text=False # Use bytes for stdin/stdout
)

print("Waiting for server to initialize...")
# The server sends an initial capabilities message on startup (id: None)
initial_response = read_response(server_process)
print(f"Server Initial Response: {json.dumps(initial_response, indent=2)}")

# 1. Send an 'initialize' request
initialize_request = {
    "jsonrpc": "2.0",
    "id": "1",
    "method": "initialize",
    "params": {}
}
print("\\nSending initialize request...")
send_request(server_process, initialize_request)
initialize_response = read_response(server_process)
print(f"Initialize Response: {json.dumps(initialize_response, indent=2)}")

# 2. Send a 'tools/call' request to use the 'llm_call' tool
llm_call_request = {
    "jsonrpc": "2.0",
    "id": "2",
    "method": "tools/call",
    "params": {
        "name": "llm_call",
        "arguments": {
            "prompt": "What is the capital of France?"
            # Optionally add: "model": "another-model/if-allowed"
        }
    }
}
print("\\nSending llm_call request...")
send_request(server_process, llm_call_request)
llm_call_response = read_response(server_process)
print(f"LLM Call Response: {json.dumps(llm_call_response, indent=2)}")

# You can also read stderr for any server logs/errors
# Note: stderr might block if there's no output, consider using non-blocking reads or threads for real apps
# stderr_output = server_process.stderr.read().decode('utf-8')
# if stderr_output:
#     print("\\nServer Stderr Output:\\n", stderr_output)

# Terminate the server process
server_process.terminate()
server_process.wait(timeout=5) # Wait for process to terminate
print("\\nServer process terminated.")

## Development

For a detailed overview of the project's directory and file structure, and crucial guidelines for software development agents, refer to AGENTS.md. This document is essential for agents contributing to the codebase.

### Running Tests

This project uses `pytest` for testing.

To run all unit tests:```bash
pytest

Integration tests are disabled by default to avoid making external API calls during normal test runs. To include and run integration tests, use the integration marker:```bash
pytest -m integration


### Install Development Dependencies

Install development dependencies:```bash
pip install -e ".[dev]"

License

MIT License

常见问题

7 问
答案由本站依据条目字段整理,不引用上游原文
LLM Wrapper MCP Server 怎么安装?

在客户端按下面的安装命令接入:pip install llm-wrapper-mcp-server。装完在客户端配置里引用同一个包或端点。

LLM Wrapper MCP Server 怎么在 Claude、Cursor、Gemini CLI 里配置?

它的传输方式未标注,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

LLM Wrapper MCP Server 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

LLM Wrapper MCP Server 需要 API Key 吗?

资料标注需要API Key认证,使用前准备好对应凭据,并按最小权限配置。

LLM Wrapper MCP Server 支持哪些客户端?

资料标注支持 Claude、Cursor、Gemini CLI、Codex、Zed;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

LLM Wrapper MCP Server 能提供哪些能力?

资料显示能力标签包括 mcp、llm、llms、llmops、openrouter、mcp servers。具体工具清单以官方文档为准。

LLM Wrapper MCP Server 需要什么运行环境?

运行时为 python。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 未标注。