Amazon Bedrock MCP Server

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Amazon Bedrock MCP 服务器

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

特征

  • 使用亚马逊的 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

性能考虑

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

执照

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

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

提供对Amazon Bedrock的 Nova Canvas 模型的访问,用于 AI 图像生成。

  1. Features
    1. Prerequisites
      1. Installation
        1. AWS Credentials Configuration
        2. Claude Desktop Integration
      2. Available Tools
        1. generate_image
      3. Development
        1. Performance Considerations
      4. License
        ID: 9qw7dwpvj9