{"id":"cf962573-8d2b-41ca-a27b-42643dbd9190","slug":"mcp-server-bedrock-image","kind":"mcp","name":"mcp-server-bedrock-image","summary":"MCP server for AI image generation and manipulation using Stability AI models on AWS Bedrock. 10 tools: generate, edit, upscale, brand.","owner":"Yaksh36","repoUrl":"https://github.com/Yaksh36/mcp-server-bedrock-image","license":"MIT","licenseTier":"permissive","trust":"community","stars":0,"match":null,"fewStars":true,"format":"mcp","createdAt":"2026-02-14T19:47:46.000Z","addedAt":"2026-10-21T04:15:53.704Z","logoUrl":"https://avatars.githubusercontent.com/u/58009962?u=d540a54248ea847732737dc91f5848017ee8a664&v=4","linkOnly":false,"collection":null,"skillPath":null,"categories":["cloud-infra","design-media","memory-knowledge"],"tags":["ai","aws-bedrock","image-generation","python","stability-ai"],"runtime":"python","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-10-23T18:13:05.244Z","sample":false,"url":"https://conduits.dev/tools/mcp-server-bedrock-image","language":"Python","transports":["stdio"],"install":{"pypi":"mcp-server-bedrock-image"},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"# mcp-server-bedrock-image\n\n[![CI](https://github.com/Yaksh36/mcp-server-bedrock-image/actions/workflows/ci.yml/badge.svg)](https://github.com/Yaksh36/mcp-server-bedrock-image/actions/workflows/ci.yml)\n[![PyPI](https://img.shields.io/pypi/v/mcp-server-bedrock-image.svg)](https://pypi.org/project/mcp-server-bedrock-image/)\n[![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)\n[![License: MIT](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE)\n[![MCP](https://img.shields.io/badge/MCP-compatible-purple.svg)](https://modelcontextprotocol.io/)\n\nAn [MCP (Model Context Protocol)](https://modelcontextprotocol.io/) server that gives AI agents the ability to generate, edit, and manipulate images using [Stability AI models on AWS Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-stability-diffusion.html).\n\nConnect 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.\n\n## Tools\n\n| Tool | What it does | Model |\n|------|-------------|-------|\n| `generate_image` | High-quality text-to-image generation | Stable Image Ultra |\n| `generate_image_core` | Faster, lower-cost generation | Stable Image Core |\n| `remove_background` | Remove image background | Stability Remove Background v1 |\n| `style_transfer` | Apply style from a reference image | Stability Style Transfer v1 |\n| `search_and_recolor` | Recolor specific elements by description | Stability Search & Recolor v1 |\n| `outpaint` | Extend image in any direction | Stability Outpaint v1 |\n| `search_and_replace` | Find and replace objects in an image | Stability Search & Replace v1 |\n| `upscale_fast` | 4x resolution upscale | Stability Fast Upscale v1 |\n| `upscale_creative` | Creative upscale up to 4K | Stability Creative Upscale v1 |\n| `compose_branded` | Composition-aware logo overlay | Local (Pillow — no Bedrock call) |\n\n## Quickstart\n\n### Prerequisites\n\n- Python 3.12+\n- AWS account with [Bedrock access to Stability AI models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access.html)\n- [uv](https://docs.astral.sh/uv/) package manager\n\n### Install & run\n\n```bash\n# Run directly (no install needed)\nuvx mcp-server-bedrock-image\n\n# Or install globally\nuv tool install mcp-server-bedrock-image\n```\n\n### Authentication\n\nTwo auth modes are supported:\n\n**boto3 mode** (default) — Uses standard [AWS credential chain](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (env vars, `~/.aws/credentials`, IAM roles, STS):\n\n```bash\nexport AWS_REGION=us-west-2\n```\n\n**Bearer token mode** — Uses [Bedrock API keys](https://docs.aws.amazon.com/bedrock/latest/userguide/api-keys.html) (no AWS CLI setup needed):\n\n```bash\nexport BEDROCK_AUTH_MODE=bearer\nexport AWS_BEARER_TOKEN_BEDROCK=your-api-key-here\nexport AWS_REGION=us-west-2\n```\n\n## Client Configuration\n\n<details>\n<summary><strong>Claude Code</strong></summary>\n\nAdd to `.claude/settings.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"bedrock-image\": {\n      \"command\": \"uvx\",\n      \"args\": [\"mcp-server-bedrock-image\"],\n      \"env\": {\n        \"AWS_REGION\": \"us-west-2\",\n        \"IMAGE_STORAGE_DIRECTORY\": \".content-workspace/images\"\n      }\n    }\n  }\n}\n```\n\nFor bearer token auth, add `\"BEDROCK_AUTH_MODE\": \"bearer\"` and `\"AWS_BEARER_TOKEN_BEDROCK\": \"your-api-key\"` to the `env` block.\n\n</details>\n\n<details>\n<summary><strong>Cursor</strong></summary>\n\nAdd to `.cursor/mcp.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"bedrock-image\": {\n      \"command\": \"uvx\",\n      \"args\": [\"mcp-server-bedrock-image\"],\n      \"env\": {\n        \"AWS_REGION\": \"us-west-2\"\n      }\n    }\n  }\n}\n```\n\n</details>\n\n<details>\n<summary><strong>VS Code</strong></summary>\n\nAdd to `.vscode/mcp.json`:\n\n```json\n{\n  \"servers\": {\n    \"bedrock-image\": {\n      \"command\": \"uvx\",\n      \"args\": [\"mcp-server-bedrock-image\"],\n      \"env\": {\n        \"AWS_REGION\": \"us-west-2\"\n      }\n    }\n  }\n}\n```\n\n</details>\n\n<details>\n<summary><strong>Windsurf</strong></summary>\n\nAdd to `~/.codeium/windsurf/mcp_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"bedrock-image\": {\n      \"command\": \"uvx\",\n      \"args\": [\"mcp-server-bedrock-image\"],\n      \"env\": {\n        \"AWS_REGION\": \"us-west-2\"\n      }\n    }\n  }\n}\n```\n\n</details>\n\n## Environment Variables\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `AWS_REGION` | `us-west-2` | AWS region for Bedrock |\n| `BEDROCK_AUTH_MODE` | `boto3` | Auth mode: `boto3` or `bearer` |\n| `AWS_BEARER_TOKEN_BEDROCK` | — | Bedrock API key (bearer mode only) |\n| `BEDROCK_ENDPOINT` | Auto from region | Override Bedrock runtime endpoint |\n| `IMAGE_STORAGE_DIRECTORY` | `/tmp/mcp-server-bedrock-image` | Where to save generated images |\n| `SAVE_METADATA` | `true` | Save JSON metadata alongside images |\n\nSee [`.env.example`](.env.example) for a template.\n\n## Usage Examples\n\nOnce connected, ask your AI agent naturally:\n\n> \"Generate a hero image of a modern hotel lobby with warm lighting in 16:9\"\n\n> \"Remove the background from this product photo\"\n\n> \"Apply the style of this watercolor painting to the room photo\"\n\n> \"Add our logo to the generated image in the least busy corner\"\n\nOr call tools directly:\n\n```python\n# Generate\ngenerate_image(prompt=\"Modern hotel lobby with warm lighting\", aspect_ratio=\"16:9\")\n\n# Edit\nremove_background(image_path=\"/path/to/photo.png\")\nstyle_transfer(prompt=\"Watercolor style\", image_path=\"room.png\", style_image_path=\"ref.png\")\nsearch_and_replace(image_path=\"scene.png\", prompt=\"red chair\", search_prompt=\"blue chair\")\noutpaint(image_path=\"photo.png\", prompt=\"extend the garden\", right=200, bottom=100)\n\n# Upscale\nupscale_fast(image_path=\"/path/to/small.png\")\nupscale_creative(image_path=\"photo.png\", prompt=\"enhance details, sharp textures\")\n\n# Brand\ncompose_branded(image_path=\"hero.png\", logo_path=\"logo.png\", output_path=\"branded.png\")\n```\n\n### How `compose_branded` works\n\nThe 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.\n\n## Architecture\n\n```\nsrc/mcp_server_bedrock_image/\n├── server.py          # FastMCP server — registers all 10 tools\n├── config.py          # Environment variables and model IDs\n├── bedrock_client.py  # Dual-auth Bedrock client (boto3 + bearer)\n├── image_utils.py     # Image save and metadata utilities\n└── tools/\n    ├── generate.py    # Text-to-image generation\n    ├── edit.py        # Background removal, style transfer, recolor, outpaint, search-replace\n    ├── upscale.py     # Fast and creative upscaling\n    └── compose.py     # Composition-aware logo placement\n```\n\n## Development\n\n```bash\n# Clone and install\ngit clone https://github.com/Yaksh36/mcp-server-bedrock-image.git\ncd mcp-server-bedrock-image\nuv sync --all-extras --dev\n\n# Run tests\nuv run pytest -v\n\n# Lint and format\nuv run ruff check src/ tests/\nuv run ruff format src/ tests/\n```\n\n## Contributing\n\nContributions are welcome. Please:\n\n1. Fork the repo and create a feature branch\n2. Add tests for new functionality\n3. Ensure `uv run pytest -v` and `uv run ruff check src/ tests/` pass\n4. Open a pull request\n\n## License\n\n[MIT](LICENSE)\n"}