Skip to main content
Glama

Animagine MCP

FastMCP server for the Animagine XL 4.0 image generation experience, providing prompt validation, optimization, explanation, and checkpoint/LoRA management tools.

For AI Agents: This repository includes comprehensive markdown documentation in 02-behavior/, 03-contracts/, 04-quality/, and 05-implementation/ directories. These files contain detailed specifications, behavior rules, prompt taxonomies, and implementation guides optimized for AI agent consumption. If you're building AI-powered workflows or need structured guidance for prompt engineering, check out these resources.

For Humans: Welcome! A few friendly reminders:

  • Do not commit AI agent files (.cursor/, .claude/, .copilot/, etc.) — these are already in .gitignore

  • Be respectful in discussions — we're all here to learn and build together

  • Help each other — share your knowledge, ask questions, and contribute back

Let's create something amazing together! 🎨


Table of Contents


Related MCP server: FastMCP

Overview

Animagine MCP exposes powerful tools through FastMCP (MCP protocol) and FastAPI (REST API):

  • Prompt Tools: validate_prompt, optimize_prompt, explain_prompt

  • Model Tools: list_models, load_checkpoint, unload_loras

  • Generation Tools: generate_image, generate_image_from_image

Key features:

  • Dual API support: Use MCP protocol for AI agents or REST API for web/app integration

  • Normalizes prompts for consistent structure, category coverage, and tag ordering

  • Integrates with local checkpoint and LoRA assets

  • GPU-accelerated image generation with CUDA support

  • Docker-ready with comprehensive GPU configuration

  • Interactive API documentation with Swagger UI

Choose Your Interface

Interface

Best For

Port

MCP Server

Claude Desktop, Cursor, other MCP clients

stdio

REST API

Web applications, CLI tools, mobile apps

8000

REPL

Interactive testing and development

stdin/stdout

Note: This platform can generate NSFW material. Choosing to do so and owning the resulting content is the caller's responsibility.


Quick Start Guide

The fastest way to get started with GPU acceleration.

What's Included

  • Automatic setup: Directories (checkpoints/, loras/, outputs/) are created automatically

  • Pre-downloaded model: Animagine XL 4.0 (~6GB) is downloaded during build

  • GPU acceleration: CUDA 12.1 with optimized PyTorch

  • REST API: FastAPI server on port 8000 with interactive documentation

Prerequisites

  • Docker and Docker Compose installed

  • NVIDIA GPU with drivers installed (verify with nvidia-smi)

  • NVIDIA Container Toolkit (installation guide)

  • ~15GB disk space (for Docker image + model)

Steps

Step 1: Clone the repository

git clone https://github.com/gabrielalmir/mcp-animaginexl.git
cd mcp-animaginexl

Step 2: Build and start the container

docker-compose up -d

Note: First build downloads Animagine XL 4.0 (~6GB) and may take 10-20 minutes depending on your connection. Subsequent builds use cached layers.

Step 3: Verify startup (watch logs)

docker-compose logs -f

You should see:

=== Animagine MCP Startup ===
Checking directories...
  ✓ /app/checkpoints
  ✓ /app/loras
  ✓ /app/outputs
Verifying Animagine XL 4.0 model...
  ✓ Model already cached
Checking GPU status...
  ✓ GPU Available: NVIDIA GeForce RTX 3090
  ✓ CUDA Version: 12.1
=== Starting Animagine MCP Server ===

Step 4: Access the services

REST API:

MCP Server (for Claude Desktop, Cursor, etc.):

Quick Docker Commands

Command

Description

docker-compose up -d

Start the server

docker-compose down

Stop the server

docker-compose logs -f

View logs

docker-compose exec animagine-mcp bash

Shell access

docker-compose build --no-cache

Rebuild from scratch

Environment Variables

Variable

Description

Default

SKIP_MODEL_DOWNLOAD

Skip model download/verification on startup

false

MODEL_ID

HuggingFace model ID to use

cagliostrolab/animagine-xl-4.0

HF_TOKEN

HuggingFace token (required for gated models)

(unset)

CUDA_VISIBLE_DEVICES

GPU device selection (e.g. "0", "0,1")

"0"

See DOCKER.md for full configuration reference and DOCKER_MCP_CONNECTION.md for connecting MCP clients to the Docker container.


Option 1b: REST API Only

If you only want to use the REST API without MCP protocol support:

# Run the API server directly (requires local Python 3.11+)
pip install -e .
animagine-api

The API will be available at http://localhost:8000 with full documentation at /docs.


Option 2: Local Installation

For development or systems without Docker.

Prerequisites

  • Python >= 3.11

  • GPU with CUDA support (recommended)

  • git and pip

Steps

Step 1: Clone and create virtual environment

git clone https://github.com/gabrielalmir/mcp-animaginexl.git
cd mcp-animaginexl
python -m venv .venv

Step 2: Activate the virtual environment

Windows:

.venv\Scripts\activate

Linux/macOS:

source .venv/bin/activate

Step 3: Install dependencies

pip install -e .

Step 4: Start the MCP server

animagine-mcp

Step 5: Verify it's running

The server is now exposing tools via FastMCP at the default endpoint.


Option 3: Interactive REPL (Testing)

Test MCP tools interactively without running the full server.

Quick Start

# From project root (no installation needed)
python repl.py

# Or if installed
animagine-repl

REPL Interface

╔═══════════════════════════════════════════════════════════════════╗
║                    Animagine MCP REPL                             ║
║                  Interactive Tool Testing                         ║
╠═══════════════════════════════════════════════════════════════════╣
║  Commands:                                                        ║
║    help              - Show help message                          ║
║    tools             - List available tools                       ║
║    tool <name>       - Show tool details                          ║
║    exit              - Exit the REPL                              ║
╚═══════════════════════════════════════════════════════════════════╝

animagine> validate_prompt("1girl, blue hair, masterpiece")
{
  "is_valid": true,
  "issues": [],
  "suggestions": [...]
}

animagine> optimize_prompt(description="anime girl in a garden")
{
  "optimized_prompt": "1girl, solo, garden, flowers, ..., masterpiece, best quality",
  "actions": [...]
}

CLI Options

python repl.py --list              # List all tools
python repl.py --tool validate     # Show tool details
python repl.py -e "list_models()"  # Execute single command
python repl.py --debug             # Enable debug mode

MCP Client Configuration

To connect an MCP client (like Claude Desktop, VS Code, or other MCP-compatible tools) to this server, create a .mcp.json configuration file.

Example .mcp.json

For local installation:

{
  "mcpServers": {
    "animagine": {
      "command": "animagine-mcp",
      "env": {}
    }
  }
}

For development (running from source):

{
  "mcpServers": {
    "animagine": {
      "command": "python",
      "args": ["-m", "animagine_mcp.server"],
      "cwd": "/path/to/mcp-animaginexl",
      "env": {
        "PYTHONPATH": "/path/to/mcp-animaginexl/src"
      }
    }
  }
}

For Docker:

{
  "mcpServers": {
    "animagine": {
      "command": "docker",
      "args": ["exec", "-i", "animagine-mcp-server", "animagine-mcp"],
      "env": {}
    }
  }
}

Windows example:

{
  "mcpServers": {
    "animagine": {
      "command": "python",
      "args": ["-m", "animagine_mcp.server"],
      "cwd": "C:\\Users\\YourName\\Projects\\mcp-animaginexl",
      "env": {
        "PYTHONPATH": "C:\\Users\\YourName\\Projects\\mcp-animaginexl\\src"
      }
    }
  }
}

Configuration Options

Field

Description

command

Executable to run (animagine-mcp, python, or docker)

args

Command line arguments

cwd

Working directory (optional)

env

Environment variables (optional)

Where to Place .mcp.json

Depending on your MCP client:

  • Claude Desktop: ~/.config/claude/mcp.json (Linux/Mac) or %APPDATA%\Claude\mcp.json (Windows)

  • VS Code: Project root or workspace settings

  • Other clients: Check client documentation


Core Tools

The same powerful tools are available through both MCP protocol and REST API:

Prompt Tools

Tool

MCP Call

REST Endpoint

Description

validate_prompt

validate_prompt(...)

POST /api/v1/validate-prompt

Validates prompt against Animagine XL rules

optimize_prompt

optimize_prompt(...)

POST /api/v1/optimize-prompt

Restructures and optimizes prompt tags

explain_prompt

explain_prompt(...)

POST /api/v1/explain-prompt

Explains each tag's category and effect

Model Tools

Tool

MCP Call

REST Endpoint

Description

list_models

list_models()

GET /api/v1/models

Lists available checkpoints and LoRAs

load_checkpoint

load_checkpoint(...)

POST /api/v1/load-checkpoint

Pre-loads a checkpoint to GPU memory

unload_loras

unload_loras()

POST /api/v1/unload-loras

Removes all LoRA weights from pipeline

Generation Tools

Tool

MCP Call

REST Endpoint

Description

generate_image

generate_image(...)

POST /api/v1/generate

Generates image from prompt

generate_image_from_image

generate_image_from_image(...)

POST /api/v1/generate-img2img

Image-to-image transformation

Using the REST API

For detailed REST API documentation, see API.md which includes:

  • Full endpoint reference

  • Request/response examples

  • cURL examples

  • Python client examples

  • Performance tuning guide

Quick start:

# List available models
curl http://localhost:8000/api/v1/models

# Generate an image
curl -X POST http://localhost:8000/api/v1/generate \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "masterpiece, best quality, anime girl",
    "steps": 28
  }'

# Interactive documentation
open http://localhost:8000/docs

Usage Examples

Example 1: Validate a Prompt

# Validate before generation
result = validate_prompt(
    prompt="1girl, blue hair, school uniform",
    width=832,
    height=1216
)
print(result)  # Shows issues and suggestions

Example 2: Optimize a Natural Language Description

# Convert description to optimized tags
result = optimize_prompt(
    description="A beautiful anime girl with long silver hair standing in a flower field at sunset"
)
print(result["optimized_prompt"])

Example 3: Generate an Image

# Generate with default settings
result = generate_image(
    prompt="1girl, silver hair, flower field, sunset, masterpiece, best quality",
    steps=28,
    guidance_scale=5.0
)
print(f"Image saved to: {result['image_path']}")

Example 4: Use Custom Checkpoint and LoRA

# List available models first
models = list_models()
print(models["checkpoints"])
print(models["loras"])

# Generate with custom models
result = generate_image(
    prompt="1girl, anime style, masterpiece",
    checkpoint="custom_model.safetensors",
    loras=["style_lora.safetensors"],
    lora_scales=[0.8]
)

REST API

For full REST API documentation with detailed examples, see API.md.

Quick Reference

Base URL: http://localhost:8000/api/v1

Interactive Documentation: http://localhost:8000/docs

Common Endpoints:

  • POST /validate-prompt - Validate a prompt

  • POST /optimize-prompt - Optimize a prompt

  • POST /explain-prompt - Explain prompt tags

  • GET /models - List available models

  • POST /load-checkpoint - Load a checkpoint

  • POST /generate - Generate an image

  • POST /generate-img2img - Transform an image

Example: Generate an image via REST API

curl -X POST http://localhost:8000/api/v1/generate \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "masterpiece, best quality, anime girl, blue hair",
    "steps": 28,
    "guidance_scale": 5.0
  }'

Advanced Guide

GPU Acceleration

GPU acceleration provides 10-50x faster generation compared to CPU.

Requirements

  • NVIDIA GPU (GTX 1060 or newer recommended)

  • CUDA drivers installed

  • For Docker: NVIDIA Container Runtime

Verify GPU Setup

# Check NVIDIA driver
nvidia-smi

# Check PyTorch GPU support (in container or local env)
python -c "import torch; print(torch.cuda.is_available())"

GPU Performance Tips

  1. Pre-load checkpoints to reduce first-generation latency:

    load_checkpoint("default")  # Pre-loads Animagine XL 4.0
  2. Monitor GPU usage during generation:

    watch -n 1 nvidia-smi
  3. Optimize memory for large models:

    # Set in environment
    export PYTORCH_CUDA_ALLOC_CONF="max_split_size_mb:512"

See GPU_SETUP.md for detailed GPU configuration.


Docker Configuration

Three Docker Compose configurations are available:

File

Description

Use Case

docker-compose.yml

GPU-enabled (default)

Production with NVIDIA GPU

docker-compose.gpu.yml

Advanced GPU settings

Multi-GPU, profiling

docker-compose.cpu.yml

CPU-only fallback

Development, no GPU

Switching Configurations

# GPU (default)
docker-compose up -d

# Advanced GPU
docker-compose -f docker-compose.gpu.yml up -d

# CPU-only
docker-compose -f docker-compose.cpu.yml up -d

Custom Port

Edit docker-compose.yml:

ports:
  - "8001:8000"  # Change 8001 to desired port

Resource Limits

deploy:
  resources:
    limits:
      memory: 8G  # Increase for larger models

See DOCKER.md for comprehensive Docker documentation.


Model Management

Adding Checkpoints

Place .safetensors or .ckpt files in ./checkpoints/:

cp my_model.safetensors ./checkpoints/

Adding LoRAs

Place LoRA files in ./loras/:

cp my_lora.safetensors ./loras/

Verifying Models

models = list_models()
print("Checkpoints:", models["checkpoints"])
print("LoRAs:", models["loras"])
print("Currently loaded:", models["currently_loaded"])

Environment Variables

Variable

Description

Default

CUDA_VISIBLE_DEVICES

GPU device ID(s)

0

TORCH_CUDNN_BENCHMARK

Enable cuDNN auto-tuner

1

PYTORCH_CUDA_ALLOC_CONF

Memory allocation config

max_split_size_mb:512

HF_HOME

Hugging Face cache directory

~/.cache/huggingface

HF_HUB_DISABLE_TELEMETRY

Disable HF telemetry

1

Setting Variables

Local:

export CUDA_VISIBLE_DEVICES=0
animagine-mcp

Docker (in docker-compose.yml):

environment:
  CUDA_VISIBLE_DEVICES: "0,1"  # Use GPUs 0 and 1

Performance Optimization

GPU

VRAM

Recommended Steps

Batch Size

RTX 3060

12GB

28

1

RTX 3080

10GB

28

1

RTX 3090

24GB

28-50

1-2

RTX 4090

24GB

28-50

2-4

A100

40GB+

50+

4+

Speed vs Quality Trade-offs

Setting

Speed

Quality

steps=20

Fast

Good

steps=28

Balanced

Great

steps=50

Slow

Excellent

Using LCM LoRA for Speed

# 4-8x faster generation with LCM
result = generate_image(
    prompt="1girl, masterpiece",
    loras=["custom_lora.safetensors"],
    steps=8,  # Reduced from 28
    guidance_scale=1.5  # Reduced from 5.0
)

AI Agent Resources

This repository includes comprehensive documentation optimized for AI agents and automated workflows.

Documentation Structure

Directory

Purpose

Key Files

02-behavior/

Model behavior specifications

model-behavior-spec.md, prompt-rulebook.md, prompt-taxonomy.yaml

03-contracts/

Interface contracts and schemas

mcp-interface-contract.md, config-defaults-spec.md, error-handling-spec.md

04-quality/

Quality guidelines and strategies

quality-evaluation-guide.md, negative-prompt-strategy.md, prompt-cookbook.md

05-implementation/

Implementation guides

implementation-guide.md, mcp-tooling-notes.md

For AI Agent Developers

These resources are designed for:

  • Prompt Engineering: Detailed taxonomy and rules for Animagine XL 4.0 prompts

  • Automated Pipelines: Structured contracts for integrating with CI/CD or batch processing

  • Quality Assurance: Evaluation criteria and negative prompt strategies

  • MCP Integration: Interface specifications for building MCP-compatible clients

# View behavior specifications
cat 02-behavior/model-behavior-spec.md

# View prompt rules and taxonomy
cat 02-behavior/prompt-rulebook.md
cat 02-behavior/prompt-taxonomy.yaml

# View MCP interface contract
cat 03-contracts/mcp-interface-contract.md

# View quality guidelines
cat 04-quality/prompt-cookbook.md

Using with AI Coding Assistants

When using AI coding assistants (Claude, Cursor, Copilot, etc.), you can reference these docs:

"Read 02-behavior/prompt-rulebook.md and help me create a valid Animagine prompt"
"Based on 03-contracts/mcp-interface-contract.md, implement a client for this MCP"
"Use 04-quality/negative-prompt-strategy.md to improve my negative prompts"

Repository Layout

mcp-animaginexl/
├── src/animagine_mcp/          # Core package
│   ├── contracts/              # Data schemas and errors
│   ├── diffusion/              # Diffusion pipeline wrapper
│   ├── prompt/                 # Prompt processing tools
│   ├── server.py               # FastMCP server definition
│   └── repl.py                 # Interactive REPL module
├── checkpoints/                # Model checkpoints (.safetensors) [auto-created]
├── loras/                      # LoRA modifiers [auto-created]
├── outputs/                    # Generated images [auto-created]
├── 02-behavior/                # Behavior specifications
├── 03-contracts/               # Interface contracts
├── 04-quality/                 # Quality guidelines
├── 05-implementation/          # Implementation notes
├── .mcp.json.example           # MCP client config template
├── Dockerfile                  # GPU-optimized container
├── docker-entrypoint.sh        # Container startup script
├── docker-compose.yml          # Default GPU config
├── docker-compose.gpu.yml      # Advanced GPU config
├── docker-compose.cpu.yml      # CPU-only fallback
├── repl.py                     # Interactive REPL (run directly)
├── pyproject.toml              # Project metadata
└── README.md                   # This file

Contributors Guide

We welcome contributions! Here's how to get started.

Development Setup

Step 1: Fork and clone

git clone https://github.com/YOUR_USERNAME/mcp-animaginexl.git
cd mcp-animaginexl

Step 2: Create development environment

python -m venv .venv
source .venv/bin/activate  # or .venv\Scripts\activate on Windows

Step 3: Install with development dependencies

pip install -e ".[dev]"

Step 4: Create a feature branch

git checkout -b feature/your-feature-name

Code Style

We follow these conventions:

Python Style

  • Formatter: black with default settings

  • Linter: ruff for fast linting

  • Type hints: Required for all public functions

  • Docstrings: Google style for all public APIs

Run Formatting

# Format code
black src/

# Lint code
ruff check src/

# Fix auto-fixable issues
ruff check --fix src/
# Install pre-commit hooks
pip install pre-commit
pre-commit install

# Run on all files
pre-commit run --all-files

Pull Request Process

1. Before Submitting

  • Code follows the style guide

  • Tests pass locally

  • Documentation updated (if applicable)

  • Commit messages are clear and descriptive

2. PR Template

Use this template for your PR description:

## Summary
Brief description of changes.

## Changes
- Change 1
- Change 2

## Testing
How was this tested?

## Related Issues
Fixes #123

3. Review Process

  1. Submit PR to main branch

  2. Automated checks run (linting, tests)

  3. Maintainer reviews code

  4. Address feedback if any

  5. PR merged after approval

4. Commit Message Format

type: short description

Longer description if needed.

Fixes #123

Types: feat, fix, docs, style, refactor, test, chore

Examples:

feat: add batch generation support
fix: resolve CUDA OOM error with large images
docs: update GPU setup instructions

Testing Guidelines

Running Tests

# Run all tests
pytest tests/

# Run with coverage
pytest tests/ --cov=src/animagine_mcp

# Run specific test file
pytest tests/test_prompt.py

Writing Tests

# tests/test_prompt.py
import pytest
from animagine_mcp.prompt import validate_prompt

def test_validate_prompt_basic():
    """Test basic prompt validation."""
    result = validate_prompt("1girl, blue hair, masterpiece")
    assert result.is_valid
    assert len(result.issues) == 0

def test_validate_prompt_missing_quality():
    """Test validation catches missing quality tags."""
    result = validate_prompt("1girl, blue hair")
    assert not result.is_valid
    assert any("quality" in issue.lower() for issue in result.issues)

Test Categories

Category

Description

Location

Unit

Individual functions

tests/unit/

Integration

Component interaction

tests/integration/

E2E

Full workflow

tests/e2e/


Areas for Contribution

Looking for something to work on? Here are some areas:

Good First Issues

  • Documentation improvements

  • Adding test coverage

  • Fixing typos or clarifying comments

Feature Ideas

  • Additional prompt optimization strategies

  • New LoRA management features

  • Performance benchmarking tools

  • Web UI frontend

Documentation

  • Tutorials for specific use cases

  • Video walkthroughs

  • Translated documentation


Support

Getting Help

  1. Check existing issues: Search GitHub Issues

  2. Read documentation: Check DOCKER.md, GPU_SETUP.md, and this README

  3. Open new issue: Include:

    • Description of the problem

    • Steps to reproduce

    • Expected vs actual behavior

    • System info (OS, GPU, Python version)

    • Relevant logs (omit sensitive content)

Community

  • GitHub Discussions for questions

  • Issues for bugs and feature requests


License

This project is licensed under the terms specified in LICENSE.


Acknowledgments

Available Tools

8 tools
explain_promptA

Explain what each tag in a prompt does.

Breaks down the prompt into individual tags with:

  • Category classification (quality, composition, character, etc.)

  • Explanation of what each tag affects

  • Canonically ordered version of the prompt

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYesThe prompt to explain

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It transparently discloses the tool's behavior: breaking the prompt into tags, classifying them, explaining their effects, and producing a canonical ordering. This gives the agent a clear picture of what happens, though it doesn't explicitly state that it's a safe, read-only operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and well-structured: a one-sentence purpose statement followed by a tight bullet list of output components. Every line adds value without redundancy or excess length.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (one parameter, no annotations, output schema exists), the description covers all necessary aspects: the input prompt, the breakdown process, and the key output elements (classification, explanation, canonical order). The presence of an output schema relieves the description from specifying return format, so this is complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The single parameter 'prompt' is fully described in the schema with 'The prompt to explain' (100% coverage). The description adds context about how the prompt is processed (broken into tags) but does not add new format or constraint details beyond the schema, so baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Explain') and identifies the resource ('each tag in a prompt'), then elaborates with concrete deliverables (category classification, explanation, canonical ordering). This clearly distinguishes it from siblings like validate_prompt and optimize_prompt.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for understanding prompt tags but does not explicitly state when to use this tool versus alternatives like validate_prompt or optimize_prompt. No exclusions or alternative recommendations are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

generate_imageA

Generate an image with Animagine XL 4.0.

Uses the Diffusers pipeline with the lpw_stable_diffusion_xl custom pipeline. Images are saved to outputs/YYYY-MM-DD/ with accompanying metadata JSON.

Supports custom checkpoints and LoRA mixing for style control.

Recommended workflow:

  1. list_models → see available checkpoints and LoRAs

  2. validate_prompt → check for issues

  3. optimize_prompt → improve structure

  4. generate_image → create the image

ParametersJSON Schema
NameRequiredDescriptionDefault
seedNoRandom seed for reproducibility (random if not set)
lorasNoList of LoRA filenames to apply (in order). Examples: ["custom_lora.safetensors"] (user's local LoRAs)
stepsNoInference steps (default 28, use 4-8 with LCM LoRA)
widthNoImage width (default 832, portrait)
heightNoImage height (default 1216, portrait)
promptYesThe positive prompt (pre-validated recommended)
checkpointNoCheckpoint filename or 'default' for HuggingFace model. Examples: "custom_checkpoint.safetensors" (user's local checkpoint)
lora_scalesNoScale/strength per LoRA (0.0-2.0, defaults to 1.0 for each). Example: [0.8, 0.5] for two LoRAs
render_typeNoOptional render type specification ('gpu' or 'cpu'). If specified and doesn't match detected device, renders are aborted to prevent slow processing.
guidance_scaleNoCFG scale (default 5.0, use 1.5 with LCM LoRA)
negative_promptNoOptional; defaults to standard negative prompt

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of behavioral disclosure. It reveals that images are saved to outputs/YYYY-MM-DD/ with metadata JSON and that it uses a custom Diffusers pipeline, which are useful side effects. It does not describe failure modes or rate limits, but these are partially addressed by the schema (e.g., render_type).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with a clear purpose, followed by relevant technical details and a valuable workflow. Each sentence contributes meaning, though the middle section about the pipeline and file output could be slightly tighter without losing key information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of an 11-parameter image generation tool, the description covers the model, pipeline, file output, and recommended workflow, making it quite thorough. The presence of an output schema handles return values. Minor gaps remain around explicit error handling and resource costs, but overall it is complete enough for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline 3 is appropriate. The description adds context about custom checkpoints and LoRA mixing, but these already map directly to schema parameters. It does not enrich parameter meaning beyond what the schema already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with 'Generate an image with Animagine XL 4.0', which is a specific verb and resource, clearly distinguishing this tool from siblings like generate_image_from_image. It also states the model and pipeline used, making the tool's main function unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides a recommended workflow with explicit steps (list_models → validate_prompt → optimize_prompt → generate_image), giving clear guidance on when to invoke this tool. However, it does not explicitly state when not to use it or mention alternative tools for similar tasks.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

generate_image_from_imageA

Generate an image using img2img (image-to-image) transformation.

Takes an existing image and transforms it based on the prompt while preserving structure according to the strength parameter.

Use cases:

  • Style transfer (apply anime/comic/realistic style to photo)

  • Image refinement (improve details, fix artifacts)

  • Pose/composition preservation (keep layout, change style)

  • Character consistency (transform existing character art)

ParametersJSON Schema
NameRequiredDescriptionDefault
seedNoRandom seed for reproducibility (random if not set)
lorasNoList of LoRA filenames to apply (in order)
stepsNoInference steps (default 28, use 4-8 with LCM LoRA)
promptYesThe positive prompt describing desired output
strengthNoDenoising strength (0.0-1.0). Controls how much to change. - 0.0-0.3: Minor refinements, preserve most details - 0.3-0.5: Moderate changes, good for style transfer - 0.5-0.7: Significant changes, keeps composition - 0.7-1.0: Major transformation, only basic structure preserved
checkpointNoCheckpoint filename or 'default' for HuggingFace model
image_pathYesAbsolute path to source image to transform
lora_scalesNoScale/strength per LoRA (0.0-2.0, defaults to 1.0)
render_typeNoOptional render type specification ('gpu' or 'cpu'). If specified and doesn't match detected device, renders are aborted to prevent slow processing.
guidance_scaleNoCFG scale (default 5.0)
negative_promptNoOptional; defaults to standard negative prompt

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden of behavioral disclosure. It explains the core transformation behavior and the role of the strength parameter in preserving structure. However, it does not mention side effects, resource requirements, or how the original image is handled. It provides moderate transparency without contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and well-structured. It opens with a clear definition, follows with a mechanistic explanation, and then lists use cases in bullet form. Every sentence adds value, and the key purpose is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is complete enough for a complex tool with an output schema (return values not needed). It covers purpose, transformation behavior, and use cases. Missing details like explicit alternative guidance or prerequisites are minor gaps, but the provided context is substantial.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all parameters have descriptions. The tool description adds some context about strength preserving structure, but it does not add meaningful semantics beyond the schema. It does not explain the interplay of parameters like loras with strength or steps, so it stays at the baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: 'Generate an image using img2img (image-to-image) transformation.' It specifies the resource (an existing image) and the transformation based on prompt and strength. This distinguishes it from the sibling tool generate_image (which is presumably text-to-image).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides a clear context for use with four explicit use cases (style transfer, image refinement, pose/composition preservation, character consistency). However, it does not explicitly state when not to use this tool or name alternatives, though the distinction from generate_image is implied by 'takes an existing image.'

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_modelsA

List available checkpoints and LoRAs for image generation.

Returns all available models with metadata:

  • checkpoints: Base models (Animagine XL)

  • loras: Style modifiers and speed optimizations

Use this to discover what models are available before generation.

Returns: Dictionary with checkpoints, loras, default_checkpoint, and currently_loaded

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the burden of disclosing behavior. It explains the return format: 'Dictionary with checkpoints, loras, default_checkpoint, and currently_loaded' and provides examples of content types. It also implies a read-only operation, though it does not explicitly state side-effect-free behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a clear opening, bullet list, usage tip, and return summary. It is slightly redundant between the first sentence and the 'Use this to discover' line, but overall it is efficiently composed.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple no-parameter listing tool, the description covers the purpose, usage context, and output shape. An output schema exists, so the description does not need to detail return values further; it is complete within the scope of the tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters and the schema is fully covered (100%), so the description has no parameters to explain. The baseline for 0 params is 4, and the description adds no unnecessary parameter info.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'List available checkpoints and LoRAs for image generation', which is a specific verb+resource. It distinguishes the tool from siblings like load_checkpoint or generate_image by focusing on discovery rather than loading or generating.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives explicit usage context: 'Use this to discover what models are available before generation.' This tells the agent when to invoke this tool (prior to generation) and implies it is complementary to loading/generating siblings, though it does not explicitly exclude alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

load_checkpointA

Pre-load a checkpoint into GPU memory.

Loading a checkpoint in advance speeds up subsequent generation calls. Use list_models() to see available checkpoints.

ParametersJSON Schema
NameRequiredDescriptionDefault
checkpointNoFilename from checkpoints/ folder (e.g., "custom_checkpoint.safetensors"). Use 'default' or None for Animagine XL 4.0 from HuggingFace.

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description must disclose behavioral traits itself. It mentions the side effect of loading into GPU memory and the benefit of speed, but doesn't cover failure modes, memory implications, or whether it replaces an existing checkpoint. This is acceptable but not comprehensive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences with the action stated up front. No filler or redundant information. Every sentence contributes value: the first states the purpose, the second explains the benefit and gives a practical hint.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with a single optional parameter and an output schema present, the description is nearly complete. It covers what the tool does, why to use it, and how to find valid inputs. It doesn't mention that pre-loading might be optional or that generation may auto-load, but this is a minor gap given the tool's simplicity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema provides 100% coverage of the parameter, including default value and examples. The description adds no additional parameter semantics beyond what the schema already documents. The pointer to list_models() is helpful but not required.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's action: 'Pre-load a checkpoint into GPU memory.' This is a specific verb+resource combination that distinguishes it from siblings like list_models or generate_image. No other sibling tool performs checkpoint loading, so there is no ambiguity about its purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly says loading in advance speeds up generation calls, which implies it should be used before generate_image. It also directs users to list_models() to discover valid checkpoints, providing practical usage guidance. It doesn't mention when not to use it, but for a simple pre-loading tool, this context is sufficient.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

optimize_promptA

Optimize a prompt for Animagine XL.

Provide either a natural language description or an existing prompt. The optimizer will:

  • Reorder tags by canonical category order

  • Move quality tags to the end

  • Add missing essential categories (composition, environment, quality)

ParametersJSON Schema
NameRequiredDescriptionDefault
promptNoExisting tag-based prompt to optimize
descriptionNoNatural language description to convert to tags

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden and explicitly discloses the optimizer's behavior (reordering tags, moving quality tags, adding missing categories). It doesn't cover edge cases like both inputs being provided, but the primary transformations are transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured: a one-line purpose, a one-line input instruction, and a concise bullet list of actions. Every element earns its place, and the purpose is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present and only two optional parameters, the description covers the essential context: input modes and processing steps. It omits potential conflict behavior (e.g., if both inputs are provided), but this is a minor gap given the tool's simplicity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description adds value by clarifying that 'prompt' and 'description' are alternative inputs ('Provide either...') and by explaining how each feeds into the optimization process. This goes beyond the schema's simple field descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific action ('Optimize a prompt') and the target model ('Animagine XL'), then lists concrete transformation steps. This differentiates it from siblings like validate_prompt and explain_prompt by specifying exactly what optimization entails.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear input options ('Provide either a natural language description or an existing prompt') and implies the use case of improving prompt structure. It doesn't explicitly mention when not to use it or alternatives, but the context is clear enough.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

unload_lorasA

Unload all LoRA weights from the current pipeline.

Useful to reset to base checkpoint style without reloading the full model. This is faster than reloading the checkpoint.

Returns: Status with success, unloaded_count, and message

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses the scope ('all LoRA weights'), the purpose (reset to base style), a performance characteristic (faster than reload), and the return payload (success, unloaded_count, message). It could further elaborate on edge cases (e.g., behavior when no LoRA is loaded), but otherwise provides solid behavioral disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise, using only three short paragraphs. The primary action is front-loaded in the first sentence, followed by use-case justification and a brief return specification. Every sentence earns its place, with no fluff or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

This is a simple, zero-parameter tool, and the description covers all essential aspects: purpose, when to use, performance advantage, and return values. The presence of an output schema handles the return structure, so the description's summary is sufficient for an agent to select and invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are zero parameters, so the description need not explain any. Per the rubric, 0 params yields a baseline of 4, and the description adds no conflicting info. The schema coverage is 100% vacuously, so no additional parameter clarification is needed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool action with a specific verb ('Unload') and resource ('all LoRA weights from the current pipeline'). It unambiguously distinguishes itself from siblings like load_checkpoint and generate_image by focusing on removing LoRA weights.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly explains when to use it ('reset to base checkpoint style') and why it's preferable to an alternative ('faster than reloading the checkpoint'). Though it doesn't name the specific sibling tool, the comparison to reloading is concrete and actionable, giving strong contextual guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

validate_promptA

Validate a prompt against Animagine XL rules.

Checks for:

  • Required quality tags (masterpiece, best quality, etc.)

  • Proper tag ordering (quality tags at end)

  • Minimum tag count (8+ recommended)

  • Character/series consistency

  • Resolution compatibility

ParametersJSON Schema
NameRequiredDescriptionDefault
widthNoTarget image width (default 832)
heightNoTarget image height (default 1216)
promptYesThe prompt to validate
negative_promptNoOptional negative prompt to check

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must carry the full burden. It lists the checks performed, which gives some behavioral insight, but does not disclose whether the tool is read-only, what it returns (e.g., pass/fail, issues list), or any side effects. The presence of an output schema is noted but its content is not described. More detail on output behavior would improve transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and well-structured: a single opening sentence with the verb and resource, followed by a bulleted list of checks. Every line adds value, and the content is front-loaded with the core purpose immediately.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 4 parameters and an output schema, the description covers the main validation checks but lacks guidance on when to use it relative to siblings and does not describe expected output behavior (though output schema exists). No annotations add further gaps. It is adequate but not rich enough for complete agent decision-making.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description adds context about prompt validation rules, which complements the prompt parameter, and mentions resolution compatibility, which relates to width/height. However, it does not add detailed semantics beyond the schema for negative_prompt or width/height.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Validate a prompt against Animagine XL rules.' It lists specific checks (quality tags, ordering, tag count, consistency, resolution), making the scope precise. This distinguishes it from sibling tools like optimize_prompt (which improves) and explain_prompt (which explains).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by listing validation checks, but it does not explicitly say when to use this tool versus alternatives. For instance, it does not mention using this before generation or that optimize_prompt is for adjustments. No explicit when/when-not guidance is provided, only implied context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 8 tool updatesv0.1.0
    • First observedexplain_prompt
    • First observedgenerate_image
    • First observedgenerate_image_from_image
    • First observedlist_models
    • First observedload_checkpoint
    • First observedoptimize_prompt
    • First observedunload_loras
    • First observedvalidate_prompt

TDQS

A4.2/5.0

Scored across 8 tools

Disambiguation5/5

Each tool targets a distinct operation: prompt validation, optimization, explanation, model listing, checkpoint loading, LoRA unloading, text-to-image, and image-to-image. No two tools overlap in purpose, and the descriptions make the boundaries clear.

Naming Consistency5/5

All tools use a consistent verb_noun pattern in snake_case (validate_prompt, list_models, generate_image). The only slightly longer name is generate_image_from_image, but it follows the same convention clearly.

Tool Count5/5

Eight tools cover the core workflow of prompt preparation, model management, and generation. This is a well-scoped number that avoids unnecessary redundancy.

Completeness4/5

The server covers the main image generation workflow, including prompt handling and model configuration. Minor gaps exist, such as no explicit checkpoint unload tool, but list_models includes currently loaded state and unload_loras provides a reset path.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    C
    quality
    D
    maintenance
    A FastMCP server implementation that facilitates resource-based access to AI model inference, focusing on image generation through the Replicate API, with features like real-time updates, webhook integration, and secure API key management.
    18
    16
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    FastMCP is a comprehensive MCP server allowing secure and standardized data and functionality exposure to LLM applications, offering resources, tools, and prompt management for efficient LLM interactions.
    3
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    This MCP server provides research-backed prompt optimization tools and professional domain templates designed to improve AI performance through strategies like Tree of Thoughts and Medprompt. It enables users to analyze, auto-optimize, and refine prompts using advanced reasoning patterns and safety-critical alignment techniques.
    25
    MIT