trackmcp
Back to directory
mohdhaji87

AWS-Bedrock-Guardrails-MCP

View on GitHub

This MCP server exposes all AWS Bedrock Guardrails management features as tools, allowing you to create, edit, delete, and export guardrails (including all policy types) programmatically or via LLMs like Claude Desktop. It also supports exporting guardrail configurations as Terraform files for infrastructure-as-code workflows.

0 stars PythonAI & Machine Learning Updated Jul 18, 2025

Documentation

Bedrock Guardrails MCP Server

Description

This MCP server exposes all AWS Bedrock Guardrails management features as tools, allowing you to create, edit, delete, and export guardrails (including all policy types) programmatically or via LLMs like Claude Desktop. It also supports exporting guardrail configurations as Terraform files for infrastructure-as-code workflows.

Features

  • Create, update, delete, and list AWS Bedrock Guardrails
  • Full support for all policy types: content, topic, word, sensitive information, contextual grounding, etc.
  • Export any guardrail as a Terraform `.tf` file (CloudFormation schema)
  • Secure authentication using AWS credentials from environment variables
  • Ready for integration with Claude Desktop or any MCP-compatible client

Prerequisites

  • Python 3.12+
  • uv package manager
  • AWS account with Bedrock Guardrails permissions
  • AWS credentials set in your environment (see below)

Setup

1. Clone the repository

2. Install dependencies:

bash
uv venv
   source .venv/bin/activate
   uv pip install -r requirements.txt  # or use pyproject.toml with uv

3. Set AWS credentials in your environment:

bash
export AWS_ACCESS_KEY_ID=your-access-key
   export AWS_SECRET_ACCESS_KEY=your-secret-key
   export AWS_SESSION_TOKEN=your-session-token  # if using temporary credentials
   export AWS_REGION=us-east-1  # or your preferred region

> Security Note: Never commit your credentials to source control. Use environment variables or a secure credentials manager.

4. Run the server:

bash
uv run server.py

Claude Desktop Integration

To use this server as a tool in Claude Desktop, add the following to your `claude_desktop_config.json`:

json
{
  "mcpServers": {
    "BedrockGuardrailsMCP": {
      "command": "uv",
      "args": [
        "--directory",
        "/Users/haji/mcp-servers/bedrock-guardrails-mcp",
        "run",
        "server.py"
      ]
    }
  }
}
  • Replace the directory path with your actual project location.
  • Restart Claude Desktop after updating the config.

Example Usage

  • Create a guardrail with full policy config:

Use the `create_guardrail_full` tool, passing all required and optional policy configs as dictionaries.

  • Update a guardrail:

Use `update_guardrail_full` with the guardrail ID and any fields to update.

  • Export to Terraform:

Use `export_guardrail_to_terraform(guardrail_id)` to get a `.tf` resource block for your guardrail.

Screenshots

Impact & Use Cases

  • Enterprise LLM Safety: Centrally manage and automate Bedrock Guardrails for all your generative AI applications.
  • DevOps & IaC: Export guardrails to Terraform for version control, reproducibility, and CI/CD integration.
  • LLM Tooling: Enable LLMs (like Claude) to programmatically manage safety policies, audit, and remediate risks.

Security

  • Credentials are only read from environment variables and never stored in code or logs.
  • All AWS API calls are made using the official `boto3` SDK.

License

See LICENSE file.

Frequently asked questions

What is AWS-Bedrock-Guardrails-MCP?

AWS-Bedrock-Guardrails-MCP is This MCP server exposes all AWS Bedrock Guardrails management features as tools, allowing you to create, edit, delete, and export guardrails (including all policy types) programmatically or via LLMs like Claude Desktop. It also supports exporting guardrail configurations as Terraform files for infrastructure-as-code workflows.

How do I install AWS-Bedrock-Guardrails-MCP?

Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.

Is AWS-Bedrock-Guardrails-MCP open source?

Yes — it is hosted on GitHub at https://github.com/mohdhaji87/aws-bedrock-guardrails-mcp.

Related MCP tools

Run your own MCP server? See who uses it and what to fix.

Measure it with TrackMCP