smartapi-images
Enables generating images through SmartAPI's image generation endpoint directly from Codex, saving files locally.
README
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
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 build
Tests use a local mock HTTP server and never call SmartAPI.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
E2B
Using MCP to run code via e2b.