Skip to content

MCP Tool Reference

The floimg MCP server exposes these tools for AI agents.

Generate an image from parameters.

{
generator: string; // Generator name
params: object; // Generator-specific parameters
output?: string; // Output path (optional)
}
{
"generator": "quickchart",
"params": {
"type": "bar",
"data": {
"labels": ["A", "B", "C"],
"datasets": [{ "data": [10, 20, 30] }]
}
},
"output": "chart.png"
}
GeneratorDescription
quickchartChart.js charts
mermaidDiagrams and flowcharts
qrQR codes
d3D3 visualizations
screenshotWeb page screenshots
gemini-generateAI image generation (requires @teamflojo/floimg-google)
google-imagenGoogle Imagen models (requires @teamflojo/floimg-google)

Transform an existing image.

{
input: string; // Input image path or URL
op: string; // Transform operation
params: object; // Operation parameters
output?: string; // Output path (optional)
}
{
"input": "chart.png",
"op": "resize",
"params": {
"width": 800,
"height": 600
},
"output": "chart-resized.png"
}
OperationParametersDescription
resizewidth, height, fitChange dimensions
blursigmaApply gaussian blur
sharpensigmaSharpen edges
rotateangleRotate by degrees
cropleft, top, width, heightCrop to region
convertformat, qualityChange format
editprompt, provider, apiKeyAI image editing (see below)

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)

Save an image to storage.

{
image: string; // Image reference from generate/transform
path: string; // Destination path
}
{
"image": "generated-chart",
"path": "s3://my-bucket/charts/report.png"
}
PrefixDescription
./ or /Local filesystem
s3://Amazon S3
custom://Registered custom storage

Analyze an image using AI vision.

{
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
}
{
"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" }
}
}
}
}
}
}
ProviderDescription
gemini-visionGemini vision (requires @teamflojo/floimg-google)
grok-visionGrok vision (requires @teamflojo/floimg-xai)

Generate text using AI.

{
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
}
{
"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" }
}
}
}
ProviderDescription
gemini-textGemini text (requires @teamflojo/floimg-google)
grok-textGrok text (requires @teamflojo/floimg-xai)

Execute a multi-step workflow.

{
steps: Array<{
type: 'generate' | 'transform' | 'text' | 'vision';
params: object;
}>;
output?: string; // Final output path
}
{
"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"
}

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 generation
  • gemini-vision - Image analysis
  • gemini-transform - Image editing
  • gemini-generate - Image generation

floimg-xai provides:

  • grok-text - Text generation
  • grok-vision - Image analysis

To use these providers, install the package:

Terminal window
npm install @teamflojo/floimg-google
# or
npm install @teamflojo/floimg-xai

Then restart the MCP server. The providers will be automatically available.


All tools return a response object:

{
"success": true,
"path": "/path/to/output.png",
"width": 800,
"height": 600,
"format": "png",
"size": 45678
}
{
"success": false,
"error": "Generator not found: unknown"
}

AI agents can chain tools together:

  1. Generate a chart
  2. Transform to resize and convert
  3. Save to S3

The MCP server tracks image references between calls, so subsequent operations can reference previous outputs.