AWS Bedrock Nova Canvas MCP server

Integrates with Amazon Bedrock's Nova Canvas model to generate images from text descriptions with customizable parameters like dimensions and seed control.
Back to servers
Setup instructions
Provider
Kane
Release date
Dec 25, 2024
Language
TypeScript
Stats
21 stars

The Amazon Bedrock MCP Server integrates with Amazon Bedrock's Nova Canvas model to provide AI image generation capabilities. This server implements the Model Control Protocol (MCP) standard, allowing applications like Claude Desktop to generate high-quality images directly from text descriptions.

Prerequisites

Before installing the server, ensure you have:

  1. An active AWS account with Amazon Bedrock and Nova Canvas model access
  2. Properly configured AWS credentials with required permissions
  3. Node.js version 18 or later

Installation and Configuration

Setting Up AWS Credentials

The server requires AWS credentials with appropriate Amazon Bedrock permissions. Configure these using one of these methods:

  1. Using environment variables:

    export AWS_ACCESS_KEY_ID=your_access_key
    export AWS_SECRET_ACCESS_KEY=your_secret_key
    export AWS_REGION=us-east-1  # or your preferred region
    
  2. Using an AWS credentials file (~/.aws/credentials):

    [the_profile_name]
    aws_access_key_id = your_access_key
    aws_secret_access_key = your_secret_key
    

    Then set your active profile:

    export AWS_PROFILE=the_profile_name
    
  3. Using an IAM role (when deployed on AWS infrastructure)

Installing the MCP Server

You can install and run the server using npx:

npx -y @zxkane/mcp-server-amazon-bedrock

Claude Desktop Integration

To integrate with Claude Desktop, add the MCP server configuration to your Claude settings file:

MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "amazon-bedrock": {
      "command": "npx",
      "args": [
        "-y",
        "@zxkane/mcp-server-amazon-bedrock"
      ],
      "env": {
        "AWS_PROFILE": "your_profile_name",         // Optional, only if using a specific profile
        "AWS_ACCESS_KEY_ID": "your_access_key",     // Optional if using AWS credentials file or IAM role
        "AWS_SECRET_ACCESS_KEY": "your_secret_key", // Optional if using AWS credentials file or IAM role
        "AWS_REGION": "us-east-1"                   // Optional, defaults to 'us-east-1'
      }
    }
  }
}

Using the Image Generation Tool

Generate Image Tool Parameters

The server provides a generate_image tool with the following parameters:

  • prompt (required): Descriptive text for the desired image (1-1024 characters)
  • negativePrompt (optional): Elements to exclude from the image (1-1024 characters)
  • width (optional): Image width in pixels (default: 1024)
  • height (optional): Image height in pixels (default: 1024)
  • quality (optional): Image quality level - "standard" or "premium" (default: "standard")
  • cfg_scale (optional): Prompt adherence strength (1.1-10, default: 6.5)
  • seed (optional): Generation seed for reproducibility (0-858993459, default: 12)
  • numberOfImages (optional): Batch size for generation (1-5, default: 1)

Example Usage

When using the MCP server programmatically:

const result = await callTool('generate_image', {
  prompt: "A serene mountain landscape at sunset",
  negativePrompt: "people, buildings, vehicles",
  quality: "premium",
  cfg_scale: 8,
  numberOfImages: 2
});

Prompt Guidelines

For best results:

  • Avoid negative phrasing ("no", "not", "without") in the main prompt
  • Instead, place unwanted elements in the negativePrompt parameter
  • For example, use "a mountain landscape" as the prompt and "buildings" as the negativePrompt rather than "a mountain landscape without buildings"

Performance Considerations

Generation time varies based on:

  • Image resolution (width and height)
  • Number of images requested (numberOfImages)
  • Quality setting (premium requires more processing time)

Be mindful of these settings to avoid timeouts, especially when generating multiple high-resolution images with premium quality.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "amazon-bedrock" '{"command":"npx","args":["-y","@zxkane/mcp-server-amazon-bedrock"],"env":{"AWS_PROFILE":"your_profile_name","AWS_ACCESS_KEY_ID":"your_access_key","AWS_SECRET_ACCESS_KEY":"your_secret_key","AWS_REGION":"us-east-1"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "amazon-bedrock": {
            "command": "npx",
            "args": [
                "-y",
                "@zxkane/mcp-server-amazon-bedrock"
            ],
            "env": {
                "AWS_PROFILE": "your_profile_name",
                "AWS_ACCESS_KEY_ID": "your_access_key",
                "AWS_SECRET_ACCESS_KEY": "your_secret_key",
                "AWS_REGION": "us-east-1"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "amazon-bedrock": {
            "command": "npx",
            "args": [
                "-y",
                "@zxkane/mcp-server-amazon-bedrock"
            ],
            "env": {
                "AWS_PROFILE": "your_profile_name",
                "AWS_ACCESS_KEY_ID": "your_access_key",
                "AWS_SECRET_ACCESS_KEY": "your_secret_key",
                "AWS_REGION": "us-east-1"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later