Skip to main content
Glama
Amazon Bedrock MCP Server

Amazon Bedrock MCP Server

by zxkane

Amazon Bedrock MCP 服务器

与 Amazon Bedrock 的 Nova Canvas 模型集成的模型控制协议 (MCP) 服务器,用于 AI 图像生成。

特征

  • 使用亚马逊的 Nova Canvas 模型根据文本描述生成高质量图像

  • 通过负面提示进行高级控制以改进图像构图

  • 图像尺寸和质量的灵活配置选项

  • 通过种子控制生成确定性图像

  • 强大的输入验证和错误处理

Related MCP server: AWS Nova Canvas

先决条件

  1. 具有 Amazon Bedrock 和 Nova Canvas 模型访问权限的有效 AWS 账户

  2. 正确配置具有所需权限的 AWS 凭证

  3. Node.js 版本 18 或更高版本

安装

AWS 凭证配置

该服务器需要具有适当 Amazon Bedrock 权限的 AWS 凭证。请使用以下方法之一进行配置:

  1. 环境变量:

    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. AWS 凭证文件( ~/.aws/credentials ):

    [the_profile_name]
    aws_access_key_id = your_access_key
    aws_secret_access_key = your_secret_key

    活动配置文件的环境变量:

    export AWS_PROFILE=the_profile_name
  3. IAM 角色(部署在 AWS 基础设施上时)

Claude 桌面集成

要与 Claude Desktop 集成,请将以下配置添加到您的设置文件中:

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 you want to use 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'
      }
    }
  }
}

可用工具

生成图像

使用 Amazon Bedrock 的 Nova Canvas 模型根据文本描述创建图像。

参数

  • prompt (必需):所需图像的描述性文字(1-1024 个字符)

  • negativePrompt (可选):要从图像中排除的元素(1-1024 个字符)

  • width (可选):图像宽度(以像素为单位)(默认值:1024)

  • height (可选):图像高度(以像素为单位)(默认值:1024)

  • quality (可选):图像质量级别 - “标准”或“高级”(默认:“标准”)

  • cfg_scale (可选):提示遵守强度(1.1-10,默认值:6.5)

  • seed (可选):用于可重复性的生成种子(0-858993459,默认值:12)

  • numberOfImages (可选):生成的批次大小(1-5,默认值:1)

示例实现

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

提示指南

为了获得最佳效果,请避免在主提示符中使用否定措辞(“no”、“not”、“without”)。相反,请将这些元素移至negativePrompt参数。例如,与其在提示符中使用“a landscape without houses”,不如在negativePrompt中使用“buildings”。

有关详细的使用指南,请参阅Nova Canvas 文档。

发展

要在本地环境中设置并运行服务器:

git clone https://github.com/zxkane/mcp-server-amazon-bedrock.git
cd mcp-server-amazon-bedrock
npm install
npm run build

性能考虑

生成时间受分辨率( width和height )、 numberOfImages和quality设置的影响。使用较高值时,请注意实现过程中可能出现的超时问题。

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅 LICENSE 文件。

Available Tools

1 tool
generate_imageC

Generate image(s) using Amazon Nova Canvas model. The returned data is Base64-encoded string that represent each image that was generated.

Inputs: prompt (required), cfg_scale, height, negativePrompt, +4 more.

Tool Schema Changelog

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

    TDQS

    B3/5.0

    Scored across 1 tool

    Disambiguation5/5

    With only one tool, there is no possibility of confusion or overlap between tools. The tool 'generate_image' has a clear and distinct purpose that cannot be mistaken for any other tool in the set.

    Naming Consistency5/5

    The single tool name 'generate_image' follows a verb_noun pattern, and with only one tool, consistency is inherently perfect. There are no other tools to compare against, so no inconsistencies can arise.

    Tool Count2/5

    A single tool is too few for a server named 'Amazon Bedrock MCP Server', which suggests a broader scope related to Amazon Bedrock services. This minimal toolset feels thin and incomplete for the implied domain, limiting functionality to just image generation.

    Completeness1/5

    The tool surface is severely incomplete for the server's purpose. Amazon Bedrock includes multiple models and capabilities beyond image generation, such as text generation, embeddings, and model management. The single tool fails to cover these core aspects, leaving significant gaps that will cause agent failures.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers