Images MCP Server
TokenFlux provides a Model Context Protocol (MCP) server for image generation, enabling AI assistants like Claude to generate images through a standardized tool interface.Server Information
Authentication
The MCP endpoint requires authentication via one of:Authorization: Bearer <api_key>headerX-Api-Key: <api_key>header
403 Forbidden when the caller has less than 0.01 credits remaining.
Configuration
Claude Desktop
Add the following to your Claude Desktop configuration (claude_desktop_config.json):
Other MCP Clients
For other MCP-compatible clients, use:- URL:
https://tokenflux.ai/v1/images/mcp - Transport:
streamable-http(stateless) - Auth Header:
Authorization: Bearer YOUR_API_KEY
Available Tools
The MCP server exposes 4 tools for image generation:list_models
List all available VLM models with their IDs, names, descriptions, and pricing. Parameters: None Response:get_model
Get detailed information about a specific model including its input schema. Parameters:
Response:
generate_image
Generate an image using a VLM model. Parameters:
Behavior:
- Waits up to 30 seconds for the image to complete
- If completed: returns
status: "succeeded"withimagesarray - If still processing: returns
status: "processing"withidfor polling
get_generation
Get the status and result of an image generation request. Parameters:
Response:
Status Values
Recommended Workflow
For best results, AI assistants should follow this workflow:- Discover models: Call
list_modelsto see available options - Get input schema: Call
get_modelto understand required parameters - Generate image: Call
generate_imagewith proper input - Poll if needed: If status is
processing, callget_generationuntil complete
Error Handling
MCP tool errors are returned withIsError: true and a text message:
Example Conversation
User: Generate an image of a sunset over mountains Assistant (using MCP tools):- Calls
list_models→ findsblack-forest-labs/flux-schnell - Calls
get_modelwithmodel_id: "black-forest-labs/flux-schnell"→ gets input schema - Calls
generate_imagewith: - Returns image URL to user
Related
- Images REST API - Direct HTTP API for image generation
- Model Context Protocol - MCP specification