Runapi Mcp

io.github.runapi-builder由 GitHub 帳號 runapi-builder 發布v0.17.0更新於 Nov 3, 2026

130+ AI models for image, video, music, and audio — 18 model families, one RunAPI account.

已驗證Streamable HTTP可網頁執行資料與分析媒體與設計AI 與機器學習

概覽

AI 產生的概覽

RunAPI MCP 讓助理瀏覽 160 多個影像、影片、音樂與音訊模型,查詢價格、建立媒體生成任務並查看帳戶餘額。

可以做什麼
  • 依模態、服務或動作瀏覽模型目錄與端點動作
  • 檢視模型支援的端點、輸入限制與目前執行階段價格
  • 查詢指定服務、動作與模型組合的目前價格
  • 搜尋可重複使用的提示詞範例及其已審核範例圖片
  • 使用冪等鍵建立媒體生成任務,可選擇等待完成
  • 取得任務狀態與輸出,並查看帳戶餘額與花費情形
適用情境
適合在 MCP 主機中直接生成影像、影片、音樂或語音,也適合在正式送出任務前先了解 RunAPI 的模型目錄與價格。目錄、價格與提示詞工具不需登入即可使用,因此也適合僅做瀏覽。
執行需求
可作為遠端託管端點使用,也可透過 npm 套件以 stdio 在本機執行(需 Node.js 與 npx)。需要驗證的工具要求 RunAPI 帳戶:可透過 login 工具走 OAuth 登入並寫入共用設定檔,或在無介面環境設定 RUNAPI_API_KEY 環境變數。需要能連線至 RunAPI 的網路。
安裝前請注意
需要驗證的工具會操作真實的 RunAPI 帳戶:create_task 會送出付費生成任務並消耗餘額,check_balance 會揭露帳戶花費情形。login 工具會開啟瀏覽器登入並把 API 金鑰寫入本機設定檔,請勿將該檔案或 RUNAPI_API_KEY 提交到版本控制。任務為非同步執行,逾時後不要重複送出,應沿用同一個冪等鍵。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Runapi Mcp,將其新增到工作區。
  2. 連接 所需的 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
  3. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.runapi-builder%2Frunapi-mcp/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。 客戶端會在首次連接時完成 OAuth 登入。

{
  "mcpServers": {
    "runapi": {
      "type": "http",
      "url": "https://mcp.runapi.ai/mcp"
    }
  }
}

README

RunAPI MCP Server

AI image generation, video generation, music creation, text-to-speech, prompt search, and model discovery — 160+ executable models across 4 modalities in one MCP server.

Works with Claude Code, Codex, Cursor, Windsurf, VS Code, Roo Code, and any MCP-compatible host.

[npm version] [Apache-2.0 license] [MCP Server] [160+ models]

Quick Start | Tools | Examples | Catalog | Platforms


What Is This?

RunAPI MCP Server connects MCP-compatible coding tools to RunAPI. It lets an assistant browse the RunAPI catalog, inspect model inputs, check current runtime pricing, create media tasks, poll task status, and check account balance.

The discovery tools work without an API key because they use the embedded build-time catalog. Authenticated operations use the login tool, runapi login, RUNAPI_API_KEY, or shared RunAPI config.

This package is a pure client. It does not run a local generation backend and only needs RunAPI sign-in for authenticated tools.


Hosted MCP

Remote MCP clients can connect directly to:

text
https://mcp.runapi.ai/mcp

No Node.js installation is required. Use OAuth when the client supports remote MCP authorization, or configure a RunAPI API key as the bearer credential. See the Hosted MCP setup page for Cursor, Claude Desktop, VS Code, and Windsurf configurations.

Hosted MCP exposes the eight Business Tools documented below. Local Login remains available only in the Local MCP package.


Quick Start

For Local MCP over stdio, install RunAPI with Claude Code's MCP command:

bash
claude mcp add runapi -s user -- npx -y @runapi.ai/mcp

The scope flag controls where the MCP server is stored:

  • -s user: global, available in all projects for your user.
  • -s project: team-shared, written to .mcp.json in the current repo so it can be committed.

Use project scope when you want the whole team to share the same server config:

bash
claude mcp add runapi -s project -- npx -y @runapi.ai/mcp

Compatibility fallback for non-Claude Code platforms or manual JSON config:

json
{  "mcpServers": {    "runapi": {      "command": "npx",      "args": ["-y", "@runapi.ai/mcp"]    }  }}

If your host needs a generated config file, use the legacy init command as a fallback:

bash
npx @runapi.ai/mcp init claudenpx @runapi.ai/mcp init cursornpx @runapi.ai/mcp init vscodenpx @runapi.ai/mcp init windsurfnpx @runapi.ai/mcp init roo

Free catalog tools work before sign-in. For task creation, task status, and balance checks, ask your assistant to call the login tool. It opens a browser login and saves credentials to ~/.config/runapi/config.json, the same file used by runapi login. Headless and CI hosts can still set RUNAPI_API_KEY before starting the MCP host.


Tools

ToolAuthPurpose
list_modelsNoList RunAPI models from the embedded catalog. Supports modality, service, and action filters.
get_model_infoNoReturn service, action, modality, input constraints, and current runtime pricing for a model slug. Use service + action when a model appears in multiple endpoints.
list_actionsNoGroup endpoint action names by modality.
check_pricingNoReturn current runtime pricing for a service + action + model combination.
search_promptsNoSearch reusable prompt examples by modality, category, tags, q, model, featured, and pagination. Each prompt returns media: its approved example images, including the cover image of a video prompt. Example videos and reference images are not returned yet.
loginNoStart browser login and save RunAPI credentials to shared local config.
create_taskYesCreate a media task with a required caller-generated idempotency_key; wait for completion by default or return immediately with wait: false.
get_taskYesFetch status and latest payload for an existing media task.
check_balanceYesReturn account balance and spending metrics.

The catalog, pricing, and prompt search tools are designed for funnel-top discovery inside coding tools. The task and balance tools are designed for authenticated workflows.


Examples

Ask your assistant natural-language questions. The assistant should use the tools to discover current model slugs and pricing instead of relying on memorized names.

Browse The Catalog

text
What RunAPI image models are available?

Expected behavior:

  1. The assistant calls list_models with modality: "image".
  2. It summarizes the returned model slugs, services, actions, and required fields.
  3. It avoids quoting stale prices unless it calls check_pricing.

Search Prompt Examples

text
Find image prompt examples for a logo.

Expected behavior:

  1. The assistant calls search_prompts with modality: "image" and q: "logo".
  2. It summarizes returned titles, prompt text, model slugs, categories, tags, and example image URLs.
  3. It uses the selected prompt with get_model_info before creating a task.

Inspect A Model

text
Show me the required parameters for this model slug: <model-slug>

Expected behavior:

  1. The assistant calls get_model_info.
  2. If the response is ambiguous, it chooses the relevant service/action from the returned matches and calls get_model_info again with service and action.
  3. It shows required fields, enum constraints, range constraints, conditional input rules, supported action, and current runtime pricing if available.
  4. It tells you to choose another slug with list_models if the slug is not found.

Create A Media Task

text
Generate a square product image with RunAPI. Pick a suitable image model.

Expected behavior:

  1. The assistant calls list_models to choose a compatible image model.
  2. It calls get_model_info with the selected service/action/model to read the parameter descriptions.
  3. It asks for confirmation if the request is expensive, long-running, or a batch.
  4. It generates one opaque idempotency_key for this logical task and calls create_task.
  5. It returns task ID, status, output URLs, and cost fields when available.

Wait For Completion

Hosted MCP keeps an asynchronous create_task call with wait: true open as request-scoped SSE for up to 300 seconds. It polls about every 5 seconds, sends an SSE heartbeat about every 15 seconds, and sends standard notifications/progress only when the MCP client supplied a progressToken. The terminal JSON-RPC response arrives in that same stream and then closes it.

The terminal tool result includes matching structuredContent and text content with task_id, final status, completed: true, and the RunAPI result. See examples/create-task-and-wait.arguments.json.

Submit Without Waiting

text
Create the task but do not wait for completion.

Expected behavior:

  1. The assistant generates one opaque idempotency_key and calls create_task with wait: false.
  2. It returns the task ID.
  3. You can later ask for status with get_task.

Replay A Task Creation Safely

create_task requires an opaque idempotency_key from 1 to 512 characters. Generate one new key for each logical task and retain it with the exact service, action, model, and params used for that task.

If the create result is unknown because the connection closed or timed out, do not automatically create another task. Retry only when intended, using the same key with the same input. Reusing the key with different input returns a conflict. Do not derive the key from a JSON-RPC request ID or X-Client-Request-Id.

When Completion Wait reaches its deadline, task creation remains successful. The non-error result has matching structured and text content with task_id, latest status, completed: false, wait_deadline_reached: true, and next_action: "get_task". Continue with get_task; do not create a replacement task.

If polling fails or the connection closes after task creation, the task may still be processing. Continue with get_task; do not create a replacement task.

See examples/create-task.arguments.json for submit-only arguments.

Check Account Balance

text
Check my RunAPI balance.

Expected behavior:

  1. The assistant calls check_balance.
  2. If no key is configured, it calls login for browser login, or explains RUNAPI_API_KEY for headless hosts.

Catalog Coverage

The MCP Embedded Catalog is generated from RunAPI's contract snapshot. It includes only models executable by this server release.

ModalityWhat To Use
Imagelist_models with modality: "image"
Videolist_models with modality: "video"
Audio and musiclist_models with modality: "audio"
Utilitylist_models with modality: "utility"

Catalog contents can change between releases. Use list_models for current service/action/model slugs and get_model_info for each model's current constraints.


Pricing

MiniMax H3 pricing

RunAPI pricing is exposed through the check_pricing tool and the public pricing page. Do not rely on examples in README files for exact prices.

Useful flows:

  1. Call list_models to find a candidate model.
  2. Call check_pricing with service, action, and model.
  3. Show the returned current price or link to runapi.ai/pricing.

Free catalog tools do not create tasks and do not consume account balance.


Platform Setup

Claude Code, Cursor, Windsurf, And VS Code

Run:

bash
claude mcp add runapi -s user -- npx -y @runapi.ai/mcp

Use -s user for a global install available in all projects. Use -s project when you want Claude Code to write .mcp.json in the repo for team-shared config.

Restart or reload your MCP host after changing MCP configuration.

Compatibility Fallback: Generated Config

Use init only when a host needs a platform-specific JSON file or cannot use the Claude Code MCP command.

Claude Code fallback:

bash
npx @runapi.ai/mcp init claude

This writes .mcp.json in the current directory.

Cursor fallback:

bash
npx @runapi.ai/mcp init cursor

This writes .cursor/mcp.json. Open Cursor settings to verify the MCP server is enabled.

VS Code fallback:

bash
npx @runapi.ai/mcp init vscode

This writes .vscode/mcp.json. VS Code uses a top-level servers key and type: "stdio" in generated config.

Windsurf fallback:

bash
npx @runapi.ai/mcp init windsurf

This writes the generated config for the Windsurf target used by the init command.

Roo Code

Run:

bash
npx @runapi.ai/mcp init roo

This writes .roo/mcp.json.

Manual Configuration

Use the example files in examples/ as starting points. Each platform has slightly different wrapper keys and file paths, but all run the same command:

bash
npx -y @runapi.ai/mcp

Configuration

The server reads configuration in this order:

  1. RUNAPI_API_KEY environment variable, useful for headless and CI hosts
  2. ~/.config/runapi/config.json, created by the MCP login tool or runapi login
  3. No key, which still allows free catalog tools

The config file is normally managed by login. A pre-provisioned headless config can use:

json
{  "apiKey": "your_runapi_key"}

You can also set a custom base URL for local testing:

json
{  "apiKey": "your_runapi_key",  "baseUrl": "https://runapi.ai"}

Do not commit real API keys.


Data Sync

This package ships build-time contract data:

  • data/contract.json: catalog, actions, model slugs, and input constraints

Refresh data from the RunAPI source tree before a release:

bash
npm run sync:data

Contract updates require a new package release. Pricing is queried from the RunAPI runtime API and does not use a package snapshot.


Development

bash
npm installnpm run typechecknpm testnpm pack --dry-run

Run the server locally:

bash
npm run dev

Manual initialize smoke test:

bash
printf '%s\n' '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"test","version":"0.1.0"}},"id":1}' | npx tsx src/index.ts

Package Contents

The npm package includes:

  • compiled dist/ files
  • embedded data/ files
  • platform examples
  • eval scenarios, when generated by this repo
  • README, changelog, license, and package metadata

It does not include node_modules, .env, local config files, or API keys.


Also Available Via CLI

RunAPI also has a separate command-line client for terminal workflows. Use this MCP server when you want RunAPI available inside an MCP host. Use the CLI when you want direct shell commands, scripts, or CI integration.


License

Licensed under the Apache License, Version 2.0.

來源:README.md,提交 6db9fa1

工具

9

list_models

List RunAPI models from the embedded catalog. Optional filters: modality, service, or action.

輸入參數actionservicemodality

get_model_info

Get supported endpoint, current runtime pricing, and input constraints for a RunAPI model slug. Add service and action when the model supports multiple endpoints.

輸入參數model必填actionservice

list_actions

List RunAPI endpoint names grouped by output modality.

無需輸入參數。

check_pricing

Return current runtime pricing for a RunAPI model/action pair.

輸入參數modelaction必填service必填

search_prompts

Search RunAPI prompt examples by modality, category, tags, text query, or model. Each prompt includes its approved example images in media; example videos and reference images are not returned. Free, no API key required.

輸入參數qpagetagsmodelcategorymodalityper_page

check_balance

Return the authenticated RunAPI account balance and spending metrics.

無需輸入參數。

create_task

Run a RunAPI operation with a caller-generated idempotency key. Asynchronous operations can optionally poll until completion.

輸入參數waitmodelaction必填paramsservice必填timeout_msidempotency_key必填poll_interval_ms

get_task

Fetch the current status and latest payload for an existing RunAPI task.

輸入參數actionservice必填task_id必填

login

Authenticate RunAPI by opening a browser PKCE login flow and saving the API key to ~/.config/runapi/config.json.

輸入參數force

版本歷史

8
  1. v0.17.0最新Oct 29, 2026
  2. v0.16.2Oct 23, 2026
  3. v0.16.1Oct 22, 2026
  4. v0.16.0Oct 15, 2026
  5. v0.15.0Sep 30, 2026
  6. v0.14.0Sep 29, 2026
  7. v0.13.1Sep 28, 2026
  8. v0.12.5Sep 16, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分