Skip to content
Conduit

mcp server

mcp-server-bedrock-image

MCP server for AI image generation and manipulation using Stability AI models on AWS Bedrock. 10 tools: generate, edit, upscale, brand.

Yaksh36/mcp-server-bedrock-imagecommunitylistedunreviewed

Set up

Runs on your computer. Pick your agent and operating system.

Before you start

  • uv (`curl -LsSf https://astral.sh/uv/install.sh | sh`)
~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "mcp-server-bedrock-image": {
      "command": "uvx",
      "args": [
        "mcp-server-bedrock-image"
      ]
    }
  }
}

same format Cursor, GitHub Copilot CLI, Junie, JetBrains AI Assistant, Augment (Auggie CLI), Factory Droid, Kiro, Devin CLI +12

Values in angle brackets are placeholders. Restart Claude Desktop after editing its config.Claude Desktop docs

README

synced Oct 23, 2026

mcp-server-bedrock-image

CI PyPI Python 3.12+ License: MIT MCP

An MCP (Model Context Protocol) server that gives AI agents the ability to generate, edit, and manipulate images using Stability AI models on AWS Bedrock.

Connect it to Claude Code, Cursor, Windsurf, VS Code, or any MCP-compatible client — then ask your AI to generate images, remove backgrounds, transfer styles, upscale, and more.

Tools

ToolWhat it doesModel
generate_imageHigh-quality text-to-image generationStable Image Ultra
generate_image_coreFaster, lower-cost generationStable Image Core
remove_backgroundRemove image backgroundStability Remove Background v1
style_transferApply style from a reference imageStability Style Transfer v1
search_and_recolorRecolor specific elements by descriptionStability Search & Recolor v1
outpaintExtend image in any directionStability Outpaint v1
search_and_replaceFind and replace objects in an imageStability Search & Replace v1
upscale_fast4x resolution upscaleStability Fast Upscale v1
upscale_creativeCreative upscale up to 4KStability Creative Upscale v1
compose_brandedComposition-aware logo overlayLocal (Pillow — no Bedrock call)

Quickstart

Prerequisites

Install & run

# Run directly (no install needed)
uvx mcp-server-bedrock-image

# Or install globally
uv tool install mcp-server-bedrock-image

Authentication

Two auth modes are supported:

boto3 mode (default) — Uses standard AWS credential chain (env vars, ~/.aws/credentials, IAM roles, STS):

export AWS_REGION=us-west-2

Bearer token mode — Uses Bedrock API keys (no AWS CLI setup needed):

export BEDROCK_AUTH_MODE=bearer
export AWS_BEARER_TOKEN_BEDROCK=your-api-key-here
export AWS_REGION=us-west-2

Client Configuration

Add to .claude/settings.json:

{
  "mcpServers": {
    "bedrock-image": {
      "command": "uvx",
      "args": ["mcp-server-bedrock-image"],
      "env": {
        "AWS_REGION": "us-west-2",
        "IMAGE_STORAGE_DIRECTORY": ".content-workspace/images"
      }
    }
  }
}

For bearer token auth, add "BEDROCK_AUTH_MODE": "bearer" and "AWS_BEARER_TOKEN_BEDROCK": "your-api-key" to the env block.

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "bedrock-image": {
      "command": "uvx",
      "args": ["mcp-server-bedrock-image"],
      "env": {
        "AWS_REGION": "us-west-2"
      }
    }
  }
}

Add to .vscode/mcp.json:

{
  "servers": {
    "bedrock-image": {
      "command": "uvx",
      "args": ["mcp-server-bedrock-image"],
      "env": {
        "AWS_REGION": "us-west-2"
      }
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "bedrock-image": {
      "command": "uvx",
      "args": ["mcp-server-bedrock-image"],
      "env": {
        "AWS_REGION": "us-west-2"
      }
    }
  }
}

Environment Variables

VariableDefaultDescription
AWS_REGIONus-west-2AWS region for Bedrock
BEDROCK_AUTH_MODEboto3Auth mode: boto3 or bearer
AWS_BEARER_TOKEN_BEDROCK—Bedrock API key (bearer mode only)
BEDROCK_ENDPOINTAuto from regionOverride Bedrock runtime endpoint
IMAGE_STORAGE_DIRECTORY/tmp/mcp-server-bedrock-imageWhere to save generated images
SAVE_METADATAtrueSave JSON metadata alongside images

See .env.example for a template.

Usage Examples

Once connected, ask your AI agent naturally:

"Generate a hero image of a modern hotel lobby with warm lighting in 16:9"

"Remove the background from this product photo"

"Apply the style of this watercolor painting to the room photo"

"Add our logo to the generated image in the least busy corner"

Or call tools directly:

# Generate
generate_image(prompt="Modern hotel lobby with warm lighting", aspect_ratio="16:9")

# Edit
remove_background(image_path="/path/to/photo.png")
style_transfer(prompt="Watercolor style", image_path="room.png", style_image_path="ref.png")
search_and_replace(image_path="scene.png", prompt="red chair", search_prompt="blue chair")
outpaint(image_path="photo.png", prompt="extend the garden", right=200, bottom=100)

# Upscale
upscale_fast(image_path="/path/to/small.png")
upscale_creative(image_path="photo.png", prompt="enhance details, sharp textures")

# Brand
compose_branded(image_path="hero.png", logo_path="logo.png", output_path="branded.png")

How compose_branded works

The composition-aware branding tool doesn't use Bedrock — it runs locally with Pillow. It divides the image into a 3x3 grid, scores each quadrant by visual complexity (standard deviation of grayscale values), and places the logo in the least complex region. It also auto-selects between light and dark logo variants based on the background brightness.

Architecture

src/mcp_server_bedrock_image/
├── server.py          # FastMCP server — registers all 10 tools
├── config.py          # Environment variables and model IDs
├── bedrock_client.py  # Dual-auth Bedrock client (boto3 + bearer)
├── image_utils.py     # Image save and metadata utilities
└── tools/
    ├── generate.py    # Text-to-image generation
    ├── edit.py        # Background removal, style transfer, recolor, outpaint, search-replace
    ├── upscale.py     # Fast and creative upscaling
    └── compose.py     # Composition-aware logo placement

Development

# Clone and install
git clone https://github.com/Yaksh36/mcp-server-bedrock-image.git
cd mcp-server-bedrock-image
uv sync --all-extras --dev

# Run tests
uv run pytest -v

# Lint and format
uv run ruff check src/ tests/
uv run ruff format src/ tests/

Contributing

Contributions are welcome. Please:

  1. Fork the repo and create a feature branch
  2. Add tests for new functionality
  3. Ensure uv run pytest -v and uv run ruff check src/ tests/ pass
  4. Open a pull request

License

MIT

↑↓ navigate openesc close