xmo-image-mcp
v0.2.2
Published
XMO Image MCP Server - AI-powered image generation and editing using Gemini 2.5 Flash Image
Maintainers
Readme
XMO Image MCP Server
AI-powered image generation and editing server using Gemini Image model via XMO API.
Features
- Generate Images: Create new images from text prompts
- Edit Images: Modify existing images with natural language instructions
- Reference Images: Use multiple reference images for better editing results
- Continue Editing: Iteratively improve images without specifying file paths
- Local File Output: Save generated images locally and return only short text plus structured file metadata
- Session State: Automatic tracking of last edited image for seamless workflow
Installation
npm install
npm run buildConfiguration
Set your XMO API key as an environment variable:
export XMO_APIKEY="your-api-key-here"Or provide it directly when calling the tools.
Optional Environment Variables
| Variable | Default | Description |
|----------|---------|-------------|
| XMO_APIKEY | - | Your XMO API key |
Usage
As MCP Server
Add to your Claude Desktop configuration (claude_desktop_config.json):
{
"mcpServers": {
"xmo-image": {
"command": "node",
"args": ["/path/to/xmo-image-mcp/dist/index.js"],
"env": {
"XMO_APIKEY": "your-api-key-here"
}
}
}
}Development
# Build and run
npm run dev
# Build only
npm run buildAvailable Tools
get_server_info
Get server information including model name and base URL.
Parameters: None
generate_image
Generate a new image from text prompt.
Parameters:
prompt(string, required): Text description of the image to createapi_key(string, optional): Your XMO API key
Returns:
- Short text summary in
content - Structured metadata in
structuredContentwithimageCount,images[].path,images[].mimeType,images[].sizeBytes, andlastImagePath
edit_image
Edit a specific existing image file.
Parameters:
imagePath(string, required): Full file path to the image to editprompt(string, required): Text describing the modificationsapi_key(string, optional): Your XMO API keyreferenceImages(array, optional): Array of file paths to reference images
Returns:
- Short text summary in
content - Structured metadata in
structuredContentwith saved file paths and sizes
continue_editing
Continue editing the last image generated or edited in the session.
Parameters:
prompt(string, required): Text describing the modificationsapi_key(string, optional): Your XMO API keyreferenceImages(array, optional): Array of file paths to reference images
Returns:
- Short text summary in
content - Structured metadata in
structuredContentwith saved file paths and sizes
get_last_image_info
Get information about the last generated/edited image.
Parameters: None
Returns:
- Short text summary in
content - Structured metadata in
structuredContentwithfound,path,mimeType,sizeBytes, andmodifiedAt
Output Location
Generated and edited images are saved to:
- Windows:
%USERPROFILE%\Documents\xmo-images\ - macOS/Linux:
./generated_imgs/(or~/xmo-images/if in system directories)
File naming format: {prefix}-{timestamp}-{randomId}.png
MCP Output Design
This server does not return image bytes in MCP tool results.
Instead, image tools:
- save images to local files
- return a short text summary in
content - return machine-readable file metadata in
structuredContent
This keeps MCP stdio responses small and avoids pushing large base64 payloads into model context.
Requirements
- Node.js
^18.19.0 || >=20.6.0 - XMO API key
License
MIT
Repository
https://github.com/xm-opt/xmo-image-mcp
