MCP Proxy for AWS

1.3.0 · active · verified Thu Apr 16

The MCP Proxy for AWS is a Python library that serves as a lightweight, client-side bridge between Model Context Protocol (MCP) clients (such as AI assistants and developer tools) and IAM-secured MCP servers on AWS. It handles SigV4 authentication using local AWS credentials and provides dynamic tool discovery. The library is currently at version 1.3.0 and is actively maintained, with updates released as needed to support AWS services and the MCP specification.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to programmatically initialize the `McpProxy` client. It assumes AWS credentials (e.g., `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_REGION`) and the `MCP_ENDPOINT_URL` environment variable are set. The client handles SigV4 authentication automatically using the default boto3 credential chain.

import os
from mcp_proxy_for_aws.mcp_proxy import McpProxy

# Ensure AWS credentials and region are configured (e.g., via environment variables or ~/.aws/credentials)
# For programmatic use, you might explicitly pass them, but for quickstart, rely on boto3's default chain.
aws_region = os.environ.get('AWS_REGION', 'us-east-1')
mcp_endpoint_url = os.environ.get('MCP_ENDPOINT_URL', 'https://your-mcp-server.amazonaws.com/mcp')

try:
    # Initialize the MCP Proxy client
    proxy_client = McpProxy(endpoint=mcp_endpoint_url, region=aws_region)
    print(f"Initialized MCP Proxy for endpoint: {mcp_endpoint_url}")

    # Example: Discover tools (this would typically involve calling a method that hits the MCP server)
    # Note: The actual method for tool discovery might vary based on the MCP server implementation.
    # This is a placeholder for demonstrating client initialization.
    print("Attempting to discover tools (requires a live MCP server)...")
    # In a real scenario, you'd call methods like proxy_client.discover_tools() if available
    # or integrate with an AI agent framework.
    print("MCP Proxy client initialized successfully. Ready for agent integration.")

except Exception as e:
    print(f"Error initializing MCP Proxy: {e}")
    print("Please ensure 'MCP_ENDPOINT_URL' and AWS credentials/region are correctly configured.")

view raw JSON →