Skip to main content
Glama

Why This Package?

@runapi.ai/z-image-mcp is a focused Model Context Protocol server for the Z Image model line on RunAPI. It gives MCP-compatible assistants direct access to 1 endpoint and 1 model variant without loading the full RunAPI catalog.

Use this per-model server when an agent should stay scoped to Z Image. Use @runapi.ai/mcp when one assistant should discover every RunAPI model line.


Related MCP server: GPT Image MCP Server

Install

Add it to Claude Code:

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

Use project scope when the server should be shared with a repository:

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

Codex, Cursor, Windsurf, VS Code, Roo Code, and other MCP hosts can use the same stdio command:

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

check_pricing works before sign-in. For task creation and status polling, 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.

Ready-made examples are in examples/ for Claude, Cursor, Windsurf, VS Code, and Roo Code.


Tools

Tool

Auth

Purpose

text_to_image

Yes

Create a Z Image text to image task and optionally wait for a terminal status. Returns the task id, status, and output URLs.

get_task

Yes

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

check_pricing

No

Look up current pricing for a Z Image model and endpoint.


Models

Z Image covers 1 model variant across 1 endpoint. Each tool accepts the models listed for it:

Tool

Models

text_to_image

z-image

Model availability can change between releases. Use check_pricing or the Z Image model page for the current catalog view.


Agent Prompts

Ask your assistant in natural language; it can inspect pricing, create the task, and return the task id plus output URLs.

Create a task

Run a Z Image text to image task with RunAPI.

The assistant can call check_pricing, then text_to_image, and return the task id, status, and output URLs.

Submit without waiting

Create the task but don't wait for it to finish.

The assistant calls the create tool with wait: false and returns the task id. Check on it later with get_task.

Check pricing before creating

Check current Z Image pricing, then create the task if it matches my request.

The assistant calls check_pricing and can link to the Z Image model page for the canonical catalog entry.


Configuration

The server resolves auth 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 check_pricing

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

{
  "apiKey": "your_runapi_key"
}

Do not commit real API keys.


Resource

URL

Z Image model page

https://runapi.ai/models/z-image

npm package

@runapi.ai/z-image-mcp

GitHub repository

runapi-ai/z-image-mcp

RunAPI MCP overview

runapi.ai/mcp

RunAPI docs

runapi.ai/docs


License

Licensed under the Apache License, Version 2.0.

Available Tools

4 tools
check_pricingB

Look up RunAPI pricing for the z-image model line.

ParametersJSON Schema
NameRequiredDescriptionDefault
modelNoModel slug. Defaults to the line's primary model.
actionNoEndpoint name. Defaults to the endpoint that offers the model.

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full behavioral burden. 'Look up' implies a read-only operation, but the description does not confirm that it is non-destructive, whether it requires authentication, whether it consumes quota, or how pricing data is returned.

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?

A single front-loaded sentence with no filler. Every word contributes to stating the tool's purpose.

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 simple two-parameter read tool with full schema coverage, this is minimally adequate. However, with no output schema and no annotations, the description should ideally clarify the shape or currency of returned pricing data and the read-only nature, which it does not.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents the optional 'model' and 'action' parameters. The description adds only the scoping context of the z-image model line and does not explain defaults, enum semantics, or parameter interactions beyond what the schema provides.

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 specific verb ('Look up') and resource ('RunAPI pricing for the z-image model line'), which is distinct from the unrelated siblings login, text_to_image, and get_task. It does not explicitly contrast itself with any sibling, but the purpose is unambiguous and narrow enough that no confusion is likely.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no statement about when to call this tool, when not to, or what alternatives exist. The agent must infer that it should call check_pricing whenever it needs pricing information, with no guidance on prerequisites or relationship to text_to_image.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_taskB

Fetch the current status and latest result payload for a z-image task.

ParametersJSON Schema
NameRequiredDescriptionDefault
actionNoAsynchronous endpoint the task was created on. Defaults to the line's only asynchronous endpoint.
task_idYesTask id returned when the task was created.

TDQS

B3.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden. It usefully discloses that the tool returns both a status and a 'latest' result payload, implying results evolve over time, but it omits what statuses exist, what the payload looks like while the task is still pending, and whether a read-only retrieval has any side effects or limits.

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?

A single front-loaded sentence with no filler; the key noun (task status/result) appears immediately. Nothing in it is wasted.

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?

No output schema and no annotations exist, so the description must cover the return contract, and it only partially does so ('status and latest result payload') without enumerating states or pending behavior. For a simple two-parameter getter this is adequate but leaves real gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so both task_id and the action enum (with its default-endpoint behavior) are already documented in the schema. The description adds nothing beyond the schema, which is the expected baseline of 3 when structured data does the work.

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?

Specific verb (Fetch) plus resource (current status and latest result payload) scoped to a z-image task, which is enough to distinguish it from the sibling text_to_image that creates such tasks. It stops short of naming siblings explicitly, so it lands at 4 rather than 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no statement of when to call this versus alternatives, no polling guidance (interval, retry, how long a task stays queryable), and no prerequisite linking it to a task created by text_to_image. The retrieval context is only implied by the phrase 'for a z-image task'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

loginA

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

ParametersJSON Schema
NameRequiredDescriptionDefault
forceNoRe-run browser login when the current credential comes from the local config file.

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the behavioral burden. It discloses the interactive browser flow and the file write side effect (config.json). However, it does not mention that it may overwrite existing credentials or that it could block waiting for user input, though these are implied.

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, well-structured sentence that front-loads the action ('Authenticate RunAPI') and provides necessary details without extraneous information.

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?

For a simple login tool with one optional parameter and no output schema, the description covers the core purpose and side effect. It lacks an explicit statement that this is a prerequisite for other tools, but that is implied.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% (the only parameter 'force' has a description). The tool description adds no additional meaning about parameters beyond the schema, so the baseline of 3 applies.

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 with a specific verb ('Authenticate'), target resource ('RunAPI'), method ('browser PKCE login flow'), and side effect (saving to config.json). It is distinct from sibling tools, none of which relate to authentication.

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 implies usage (to authenticate RunAPI) but does not explicitly say when to run it (e.g., before other RunAPI tools) or when to use the 'force' parameter. Since there are no alternative auth tools among siblings, 'vs alternatives' is not applicable.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

text_to_imageB

Create a Z Image task on RunAPI (text to image). Returns a task id, status, and output URLs.

ParametersJSON Schema
NameRequiredDescriptionDefault
waitNoPoll until the task reaches a terminal status.
modelNoRunAPI model slug for this model line.
promptYesDeclared type: string.
timeout_msNo
aspect_ratioYesDeclared type: string. Known values: "1:1", "4:3", "3:4", "16:9", "9:16".
callback_urlNoDeclared type: string.
poll_interval_msNo
enable_safety_checkerNoDeclared type: boolean.

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 behavioral burden. It usefully discloses that this is an async task-creating operation and what it returns (task id, status, output URLs), which substitutes for the missing output schema, but says nothing about credit/cost implications, auth requirements, or how the safety checker or callback affect execution.

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?

Two short sentences, front-loaded with the action and resource, and the second sentence earns its place by describing the return payload in the absence of an output schema. No filler or redundancy.

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 an 8-parameter creation tool with no annotations and no output schema, the description covers the return shape but omits cost, auth, polling behavior, and callback mechanics. It is minimally adequate but leaves an agent unable to reason about pricing or the async lifecycle beyond the bare return fields.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Description adds no parameter meaning at all. Schema coverage is a solid 75% and the schema documents wait, model, and aspect_ratio, so the baseline of 3 applies, but weak entries like prompt ('Declared type: string.') and undocumented params such as callback_url, enable_safety_checker, and poll_interval_ms leave the description contributing nothing on this dimension.

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?

States a specific verb and resource: 'Create a Z Image task on RunAPI (text to image),' which clearly distinguishes it from the read-oriented siblings get_task and check_pricing. The branding 'Z Image task' is opaque, but the '(text to image)' gloss makes the core function unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No when-to-use guidance and no routing to alternatives. With a get_task sibling present, the agent gets no guidance on when to rely on the `wait` flag versus fetching later via get_task, nor any mention of cost-checking via check_pricing before invoking.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 4 tool updatesv0.2.0
    • Changedcheck_pricing2 fields changed
      • removedInput schema / additionalProperties
        Removed value: -false
      • removedInput schema / properties / model / enum
        Removed value: -[
        -  "z-image"
        -]
    • Changedget_task2 fields changed
      • removedInput schema / additionalProperties
        Removed value: -false
      • changedInput schema / properties / action / description
        Previous value: -"Endpoint the task was created on. Defaults to the line's only endpoint."New value: +"Asynchronous endpoint the task was created on. Defaults to the line's only asynchronous endpoint."
    • Addedlogin
    • Changedtext_to_image11 fields changed
      • changedInput schema / additionalProperties
        Previous value: -falseNew value: +{}
      • addedInput schema / properties / aspect_ratio / description
        Added value: +"Declared type: string. Known values: \"1:1\", \"4:3\", \"3:4\", \"16:9\", \"9:16\"."
      • removedInput schema / properties / aspect_ratio / enum
        Removed value: -[
        -  "1:1",
        -  "4:3",
        -  "3:4",
        -  "16:9",
        -  "9:16"
        -]
      • addedInput schema / properties / callback_url
        Added value: +{
        +  "description": "Declared type: string.",
        +  "type": "string"
        +}
      • addedInput schema / properties / enable_safety_checker
        Added value: +{
        +  "description": "Declared type: boolean.",
        +  "type": "boolean"
        +}
      • removedInput schema / properties / model / enum
        Removed value: -[
        -  "z-image"
        -]
      • addedInput schema / properties / poll_interval_ms / maximum
        Added value: +9007199254740991
      • addedInput schema / properties / prompt / description
        Added value: +"Declared type: string."
      • removedInput schema / properties / prompt / maxLength
        Removed value: -1000
      • removedInput schema / properties / prompt / minLength
        Removed value: -1
      • addedInput schema / properties / timeout_ms / maximum
        Added value: +9007199254740991
  2. 3 tool updatesv0.1.0
    • First observedcheck_pricing
    • First observedget_task
    • First observedtext_to_image

TDQS

A3.5/5.0

Scored across 4 tools

Disambiguation5/5

Each tool targets a clearly distinct concern: authentication (login), task creation (text_to_image), task polling (get_task), and pricing lookup (check_pricing). No two tools could plausibly be confused for one another.

Naming Consistency4/5

Three tools follow a readable verb/noun style (get_task, check_pricing, text_to_image) while 'login' is a bare verb, a minor deviation. The overall pattern is predictable enough that an agent can infer intent from names alone.

Tool Count4/5

Four tools is a lean but coherent minimum for a single-model image generation service: authenticate, generate, poll, check cost. It is slightly thin but nothing feels redundant or padded.

Completeness3/5

The core create-then-poll lifecycle is covered, but there is no cancel/delete task, no list-tasks operation, and no image-to-image or edit variant for what is presumably an image model. Agents can work around these gaps but will hit dead ends for anything beyond basic text-to-image generation.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers