Skip to main content
Glama

yuntu-mcp-server

Servidor MCP (versión alojable) de programación de cómputo de Yuntu Zhihui, implementado con Python FastMCP, con funcionalidad alineada con las tres herramientas del Servidor MCP en Go:

  • chat_completion: llama al diálogo del modelo grande, enrutamiento de canales + conmutación por error, devuelve el contenido y el uso de tokens (descuenta tokens reales)

  • get_balance: consulta el saldo actual del inquilino (token_balance / balance)

  • list_models: lista los modelos disponibles actualmente

Nota: esta versión no incluye la lógica de "precio/descuento", solo hace "verificación de saldo > 0 + descuento de tokens reales", para probar primero el flujo alojado. La fijación de precios/descuentos se integrará más adelante.

Forma de ejecución

Desarrollo local / pruebas unitarias

python -m venv .venv
.venv/Scripts/python -m pip install -e .
.venv/Scripts/python tests/test_smoke.py        # 逻辑冒烟测试(SQLite)

Inicio directo con uvx (después de publicar en PyPI, alojado en ModelScope)

Primero publica en PyPI, luego configura los parámetros de ejecución en las variables de entorno, y uvx puede iniciarlo:

uvx yuntu-mcp-server

Modo HTTP (opcional, alineado con la ruta /mcp de la versión Go)

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

Variables de entorno

Variable

Obligatoria

Descripción

DB_DSN

Cadena de conexión a la base de datos. MySQL: user:pass@tcp(host:3306)/db?charset=utf8mb4&parseTime=True&loc=Local; localmente también se puede usar sqlite:///xx.db

API_KEY_ENCRYPT_SECRET

Clave de cifrado de API Key (≥16 caracteres), debe coincidir con la plataforma principal de Yuntu Zhihui (se usa para descifrar las API Keys de los canales y recuperar el inquilino)

MCP_API_KEY

No

API Key del inquilino actual (stdio no tiene cabecera HTTP, se inyecta mediante variable de entorno en tiempo de ejecución para identificar al inquilino; si falta, get_balance/list_models devuelven vacío y chat_completion lo rechaza). También es compatible con leer YUNTU_API_KEY

MCP_TRANSPORT

No

stdio (predeterminado, el alojamiento con uvx usa stdio) o http

MCP_HOST / MCP_PORT

No

Dirección/puerto de escucha en modo HTTP, predeterminado 0.0.0.0:8081

Criterios de autenticación

  • Igual que la versión Go: la tabla api_keys se consulta por key_hash (SHA-256 en texto plano), no se almacena en texto plano.

  • Se valida enabled, expires_at, y se toma tenant_id como sujeto de facturación/capacidad.

  • La api_key de upstream_configs del canal se descifra con la misma clave de cifrado para llamar al upstream (si falla el descifrado, se conserva como texto plano).

Publicar en PyPI

python -m pip install build
python -m build                              # 生成 dist/ 下的 wheel 与 sdist
python -m twine upload dist/*                # 需配置 PyPI 令牌

Después de publicar, verificar:

DB_DSN="user:pass@tcp(host:3306)/db?charset=utf8mb4" \
API_KEY_ENCRYPT_SECRET="<与主平台一致>" \
MCP_API_KEY="<租户Key>" \
uvx yuntu-mcp-server

Available Tools

3 tools
chat_completionB

调用大模型进行对话,从渠道管理中选择可用渠道并自动扣除 Token。

ParametersJSON Schema
NameRequiredDescriptionDefault
modelNodeepseek-v4-flash
messagesYes
temperatureNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.2/5.0
Behavior3/5

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.

Conciseness4/5

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.

Completeness3/5

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.

Parameters2/5

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.

Purpose4/5

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.

Usage Guidelines3/5

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 识别租户)。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.2/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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

列出当前可用的所有模型列表。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness5/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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

A3.9/5.0
Disambiguation5/5

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.

Naming Consistency5/5

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.

Tool Count4/5

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.

Completeness4/5

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

ActivityMaintained
ResponsivenessSyncing

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

Related MCP Servers

  • -
    license
    C
    quality
    Not graded
    maintenance
    Enables interaction with OpenAI-compatible APIs (like Ollama) through MCP tools. Provides access to chat completions, model listings, and embeddings generation from local or remote OpenAI-style endpoints.
    3
  • A
    license
    A
    quality
    C
    maintenance
    MCP 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.
    2
    17
    MIT
  • F
    license
    A
    quality
    C
    maintenance
    Unified MCP server for querying multiple LLM providers (Gemini, OpenAI, Anthropic, etc.) with advanced routing, cost optimization, and fallback resilience.
    2
    15

Latest Blog Posts

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