yuntu-mcp-server
yuntu-mcp-server
云途知汇算力调度 MCP Server(可托管版本),用 Python FastMCP 实现,功能对齐 Go 版 MCP Server 的三个工具:
chat_completion:调用大模型对话,渠道路由 + 故障转移,返回 content 与 token 用量(扣实际 Token)get_balance:查询当前租户余额(token_balance / balance)list_models:列出当前可用模型
说明:本版本暂不包含「价格/折扣」逻辑,只做「余额 > 0 检查 + 扣实际 Token 数」, 先跑通托管链路。后续再接入定价/折扣。
运行方式
本地开发 / 单元测试
python -m venv .venv
.venv/Scripts/python -m pip install -e .
.venv/Scripts/python tests/test_smoke.py # 逻辑冒烟测试(SQLite)uvx 直接拉起(PyPI 发布后,魔搭托管)
先发布 PyPI,然后在环境变量中配置运行时参数,uvx 即可拉起:
uvx yuntu-mcp-serverHTTP 模式(可选,对齐 Go 版 /mcp 路径)
MCP_TRANSPORT=http MCP_PORT=8081 uvx yuntu-mcp-server
# 监听 http://0.0.0.0:8081/mcp (Streamable HTTP)Related MCP server: LM Studio MCP Bridge
环境变量
变量 | 必填 | 说明 |
| 是 | 数据库连接串。MySQL: |
| 是 | API Key 加密密钥(≥16 字符),需与云途知汇主平台一致(用于解密渠道 API Key、检索租户) |
| 否 | 当前租户的 API Key(stdio 无 HTTP Header,用运行时环境变量注入识别租户;缺失时 |
| 否 |
|
| 否 | HTTP 模式监听地址/端口,默认 |
鉴权口径
与 Go 版一致:
api_keys表按key_hash(明文 SHA-256)检索,不落明文。校验
enabled、expires_at,取tenant_id作为计费/能力判断主体。渠道
upstream_configs.api_key用同一加密密钥解密后调用上游(解密失败视为明文保留)。
发布到 PyPI
python -m pip install build
python -m build # 生成 dist/ 下的 wheel 与 sdist
python -m twine upload dist/* # 需配置 PyPI 令牌发布后验证:
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。
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | deepseek-v4-flash | |
| messages | Yes | ||
| temperature | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It does disclose meaningful behavior — automatic channel selection and token deduction from '渠道管理' — which signals real cost implications beyond what the schema shows. However, it omits details like failure semantics, rate limits, and response format (though an output schema does exist to cover returns).
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single tight sentence in Chinese, front-loaded with the core purpose before the operational detail. No wasted words and appropriately sized for a simple tool. It earns near-top marks for conciseness, though it bundles two ideas into one sentence rather than using structured separation.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 3-parameter tool with an output schema covering return values, the description covers purpose and cost behavior adequately. The main completeness gaps are the absence of any parameter-level guidance (at 0% schema coverage this matters) and no error or safety context, but the tool is simple enough that the gaps are moderate rather than severe.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate, yet it mentions none of the three parameters (model, messages, temperature). The schema only provides type/default info; the description adds nothing about how to construct messages or how temperature affects output. It fails to fill the coverage gap.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a clear verb+resource: '调用大模型进行对话' (call the large model for conversation). It is implicitly differentiated from siblings — get_balance and list_models clearly relate to balance checking and model listing, while this tool performs the actual dialogue. However, it does not explicitly name the siblings, so differentiation is inferred rather than stated.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is implied by the purpose: an agent can infer this tool is for generating chat responses while siblings handle balance and model listing. The description provides context that this operation consumes tokens ('自动扣除 Token'), but it gives no explicit when-to-use, when-not-to-use, or exclusion guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_balanceA
查询当前租户的 Token 余额(需配置 MCP_API_KEY 识别租户)。
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It does disclose the authentication requirement, which is key behavioral context. However, it does not state that the operation is read-only, whether there are any rate limits or side effects, or what the response format will be. Since the output schema exists, return format is covered there, but the description offers minimal behavioral transparency beyond the prerequisite. This is adequate but not rich, warranting a 3.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is one short sentence that front-loads the core purpose and then adds the key prerequisite. Every word earns its place; there is no redundancy or fluff. This is a model of conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has no parameters and an output schema exists, the description is largely complete. It covers the essential purpose and the auth prerequisite, which are the main contextual gaps an agent might need. It could potentially mention that it fetches the balance for the current tenant context, but that is already implied by '当前租户'. A 4 reflects that it is sufficient but not exhaustive – for instance, it doesn't clarify whether the balance is for tokens specifically used in this MCP server, though that is likely unambiguous. Minor gaps exist but none are critical.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, so there is nothing for the description to add beyond the schema. The baseline of 4 is appropriate because there is no semantic gap to fill. The description correctly omits parameter details.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific action ('查询' – query) and a clear resource ('当前租户的 Token 余额' – current tenant's token balance). It naturally distinguishes itself from sibling tools chat_completion and list_models, as balance checking is an unrelated operation. The purpose is unambiguous and complete.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly mentions a prerequisite: '需配置 MCP_API_KEY 识别租户' (requires configuring MCP_API_KEY to identify the tenant). This tells the agent when the tool is usable. It does not explicitly state when not to use it versus alternatives, but the tool's function is so distinct from its siblings (chat and model listing) that no further routing guidance is needed. A 4 is appropriate for clear context without explicit exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_modelsA
列出当前可用的所有模型列表。
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states that the tool lists models, which implies a read-only operation with no side effects. While it does not mention auth requirements or rate limits, none are expected for a simple listing tool, so the description is adequately transparent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence that front-loads the core purpose. There is no redundant or irrelevant content, making it highly efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (no parameters) and the presence of an output schema (per context signals), the description is fully complete. It covers everything an agent needs to know to use the tool correctly; the schema handles return value details.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, and the schema coverage is trivially 100%. According to the scoring guideline, the baseline for 0 params is 4. The description adds no parameter-specific information because there are none to explain.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: it lists all currently available models. The verb '列出' and resource '模型列表' are specific, and it is distinct from sibling tools like chat_completion and get_balance, which serve different functions.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description does not provide any guidance on when to use this tool versus alternatives. It simply states what it does without mentioning exclusion conditions or typical use cases (e.g., before selecting a model for chat). The usage context is implied but not explicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Connect MCP clients to 2,000+ AI models without managing provider API keys.
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
Related MCP Servers
- FlicenseCqualityDmaintenanceEnables MCP clients to interact with local LLMs via LM Studio, supporting dynamic chat, vision, RAG, file interaction, and model orchestration.28
- AlicenseAqualityCmaintenanceMCP server that completes prompts with automatic provider fallback across OpenAI, Anthropic Claude, and Google Gemini. It is rate-limit aware, retries on transient failures, and provides a transparent attempt log.217MIT
- FlicenseAqualityCmaintenanceUnified MCP server for querying multiple LLM providers (Gemini, OpenAI, Anthropic, etc.) with advanced routing, cost optimization, and fallback resilience.215
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Drq112112Hjx/yuntu-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server