Skip to main content
Glama

yuntu-mcp-server

云途知汇の計算リソーススケジューリング MCP Server(ホスティング対応版)。Python FastMCP で実装し、機能は Go 版 MCP Server の3つのツールに揃えています:

  • chat_completion:大規模モデルとの対話を呼び出し、チャネルルーティング+フェイルオーバーを実施し、content とトークン使用量を返します(実トークンを差し引きます)

  • get_balance:現在のテナント残高を照会します(token_balance / balance)

  • list_models:現在利用可能なモデルを一覧表示します

注:本バージョンには「価格/割引」ロジックは含まれておらず、「残高 > 0 チェック+実トークン数の差し引き」のみを行い、 まずホスティングの連携経路を疎通させます。価格設定/割引は後続で追加します。

実行方法

ローカル開発 / 単体テスト

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-server

HTTP モード(任意、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

環境変数

変数

必須

説明

DB_DSN

はい

データベース接続文字列。MySQL:user:pass@tcp(host:3306)/db?charset=utf8mb4&parseTime=True&loc=Local。ローカルでは sqlite:///xx.db も使用可能

API_KEY_ENCRYPT_SECRET

はい

API Key 暗号化キー(16文字以上)。云途知汇メインプラットフォームと一致させる必要があります(チャネル API Key の復号化、テナント検索に使用)

MCP_API_KEY

いいえ

現在のテナントの API Key(stdio には HTTP Header がないため、実行時環境変数でテナントを識別します。欠落時は get_balance/list_models が空を返し、chat_completion は拒否します)。YUNTU_API_KEY からの読み取りにも対応

MCP_TRANSPORT

いいえ

stdio(デフォルト、uvx ホスティングは stdio を使用)または http

MCP_HOST / MCP_PORT

いいえ

HTTP モードの待受アドレス/ポート。デフォルトは 0.0.0.0:8081

認証の基準

  • Go 版と同様:api_keys テーブルは key_hash(平文 SHA-256)で検索し、平文は保存しません。

  • enabledexpires_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-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