smartapi-images
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@smartapi-images Create a realistic painting of a sunset over the ocean."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
SmartAPI Images for Codex
smartapi-images packages a local MCP server and a Codex skill for generating one image through
SmartAPI's explicit POST /v1/images/generations endpoint.
The Codex reasoning model remains a text model such as gpt-5.6-sol. When the user asks for an
image, Codex calls the generate_image tool, which spends the user's SmartAPI balance and saves the
returned image locally.
Requirements
Node.js 20 or newer
A normal SmartAPI user key with enough available balance
Related MCP server: cliproxy
Local setup
corepack pnpm install
corepack pnpm check
export SMARTAPI_API_KEY='sk-smart-...'The default API URL is https://api.smartapi.shop/v1. Generated files are written to
~/Pictures/SmartAPI by default. Override either setting without editing the repository:
export SMARTAPI_BASE_URL='https://api.smartapi.shop/v1'
export SMARTAPI_IMAGE_OUTPUT_DIR="$HOME/Pictures/SmartAPI"For a direct Codex MCP configuration:
[mcp_servers.smartapi_images]
command = "node"
args = ["/absolute/path/to/smartapi-images/dist/index.js"]
env_vars = ["SMARTAPI_API_KEY", "SMARTAPI_BASE_URL", "SMARTAPI_IMAGE_OUTPUT_DIR"]
tool_timeout_sec = 360
enabled_tools = ["generate_image"]Never put a SmartAPI key in .mcp.json, config.toml, source files, logs, or Git.
Tool
generate_image accepts:
prompt: required image descriptionsize:autoor anyWIDTHxHEIGHT; SmartAPI reports the normalized effective sizequality:auto,low,medium, orhighoutput_format:png,jpeg, orwebpfilename: optional safe filename without an extension
The tool never overwrites a file and never retries an ambiguous network or timeout failure. It returns the absolute file path, effective size, charged tokens, and SmartAPI request ID.
Development
corepack pnpm typecheck
corepack pnpm test
corepack pnpm buildTests use a local mock HTTP server and never call SmartAPI.
Available Tools
1 toolgenerate_imageGenerate image with SmartAPIA
Generate one image through the paid SmartAPI gpt-image-2 endpoint and save it as a local file. Use only when the user asks to create an image. The call spends SmartAPI balance.
Inputs: prompt (required), size, quality, filename, +1 more. Returns: path, request_id, output_format, charged_tokens, +1 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
Only one tool exists, so there is no possibility of confusion between tools.
With a single tool, naming is trivially consistent.
One tool is very thin for a typical server, but it may be acceptable if the scope is strictly image generation via a paid endpoint.
The tool only covers generating an image; there are no tools for managing past images (list, delete) or configuring generation parameters beyond the prompt, leaving obvious gaps.
Maintenance
Related MCP Connectors
AI image + video generation for agents: --flag prompt DSL, async generate/poll, x402 pay-per-use.
Generate AI images and videos from any compatible MCP client.
Ask other AI models and generate images, speech, music and video from your coding agent.
Generate images, video, and audio with Glif's media-generation agent
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables generating images from text prompts using OpenAI's GPT-Image-2 model within Claude Code and Codex conversations.1MIT
- AlicenseAqualityCmaintenanceEnables AI coding assistants like Codex, Claude Code, and ZCode to generate images through CLIProxy's ChatGPT image API, saving original images locally and returning previews.333 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables image generation through any OpenAI-compatible images/generations endpoint, saving results to disk and returning them inline for the model.MIT
- AlicenseAqualityBmaintenanceEnables Codex to connect to an OpenAI-compatible Images API for listing models, generating or editing images, saving results to local workspace files, and checking job status.41MIT