MCP Tool Reference
The floimg MCP server exposes these tools for AI agents.
floimg_generate
Section titled “floimg_generate”Generate an image from parameters.
Parameters
Section titled “Parameters”{ generator: string; // Generator name params: object; // Generator-specific parameters output?: string; // Output path (optional)}Example
Section titled “Example”{ "generator": "quickchart", "params": { "type": "bar", "data": { "labels": ["A", "B", "C"], "datasets": [{ "data": [10, 20, 30] }] } }, "output": "chart.png"}Available Generators
Section titled “Available Generators”| Generator | Description |
|---|---|
quickchart | Chart.js charts |
mermaid | Diagrams and flowcharts |
qr | QR codes |
d3 | D3 visualizations |
screenshot | Web page screenshots |
gemini-generate | AI image generation (requires @teamflojo/floimg-google) |
google-imagen | Google Imagen models (requires @teamflojo/floimg-google) |
floimg_transform
Section titled “floimg_transform”Transform an existing image.
Parameters
Section titled “Parameters”{ input: string; // Input image path or URL op: string; // Transform operation params: object; // Operation parameters output?: string; // Output path (optional)}Example
Section titled “Example”{ "input": "chart.png", "op": "resize", "params": { "width": 800, "height": 600 }, "output": "chart-resized.png"}Available Operations
Section titled “Available Operations”| Operation | Parameters | Description |
|---|---|---|
resize | width, height, fit | Change dimensions |
blur | sigma | Apply gaussian blur |
sharpen | sigma | Sharpen edges |
rotate | angle | Rotate by degrees |
crop | left, top, width, height | Crop to region |
convert | format, quality | Change format |
edit | prompt, provider, apiKey | AI image editing (see below) |
AI Transform (Edit)
Section titled “AI Transform (Edit)”Use the edit operation with an AI provider:
{ "input": "photo.jpg", "op": "edit", "params": { "provider": "gemini-transform", "prompt": "Make the sky more vibrant with sunset colors", "apiKey": "your-google-ai-key" }, "output": "enhanced-photo.jpg"}Available AI transform providers:
gemini-transform- Gemini image editing (requires@teamflojo/floimg-google)
floimg_save
Section titled “floimg_save”Save an image to storage.
Parameters
Section titled “Parameters”{ image: string; // Image reference from generate/transform path: string; // Destination path}Example
Section titled “Example”{ "image": "generated-chart", "path": "s3://my-bucket/charts/report.png"}Supported Destinations
Section titled “Supported Destinations”| Prefix | Description |
|---|---|
./ or / | Local filesystem |
s3:// | Amazon S3 |
custom:// | Registered custom storage |
analyze_image
Section titled “analyze_image”Analyze an image using AI vision.
Parameters
Section titled “Parameters”{ image: string; // Image path or URL prompt?: string; // Analysis prompt (default: "Describe this image") provider?: string; // Vision provider (default: auto-detected) apiKey?: string; // API key for the provider outputFormat?: 'text' | 'json'; // Response format jsonSchema?: object; // Schema for structured output}Example
Section titled “Example”{ "image": "product.jpg", "prompt": "List all products with their colors and estimated prices", "provider": "gemini-vision", "outputFormat": "json", "jsonSchema": { "type": "object", "properties": { "products": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "color": { "type": "string" }, "price": { "type": "string" } } } } } }}Available Providers
Section titled “Available Providers”| Provider | Description |
|---|---|
gemini-vision | Gemini vision (requires @teamflojo/floimg-google) |
grok-vision | Grok vision (requires @teamflojo/floimg-xai) |
generate_text
Section titled “generate_text”Generate text using AI.
Parameters
Section titled “Parameters”{ prompt: string; // Text prompt provider?: string; // Text provider (default: auto-detected) apiKey?: string; // API key for the provider context?: string; // Additional context systemPrompt?: string; // System instructions outputFormat?: 'text' | 'json'; // Response format jsonSchema?: object; // Schema for structured output}Example
Section titled “Example”{ "prompt": "Generate 3 creative prompts for product photography", "provider": "gemini-text", "outputFormat": "json", "jsonSchema": { "type": "object", "properties": { "prompts": { "type": "array", "items": { "type": "string" } }, "style": { "type": "string" } } }}Available Providers
Section titled “Available Providers”| Provider | Description |
|---|---|
gemini-text | Gemini text (requires @teamflojo/floimg-google) |
grok-text | Grok text (requires @teamflojo/floimg-xai) |
run_pipeline
Section titled “run_pipeline”Execute a multi-step workflow.
Parameters
Section titled “Parameters”{ steps: Array<{ type: 'generate' | 'transform' | 'text' | 'vision'; params: object; }>; output?: string; // Final output path}Example
Section titled “Example”{ "steps": [ { "type": "vision", "params": { "image": "input.jpg", "prompt": "Describe the mood of this image", "provider": "gemini-vision" } }, { "type": "text", "params": { "prompt": "Based on this mood description, suggest an edit", "context": "{{previous.content}}" } }, { "type": "transform", "params": { "input": "input.jpg", "op": "edit", "provider": "gemini-transform", "prompt": "{{previous.content}}" } } ], "output": "enhanced.jpg"}Provider Auto-Discovery
Section titled “Provider Auto-Discovery”When @teamflojo/floimg-google or @teamflojo/floimg-xai are installed, the MCP server automatically discovers and registers their providers:
floimg-google provides:
gemini-text- Text generationgemini-vision- Image analysisgemini-transform- Image editinggemini-generate- Image generation
floimg-xai provides:
grok-text- Text generationgrok-vision- Image analysis
To use these providers, install the package:
npm install @teamflojo/floimg-google# ornpm install @teamflojo/floimg-xaiThen restart the MCP server. The providers will be automatically available.
Tool Responses
Section titled “Tool Responses”All tools return a response object:
Success
Section titled “Success”{ "success": true, "path": "/path/to/output.png", "width": 800, "height": 600, "format": "png", "size": 45678}{ "success": false, "error": "Generator not found: unknown"}Chaining Tools
Section titled “Chaining Tools”AI agents can chain tools together:
- Generate a chart
- Transform to resize and convert
- Save to S3
The MCP server tracks image references between calls, so subsequent operations can reference previous outputs.
See Also
Section titled “See Also”- MCP Overview - Introduction to MCP
- Claude Integration - Setup guide
- Examples - Common use cases