Skip to main content
Glama

AMD Radeon MCP

把 AMD Radeon Cloud 接入任意 MCP 客户端:在对话里部署和管理 GPU Notebook 实例、在实例内执行命令与训练任务,并免费调用平台托管的 Token Factory 模型(chat / OCR / TTS / 决策)。

Python 实现(MCP SDK 2.x + httpx + asyncssh),支持 stdio 与 streamable-http,可托管部署到 ModelScope MCP 广场。

安装

python3 -m venv .venv
.venv/bin/pip install -e .

Related MCP server: Ollama MCP Server

配置

变量

用途

RADEON_API_KEY

Token Factory 推理(rc- 开头,控制台 Token Factory 页复制)

RCC_TOKEN + RCC_URL

实例管理(rcc_ 令牌,两者必须成对;RCC_URL=https://developer.amd.com.cn/radeon)

RADEON_SSH_IDENTITY 或 SSH_PRIVATE_KEY

实例内操作/训练的 SSH 私钥(路径或内容)

也可以写入 ~/.config/radeon-cloud-mcp/auth.json(chmod 600):

{"api_key": "rc-...", "rcc_token": "rcc_...", "ssh_identity": "~/.ssh/id_ed25519"}

实例管理也可以不用 RCC_TOKEN:本地执行 rcc auth login(rcc 已随本包安装),CLI 登录态直接可用。首次用 SSH 前执行 rcc instance add-key 上传公钥——公钥只对之后创建的实例生效。

其他可选变量:RADEON_BASE_URL、RADEON_OUTPUT_DIR(音频/OCR 图片落盘目录)、RADEON_SSH_KNOWN_HOSTS、RADEON_REQUEST_TIMEOUT、RADEON_MAX_CONCURRENCY。

运行

.venv/bin/radeon-cloud-mcp                              # stdio,由 MCP 客户端拉起
.venv/bin/radeon-cloud-mcp --transport http --port 8000 # HTTP,端点 /mcp

MCP 客户端配置

{
  "mcpServers": {
    "radeon": {
      "command": "uvx",
      "args": ["radeon-cloud-mcp"],
      "env": {
        "RADEON_API_KEY": "rc-...",
        "RCC_TOKEN": "rcc_...",
        "RCC_URL": "https://developer.amd.com.cn/radeon",
        "SSH_PRIVATE_KEY": ""
      }
    }
  }
}

RADEON_API_KEY 必填(Token Factory 推理);RCC_TOKEN+RCC_URL 成对填写后启用实例管理;SSH_PRIVATE_KEY 填写后启用实例内操作/训练。本地运行也可把 command 换成本仓库 .venv/bin/radeon-cloud-mcp 的绝对路径。

工具(20 个)

GPU 实例:credits_status catalog_list instance_create instance_status instance_logs instance_delete instance_connect instance_add_key cli_health instance_exec instance_job instance_transfer instance_gpu_status

Token Factory:list_models model_load chat usage ocr speech decide

示例:部署并训练

catalog_list
instance_create(env="Base", pod_type="one-click", resource_template="resource-16c55g1u", use_pvc=true)
instance_transfer("upload", "train.py", "/workspace/train.py")
instance_exec("python /workspace/train.py", background=true)   → {pid, log_file}
instance_job("logs", pid=..., log_file=...)                    → 训练进度
instance_transfer("download", "/workspace/model.pt", "./model.pt")
instance_delete(confirm=true)

实例按小时扣 credits(1 credit/GPU/小时),不用就销毁;instance_delete 需要 confirm=true。持久数据放 /workspace(use_pvc=true),临时目录随实例删除。

ModelScope 托管部署

见 docs/modelscope-deploy.md:推送 GitHub 后在魔搭「从Github仓库快速创建」,或发布 PyPI 后用 uvx 配置(示例 modelscope/service-config.json)。

开发

.venv/bin/pip install -e ".[dev]"
.venv/bin/python -m pytest tests/ -q
.venv/bin/python scripts/smoke_live.py       # 真实 API 冒烟(需 key)
.venv/bin/python scripts/smoke_stdio.py      # stdio 端到端
.venv/bin/python scripts/smoke_instance.py   # 实例链路只读检查(需 rcc 登录)

文档

许可

Apache-2.0,见 LICENSE。

Available Tools

20 tools
catalog_listA

列出账户可用的环境镜像/资源池/资源规格(instance_create 的参数来源)。 kind: environment | resource_pool | resource_template。可列出≠当前有空闲 GPU。

Inputs: kind, search.

chatA

调用 Token Factory 聊天模型(OpenAI 兼容;内部流式聚合,防 10 分钟非流式掐断)。

输入二选一:prompt(+可选 system)便捷形式,或完整 messages(role: system/user/assistant/tool)。 images 为 URL/data URL/本地路径列表,附加到最后一个 user 消息(仅视觉模型支持,见 list_models)。 reasoning_effort 跨模型安全值 low/medium(high 在 Qwen3.8-27B 上 400,xhigh 在 GLM-5.3-Flash 上 422); 思考文本在返回的 reasoning 字段。部分模型默认思考且消耗 max_tokens 预算,预算过小会得到空 content。 支持 response_format={"type":"json_object"} 与 tools/tool_choice。 注意:stop/seed/logprobs/top_k 等参数会被网关静默丢弃。免费但计入每日 pts 配额;禁止生产用途。

Inputs: model (required), tools, top_p, images, +8 more.

cli_healthA

诊断 rcc 安装、登录态与服务连通(doctor + auth status)。 托管模式验证 RCC_TOKEN/RCC_URL 是否可用的首选工具。

Inputs: no named parameters.

credits_statusA

账户一览:登录状态、credits 余额、当前实例。实例按小时扣 credits (1 credit/GPU/小时),余额耗尽实例会被删除——先保存工作到持久 /workspace。 开发者积分兑换算力券见 README(1 积分=1 小时,每日≤20 积分)。

Inputs: no named parameters.

decideA

决策模型(Clef/d3/d3-flash,d3-flash 更快):描述情境 state(文本或 JSON)+ 命名问题 questions → 每个选项的概率。不生成文本。

questions 三种题型:

  • choice: {"type":"choice","instructions":"问题","criteria":{"选项名":"含义",...}}

  • noul(是否): {"type":"noul","instructions":"问题"}

  • score: {"type":"score","instructions":"问题","criteria":["低","中","高"]}(有序,最低在前) images/videos 为 data URL/本地路径列表(请求体 <5MB,单题 ≤32768 token)。 自动决策请看 probabilities/confidence,而非仅 top 答案(0.55 与 0.99 都是"是", 但只有后者适合自动执行)。按输入 token 计费。

Inputs: state (required), questions (required), model, images, +1 more.

instance_add_keyA

上传 SSH 公钥到账户(仅本地模式有意义;首次用 SSH 前执行)。 identity_file 为私钥路径(默认 ~/.ssh/id_ed25519,CLI 只上传公钥;无密钥时 CLI 会引导生成)。 公钥只对上传之后创建的实例生效。托管模式请改用 SSH_PRIVATE_KEY 注入既有私钥。

Inputs: identity_file.

instance_connectA

获取连接方式。mode=jupyter:打印一次性 JupyterLab 链接(⚠️ 短时效、敏感, 勿写入日志/公开分享);mode=ssh:打印 SSH 命令。远程/托管模式下链接文本可直接使用。

Inputs: mode.

instance_createA

创建 GPU Notebook 实例(每账户同时仅 1 个)。参数来自 catalog_list: env=环境/镜像,pod_type=资源池,resource_template=规格。

⚠️ 实例按小时消耗 credits(ready 后 1–2 分钟内扣首小时),用完即删; 不用时务必 instance_delete。use_pvc=true 挂载持久 /workspace(销毁后保留)。 ssh=true(默认)需先 instance_add_key 上传公钥,之后才能用 instance_exec 等工具。 wait=true 阻塞至 ready(通常 <1 分钟,大镜像数分钟);本地等待超时不代表创建失败, 用 instance_status 跟进。重试创建请带相同 idempotency_key(默认自动生成)。

Inputs: env (required), pod_type (required), resource_template (required), ssh, +3 more.

instance_deleteA

销毁当前实例(不可逆)。⚠️ 临时 workspace 的文件随实例删除;持久 /workspace 保留。 必须显式传 confirm=true 才执行。销毁后轮询 instance_status 直到无运行实例 (刚删除时可能仍显示 shutting down)。登出/停止 MCP 都不会停止计费,只有销毁会。

Inputs: confirm.

instance_execA

在实例内执行 shell 命令(SSH,root)。部署/操作/训练的核心工具。

  • 前台:返回 exit_code/stdout/stderr;timeout_sec 上限 600s。

  • background=true:setsid 脱离会话后台运行(训练等长任务),立即返回 pid/log_file/exit_file;用 instance_job(action=status/logs/stop) 跟进。

  • workdir:先 cd 到该目录(持久数据在 /workspace)。 示例:rocm-smi;pip install -r requirements.txt; background 训练:python train.py --epochs 10。

Inputs: command (required), workdir, log_file, background, +1 more.

instance_gpu_statusA

实例 GPU 状态(rocm-smi):型号/利用率/显存/温度/功耗。训练前后检查 GPU 是否空闲。

Inputs: no named parameters.

instance_jobA

管理 instance_exec(background=true) 启动的任务。 action=status:运行中/已退出+退出码(需 log_file 读 .exit)+进程信息; action=logs:tail 日志(需 log_file);action=stop:先 TERM 后 KILL(进程组)。

Inputs: pid (required), action (required), tail, log_file.

instance_logsA

当前实例的启动调度事件与容器日志(创建卡住/失败时先看这里)。

Inputs: no named parameters.

instance_statusA

当前实例状态:ready/status/message、instance_id、JupyterLab URL、SSH 连接信息、 持久存储挂载情况。注意 rcc 退出码 0 不代表实例健康——以返回的 status/ready 为准。

Inputs: no named parameters.

instance_transferA

SFTP 文件传输(支持目录递归)。direction=upload:本地→实例(训练脚本/数据); download:实例→本地( checkpoint/结果)。托管模式下 local_path 是容器内路径, 远程用户建议改用 instance_exec 内 curl/wget 下载 URL。持久数据放 /workspace。

Inputs: direction (required), local_path (required), remote_path (required).

list_modelsA

列出 Token Factory 当前模型目录:id(chat 的 model 参数)、上下文长度、模态、 思考默认行为与可用档位、pts 价格。目录会变动,调用前以此为准(缓存 5 分钟, refresh=true 强制刷新)。免费;计入每分钟限流但不占并发。

Inputs: query, refresh, vision_only.

model_loadA

查询 Token Factory 模型实时负载(utilization 0-100,state: idle/busy/full/unknown)。 仅中国站有数据;约 10s 刷新。负载仅供展示:full 仍可能接受请求,idle 也可能因 自身配额返回 429。model 省略时返回全部模型。

Inputs: model.

ocrA

MinerU2.5-Pro 文档 OCR:PDF/图片 → 逐页 Markdown。document 为 http(s) URL、 data URL 或本地文件路径(托管模式请用 URL)。pages 为页码列表 [0,1,2] 或范围 "0-5"。 include_images=true 时提取插图并落盘到输出目录(返回路径,不内联 base64)。 按页计费(pts);长文档整篇解析完才返回,耗时较长。

Inputs: document (required), pages, image_limit, include_images.

speechA

OmniVoice 文本转语音:input ≤4096 字符 → 音频文件(24kHz 单声道)。

voice 预设:auto/female/male/female-low/male-low/female-british/male-british/ female-american/male-american;或 instructions 文字描述音色(优先于 voice)。 ref_audio(本地路径/data URL,≤30s 参考音频)+ ref_text 可克隆音色, 不能与 voice/instructions 同用。response_format: wav/mp3/opus/flac/pcm(默认 mp3)。 音频落盘返回路径;远程客户端可 return_base64=true 获取 data URL(体积较大)。 注意:权重 CC-BY-NC,音频禁止商用,需署名(见返回 license_note)。按输入字符计费。

Inputs: input (required), seed, speed, voice, +6 more.

usageA

查询 Token Factory 配额与用量:rpm_limit、每日 pts 上限/已用/剩余、重置时间 (北京时间 00:00)、today/last_30_days/all_time/by_model。字段名带 _usd 但实为 pts 点数,非货币、与 GPU credits 无关。大批量调用前先查剩余配额。

Inputs: include_recent.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 20 tools

    Disambiguation4/5

    Most tools target a clearly distinct resource+action: instance lifecycle (create/status/logs/delete/connect/exec/job/transfer), model inference (chat/list_models/model_load/usage), and media (ocr/speech/decide). A few boundaries blur — instance_status already returns the JupyterLab URL and SSH info that instance_connect prints, and model_load vs list_models vs usage are three separate model-query tools an agent could mix up. Descriptions largely resolve these, so misselection risk is low but not zero.

    Naming Consistency3/5

    All names are snake_case and the instance_* prefix grouping is a strong, predictable cluster. However, verb placement is inconsistent across the set: model_load and catalog_list put the verb last while list_models and instance_create/instance_delete put it first, and several tools are bare nouns/verbs (chat, usage, ocr, speech, decide, cli_health). Readable, but not a single convention.

    Tool Count4/5

    20 tools is on the heavy side, but the server genuinely spans several sub-domains (GPU instance lifecycle, Token Factory inference, OCR/TTS, credits/catalog), so each tool carries a real function rather than being redundant. The ~11 instance_* tools are granular (add_key, gpu_status, logs, job) but each maps to a distinct operational need.

    Completeness4/5

    Instance coverage is near-complete: create, status, GPU metrics, logs, exec, background jobs, file transfer, key upload, connect, and destroy, plus credit/quota awareness. Minor gaps exist — no instance stop/start (only irreversible delete), no direct file read/list primitive short of exec or transfer, and no batch/multi-instance handling — but agents can work around these.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables MCP-compatible applications to interact with local and cloud-hosted LLM models for model management, text generation, chat, embeddings, and web search/fetch.
      727 npm
      AGPL 3.0
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables MCP-compatible applications to manage, run, chat with, and generate embeddings from local or cloud LLM models, and to perform web search and content fetching via cloud APIs.
      727 npm
      AGPL 3.0
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables MCP-compatible applications to manage and use local or cloud-hosted models, including listing, pulling, generating, chatting, embeddings, and web search/fetch through a unified tool interface.
      727 npm
      AGPL 3.0