yuntu-mcp-server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@yuntu-mcp-server What's my current balance?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
yuntu-mcp-server
Yuntu Zhihui Compute Scheduling MCP Server (hosted version), implemented in Python FastMCP, with functionality aligned to the three tools of the Go version MCP Server:
chat_completion: calls the LLM for conversation, channel routing + failover, returns content and token usage (deducts actual tokens)get_balance: queries the current tenant's balance (token_balance / balance)list_models: lists currently available models
Note: this version does not yet include "price/discount" logic, only "balance > 0 check + deduct actual token count", to get the hosted pipeline working first. Pricing/discount will be integrated later.
How to Run
Local Development / Unit Testing
python -m venv .venv
.venv/Scripts/python -m pip install -e .
.venv/Scripts/python tests/test_smoke.py # 逻辑冒烟测试(SQLite)Directly Launched via uvx (after PyPI release, ModelScope hosting)
First publish to PyPI, then configure runtime parameters in environment variables, and uvx can launch it:
uvx yuntu-mcp-serverHTTP Mode (optional, aligned with Go version /mcp path)
MCP_TRANSPORT=http MCP_PORT=8081 uvx yuntu-mcp-server
# 监听 http://0.0.0.0:8081/mcp (Streamable HTTP)Related MCP server: Synap MCP Server
Environment Variables
Variable | Required | Description |
| Yes | Database connection string. MySQL: |
| Yes | API Key encryption secret (≥16 characters), must match the Yuntu Zhihui main platform (used to decrypt channel API keys and look up tenants) |
| No | The current tenant's API Key (stdio has no HTTP Header, so the tenant is identified via runtime environment variable injection; when missing, |
| No |
|
| No | HTTP mode listen address/port, default |
Authentication Semantics
Consistent with the Go version: the
api_keystable is looked up bykey_hash(plaintext SHA-256), plaintext is never stored.Validate
enabledandexpires_at, usetenant_idas the subject for billing/capability decisions.The channel
upstream_configs.api_keyis decrypted with the same encryption secret before calling upstream (if decryption fails, it is treated as plaintext).
Publishing to PyPI
python -m pip install build
python -m build # 生成 dist/ 下的 wheel 与 sdist
python -m twine upload dist/* # 需配置 PyPI 令牌Verify after publishing:
DB_DSN="user:pass@tcp(host:3306)/db?charset=utf8mb4" \
API_KEY_ENCRYPT_SECRET="<与主平台一致>" \
MCP_API_KEY="<租户Key>" \
uvx yuntu-mcp-serverAvailable Tools
3 toolschat_completionB
调用大模型进行对话,从渠道管理中选择可用渠道并自动扣除 Token。
Inputs: messages (required), model, temperature. Returns: result
get_balanceA
查询当前租户的 Token 余额(需配置 MCP_API_KEY 识别租户)。
Inputs: no named parameters. Returns: result
list_modelsA
列出当前可用的所有模型列表。
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: chat_completion handles LLM interactions, get_balance checks token quota, and list_models shows available models. No overlap or ambiguity between them.
All three tool names follow a consistent verb_noun pattern in snake_case: chat_completion, get_balance, list_models. The naming is uniform and predictable.
With only 3 tools, the surface is minimal but appropriate for a straightforward LLM gateway. It covers the essential actions (use model, check balance, list models) without unnecessary bloat, though a few more (e.g., channel management) could be expected.
The tool set covers the core user-facing operations for an LLM gateway: chatting, checking balance, and discovering models. It lacks administrative features like managing channels, but for the apparent consumer-focused scope, these are reasonable gaps.
Maintenance
Related MCP Connectors
Chat, image, video, and audio models from many vendors behind one remote MCP server and one key.
Connect MCP clients to 2,000+ AI models without managing provider API keys.
Call AI by role, not by model: tiered AI gateway over REST and MCP.
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables chat, document search (RAG), and a declarative SQL tool builder over MCP so any client can use these capabilities.103 npmAGPL 3.0
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients to discover and inspect available open models, estimate token costs, and run chat completions through an OpenAI-compatible inference endpoint, with optional bearer-key authentication for billed calls.561 npmApache 2.0
- AlicenseNot gradedqualityAmaintenanceEnables MCP-compatible applications to interact with local and cloud-hosted LLM models for model management, text generation, chat, embeddings, and web search/fetch.923 npmAGPL 3.0
- FlicenseNot gradedqualityAmaintenanceEnables MCP clients to discover and use free LLM chat routes and models through an OpenAI-compatible gateway, including provider health, capacity, and failover.-