relaygpu-mcp
OfficialIntegrates with Relay's model-hosting platform: search models by tag or text, read a model's route/request schema/pricing/status, run any model by name and poll long-running tasks, upload files to obtain URLs for *_url inputs, list and run workflow templates (with polling and cancellation), and search the Relay docs. Also exposes account tools for credit balance, promos, consumption and usage analytics.
This server has a remotely hosted endpoint. Open its connector listing for connection details, authentication requirements, and setup instructions:
@relaygpu/mcp
Relay's MCP server. Your agent can find a Relay model, read its input schema, run it, poll long tasks, upload files, run workflows and search the Relay docs, all from Claude Code, Cursor, VS Code or Claude Desktop. It is built on @relaygpu/client. The tools are generic and take the model as a string, so a model added to Relay works without a new release.
Connect to the hosted server, or run it locally:
How | Credential | |
Hosted (Streamable HTTP) |
|
|
Local (stdio) |
|
|
The server never stores your key: the hosted one reads it from each request and uses it for that request only, the local one reads it from its environment.
Install
Claude Code, Codex, Cursor and VS Code connect to the hosted server: no Node, no npx. Claude Desktop accepts remote servers only through OAuth, which v0 does not offer yet, so it uses the local server through a one-click bundle. Every client can also run the local server; see Local server.
Claude Code
Terminal, in the CLI or the VS Code / JetBrains extension alike:
claude mcp add --transport http --scope user relay https://mcp.relaygpu.com/mcp --header "X-API-Key: relay_sk_..."--scope user makes it available in every project; without it the server exists only in the directory you ran the command in. Check it with /mcp in a new session. If the terminal answers command not found: claude, the extension is installed but the CLI is not: install it with curl -fsSL https://claude.ai/install.sh | bash (or npm install -g @anthropic-ai/claude-code).
Codex
Codex sends the key as a Bearer token from an environment variable, so the key stays out of config.toml. Set RELAY_API_KEY in your shell profile, then:
codex mcp add relay --url https://mcp.relaygpu.com/mcp --bearer-token-env-var RELAY_API_KEYCursor
The button installs the entry below with a placeholder key; replace relay_sk_... in Cursor's MCP settings afterwards. By hand: ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project).
{
"mcpServers": {
"relay": {
"url": "https://mcp.relaygpu.com/mcp",
"headers": { "X-API-Key": "relay_sk_..." }
}
}
}VS Code (Copilot agent mode)
This installs the server for VS Code's own agent (Copilot Chat). Using Claude Code inside VS Code? Use the Claude Code command instead: the Claude Code extension does not read VS Code's MCP config.
VS Code asks for the key once and keeps it in its secret storage. By hand, in .vscode/mcp.json (one workspace) or with MCP: Open User Configuration (every workspace):
{
"inputs": [{ "type": "promptString", "id": "relay-key", "description": "Relay API key (relay_sk_...)", "password": true }],
"servers": {
"relay": {
"type": "http",
"url": "https://mcp.relaygpu.com/mcp",
"headers": { "X-API-Key": "${input:relay-key}" }
}
}
}Claude Desktop
Download
relay.mcpb.Double-click it. Claude Desktop opens an install dialog: click Install.
The extension installs switched off. Open Settings → Extensions → Relay → Configure.
Paste your Relay key and click Save. The key stays in Claude Desktop's secure storage.
Switch Relay on.
The bundle runs on Claude Desktop's built-in Node, so nothing else needs to be installed. get_credits and get_usage read the account, so they take a dashboard JWT or a custom-tier superkey, never a plain key; every other tool works with a plain key.
By hand instead: Settings → Developer → Edit Config opens claude_desktop_config.json in your default editor. Add the block below at the top level, save, then quit Claude Desktop (⌘Q) and reopen it:
{
"mcpServers": {
"relay": {
"command": "npx",
"args": ["-y", "@relaygpu/mcp"],
"env": { "RELAY_API_KEY": "relay_sk_..." }
}
}
}Local server (stdio)
Any client can run the server on your machine instead; it needs Node 20 or newer on the PATH the client sees (see Troubleshooting).
claude mcp add relay --scope user --env RELAY_API_KEY=relay_sk_... -- npx -y @relaygpu/mcp
codex mcp add relay --env RELAY_API_KEY=relay_sk_... -- npx -y @relaygpu/mcpCursor (~/.cursor/mcp.json) and VS Code take the same command / args / env entry as the Claude Desktop block above; VS Code adds "type": "stdio" and lists it under "servers".
Ready-to-copy files are in examples/.
Related MCP server: avots-mcp
Troubleshooting
"Server disconnected", "spawn npx ENOENT" or "Executable not found: npx" (Claude Desktop, Cursor). Apps opened from the Dock or Start menu do not load your shell profile, so a Node installed with nvm, Volta or Homebrew is not on their PATH. Use the Claude Desktop bundle, or put the full path in
"command": runwhich npxin a terminal and paste the result (for example/Users/you/.nvm/versions/node/v22.22.0/bin/npx).TypeError: Relay: no global fetch: the client started Node 16 or older. Install Node 20 or newer, or point"command"at a newernpx.Windows: if the client cannot start
npx, use"command": "cmd"with"args": ["/c", "npx", "-y", "@relaygpu/mcp"].The first start takes a few seconds:
npxdownloads the package once (about 5 s); later starts take about 1 s.
Tools
Tools marked keyless work without a credential on the local server. Keyless tools answer the public catalog; with a credential, search_models, get_model, get_pricing, estimate_cost and run_model's model lookup answer your account's: the models your tier and grants can run appear and run. The others are billed or account tools and need one. A hosted server with OAuth on (see Self-hosting) takes no request without a credential, keyless tools included.
Tool | What it does | Example |
| Find models by tag and/or text; | "Find a text-to-video model from Kling" → |
| Route, request schema, example, pricing and status of one model |
|
| Prices (public; your account's with a credential) for one model or all of them, including the |
|
| Estimate from the price list (public; your account's with a credential; not an invoice) |
|
| Run any model by name and wait up to 45 s |
|
| Poll a task (waits up to 30 s) |
|
| Host a file and get a URL for any |
|
| List the workflow templates | "Which workflows can I run?" |
| Start a workflow run, wait up to 45 s |
|
| Poll a run (waits up to 30 s) |
|
| Cancel a run that is still in progress |
|
| Credit balance, promos and consumption (JWT or custom-tier superkey) | "How many credits do I have left?" |
| Usage analytics (JWT or custom-tier superkey) |
|
| Search the Relay docs |
|
Local files
The hosted server cannot read files on your computer. How a local file reaches a model, per client:
Client | Local file → model |
Claude Code, Cursor, VS Code, Codex (hosted server) |
|
claude.ai, Claude Desktop, ChatGPT |
|
Local server (stdio), any client |
|
Image editors: search_models({tag: "image-to-image"}) lists every image model that takes an input image, each with accepts: ["image"].
Notes
Auth. On the local server, and on a hosted server without OAuth,
tools/listand the keyless tools answer without a credential. A hosted server with OAuth on answers every/mcprequest without a credential with401andWWW-Authenticate: Bearer resource_metadata="…", scope="relay", which is how clients start the "Connect Relay" sign-in;X-API-KeyandAuthorization: Bearer <relay key or dashboard JWT>keep working there. A billed tool called without one returns aMISSING_CREDENTIALStool error that names what to set: theX-API-Keyheader (hosted) orRELAY_API_KEY(stdio). Errors from Relay come back as tool errors that include the error class,code,requestIdand the server's detail. Your key never appears in a tool result or a log line.Long tasks.
run_modelwaits up to 45 s (wait_seconds, 0–45). If the task is still running after that, it returns thetask_idand the line "Do not resubmit: call check_task with this task_id". Every submit carries anIdempotency-Key, so a retry does not bill twice. Pass your ownidempotency_keyif your agent might send the same submit again. Since 0.1.7 every model whose input schema takesasync(image, video, audio) is submitted as a task, so a long image run returns atask_id, never a 524; chat models still answer inline.Expiry. Each result link comes with its expiry: "expires 1 h after completion unless store_output was set". To keep results longer, pass
store_outputwith amedia_storageSKU fromget_pricing(for examplerelay7d). That SKU adds a per-file fee.Image links. The image routes that answer base64 (Gemini, gpt-image, FLUX-2-pro) also answer Relay's own links (
urls); the server returns those links in place of the base64, for 1 h or thestore_outputlifetime. A result that carries base64 without a Relay link is uploaded through/v2/files(at thestore_outputretention, elserelay1h, free within the daily quota) and comes back as a URL and afile_id. Image content blocks are opt-in: passinline_images: true, which applies to images of 1 MB or less.Uploads. On stdio,
upload_filestreams a localpathof up to 100 MB. The hosted server cannot read your disk: useslot: true(see Local files),base64(up to 4 MB) or a publicurl. Retention defaults torelay1h.
Self-hosting
docker build -t relaygpu-mcp .
docker run -p 2300:2300 -e PORT=2300 -e RELAY_BASE_URL=https://relaygpu.com relaygpu-mcpThe server listens on PORT (default 2300) and calls Relay at RELAY_BASE_URL. Endpoints:
POST /mcp: Streamable HTTP, stateless.GET /healthz: returns{status, version}.GET /metrics: Prometheus text withmcp_tool_calls_total{tool,outcome}andmcp_tool_seconds{tool}.GET /.well-known/mcp/server-card.json: the server and its tools.GET /.well-known/oauth-protected-resource(and…/mcp): the RFC 9728 protected-resource metadata, only with OAuth on.
OAuth ("Connect Relay")
OAuth is on when both OAUTH_ISSUER and MCP_RESOURCE_URL are set; with either unset the server behaves as above (no metadata route, keyless tools answer without a credential). All three variables belong to the MCP app and are read once at start:
Variable | Prod | Staging (VPN) | Notes |
|
|
| Relay's authorization server; the JWKS is read from |
|
|
| This server's public |
| secret | secret | The |
A Bearer value that is a JWT issued by OAUTH_ISSUER is an access token: the server verifies it (ES256 against the issuer's JWKS, aud, exp with 60 s skew), exchanges it at Relay for a 5-minute Relay credential and keeps that credential in memory per token hash until 30 s before it expires. A bad, expired or revoked token gets 401 with WWW-Authenticate: Bearer error="invalid_token", …; an authorization server that cannot be reached gets 503. Tokens, credentials and the secret are never logged.
Logs are JSON lines on stderr, WARNING and above by default (LOG_LEVEL). Without Docker, run npm ci && npm run build && node dist/http.js.
License
MIT
Available Tools
14 toolscancel_workflow_runCancel a workflow runADestructiveIdempotentInspect
Cancel a workflow run. Cancels between steps only: a step already running completes and bills. A run that has already ended answers WORKFLOW_RUN_NOT_CANCELLABLE. Needs a Relay credential.
Inputs: run_id (required).
check_taskCheck a Relay taskARead-onlyIdempotentInspect
Checks a task run_model returned (no key needed: the task_id is the capability). Waits up to 30 s for it to finish; returns the result when completed, else its status: then call check_task again, never resubmit. Task results are kept 1 h after they finish.
Inputs: task_id (required), wait_seconds, inline_images.
check_workflow_runCheck a workflow runARead-onlyInspect
Poll a workflow run by run_id, waiting up to wait_seconds (≤ 30) for it to end. Completed → the final output; failed / cancelled → the error; still running → its steps so far: call check_workflow_run again. No key needed: the run_id is the access token.
Inputs: run_id (required), wait_seconds.
estimate_costEstimate a Relay costARead-onlyIdempotentInspect
Estimates the USD cost of a call from the price list (with a credential your account's view: its tier and grants; public otherwise): an estimate, not an invoice (the bill uses provider-reported usage and any custom pricing on your account). Pass only the usage fields the model's billing_type (see get_model or get_pricing) reads: per_token: input_tokens, output_tokens, cached_input_tokens; per_image: image_count, resolution_tier; per_second_video: duration_seconds, quality_mode, sound; per_second_audio: duration_seconds; per_character: character_count; per_media_token: media_input_tokens, media_output_tokens. Add store_output / retention / file_count for storage fees.
Inputs: model (required), usage (required).
get_creditsGet credit balanceARead-onlyInspect
Read the account's credit balance, active promo credits and consumption. Needs a dashboard JWT or a custom-tier superkey; a plain inference key gets PERMISSION_DENIED (403). Needs a Relay credential.
Inputs: no named parameters.
get_modelGet a Relay modelARead-onlyIdempotentInspect
Returns one model's route, request_schema (what run_model's input must follow), request_example, pricing and availability. With a credential the answer is your account's view (what its tier and grants can run), public otherwise. Then call run_model with an input shaped like request_example.
Inputs: model (required).
get_pricingGet Relay pricingARead-onlyIdempotentInspect
Returns Relay's list prices (USD), optionally for one model (with a credential your account's view: its tier and grants; public otherwise), plus media_storage: the per-file fees of the store_output / upload retention SKUs (relay1d, relay7d, …). Then estimate_cost for a number.
Inputs: model.
get_usageGet usageARead-onlyInspect
Read the account's usage and spend per API key, newest keys first, 10 keys per page (pass starting_after = the previous answer's next_cursor for the next page; limit up to 1000). Pass period (e.g. 7d, max 30d) for a by-date breakdown, or from + to. Needs a dashboard JWT or a custom-tier superkey; a plain inference key gets PERMISSION_DENIED (403). Needs a Relay credential.
Inputs: to, from, limit, period, +1 more.
list_workflowsList workflowsARead-onlyInspect
List Relay's workflow templates: multi-step pipelines (e.g. script → voiceover) run as one call. Each entry has workflow_id, input_schema and its steps (step_id + model). Run one with run_workflow; inputs follow input_schema.
Inputs: no named parameters.
run_modelRun a Relay modelAInspect
Runs any Relay model by name (billed to your key). input follows get_model's request_schema (request_example runs as is). Every model whose schema takes async (image, video, audio) is submitted as a task: it waits up to 45 s, past that it returns a task_id — do not resubmit, call check_task. Chat models answer inline. Result links expire 1 h after completion unless store_output names a media_storage SKU from get_pricing. Pass an idempotency_key if you may retry the same submit. Needs a Relay credential.
Inputs: input (required), model (required), store_output, wait_seconds, +2 more.
run_workflowRun a workflowAInspect
Start a workflow run (one submit) and wait up to wait_seconds (≤ 45) for it to finish. Completed → the final output; still running → run_id: call check_workflow_run with it, never resubmit (a new run bills again). Each step is billed as an ordinary request. webhook_url gets ONE signed workflow.completed / workflow.failed delivery when the run ends. Get workflow_id and the inputs shape from list_workflows. Needs a Relay credential.
Inputs: inputs (required), workflow_id (required), webhook_url, store_output, +2 more.
search_docsSearch the Relay docsARead-onlyInspect
Search Relay's public docs (bundled, offline) for how-to, auth, errors, limits, retries, webhooks, files and pricing rules. Returns the best-matching sections: page, heading, docs path with anchor and an excerpt. For a model's input fields use get_model instead; to find a model use search_models.
Inputs: query (required), limit.
search_modelsSearch Relay modelsARead-onlyIdempotentInspect
Lists Relay models by tag and/or text. Common tags: text-to-image, image-to-image, text-to-video, image-to-video, video-to-video, text-to-speech, speech-to-text, text-to-text, text-to-embedding. image-to-image also lists every image model that takes an input image. Returns name, tag, route and accepts (input media the model takes, e.g. ["image"]; [] for none) per model (at most 50). With a credential the list is your account's view (what its tier and grants can run), public otherwise. Then call get_model with a name for its input schema.
Inputs: tag, query.
upload_fileUpload a file to RelayAInspect
Hosts an image, video or audio file on Relay and returns its url: pass that url to any *_url input of run_model. Give exactly one of path (local server only, ≤ 100 MB), base64 (≤ 4 MB) or url (a public link Relay copies). retention: relay1h (default, free within a daily quota) or a media_storage SKU from get_pricing. Needs a Relay credential.
Inputs: url, path, slot, base64, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Tools are largely distinct and the descriptions explicitly cross-reference their partners (run_model → check_task, run_workflow → check_workflow_run), which resolves most ambiguity. The only soft overlaps are the account/money trio get_pricing, estimate_cost, get_usage and get_credits, which an agent could momentarily confuse, plus the parallel check_task/check_workflow_run pair that requires reading descriptions to separate.
Every tool follows a strict snake_case verb_noun pattern (list_workflows, search_models, get_model, run_model, check_task, cancel_workflow_run, upload_file, estimate_cost). The run/check/cancel triplet for workflows and the run/check pair for tasks are named symmetrically, reinforcing the pattern.
14 tools sit squarely in the well-scoped range for an inference/media platform. Each tool maps to a distinct stage: discovery, schema lookup, pricing, execution, polling, cancellation, upload, and account state, with no obviously redundant entries.
The surface covers the full lifecycle for models and workflows: discover → inspect schema → estimate cost → run → poll → cancel → store outputs, plus upload, usage, credits, and docs. The notable gap is asymmetry in cancellation: workflow runs can be cancelled but async model tasks (check_task) have no cancel or list/history operation, which could strand long-running or unwanted tasks.
Maintenance
Related MCP Connectors
AI video, image and audio generation with 140+ AI models from any MCP agent
Create images & video from any MCP agent — 17 models, spend limits, one URL.
Connect MCP clients to 2,000+ AI models without managing provider API keys.
Chat, image, video, and audio models from many vendors behind one remote MCP server and one key.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI agents to discover, compare, and select the best AI models across multiple providers based on pricing, performance, and capabilities, with real-time cost estimation and benchmarking.91,438 npm1MIT
- AlicenseAqualityCmaintenanceHosted multi-model AI media + chat MCP server. Generates images, video, audio, face-swaps and talking-avatars, and chats across 300+ models (Claude, GPT, Gemini, DeepSeek…) - all from one balance and one API key.16MIT

Createya MCP & APIofficial
AlicenseNot gradedqualityDmaintenanceEnables AI agents and developers to generate images, videos, audio, and text using 100+ models via MCP or REST with a single API key.4MIT- FlicenseNot gradedqualityCmaintenanceProvides a live, audited catalog of AI models from NVIDIA NIM, OpenRouter, Nous Portal, and other providers, enabling search, retrieval, and usage examples via MCP tools and resources.-