Логотип MCP Proxy for AWS

MCP Proxy for AWS

Организация
aws

AWS MCP Proxy Server

Издательaws
Репозиторийmcp-proxy-for-aws
ЯзыкPython
Форки
63
Звёзды
354
Доступные инструменты
0
Тип транспортаstdio
Категории
ЛицензияApache-2.0
Ссылки
  • Подключайте инструменты к рабочим процессам с ИИ

    MCP Proxy for AWS предоставляет возможности MCP, доступные совместимым ИИ-клиентам и агентам.

  • Доступные инструменты: 0

    Ниже представлены доступные для вызова действия с названиями и описаниями, если сервер их предоставляет.

  • Готовая конфигурация для копирования

    Используйте примеры конфигурации, чтобы настроить этот сервер в предпочитаемом MCP-клиенте.

  • Показатели интереса к открытому проекту

    Звёзды: 354, форки: 63 — в связанном репозитории.

MCP Proxy for AWS

Overview

The MCP Proxy for AWS package provides two ways to connect AI applications to MCP servers on AWS:

  1. Using it as a proxy - It becomes a lightweight, client-side bridge between MCP clients (AI assistants like Claude Desktop, Kiro CLI) and MCP servers on AWS. (See MCP Proxy)
  2. Using it as a library - Programmatically connect popular AI agent frameworks (LangChain, LlamaIndex, Strands Agents, etc.) to MCP servers on AWS. (See Programmatic Access)

When Do You Need This Package?

  • You want to connect to MCP servers on AWS (e.g., using Amazon Bedrock AgentCore) that use AWS IAM authentication (SigV4) instead of OAuth
  • You're using MCP clients (like Claude Desktop, Kiro CLI) that don't natively support AWS IAM authentication
  • You're building AI agents with popular frameworks like LangChain, Strands Agents, LlamaIndex, etc., that need to connect to MCP servers on AWS
  • You want to avoid building custom SigV4 request signing logic yourself

How This Package Helps

The Problem: The official MCP specification supports OAuth-based authentication, but MCP servers on AWS can also use AWS IAM authentication (SigV4). Standard MCP clients don't know how to sign requests with AWS credentials.

The Solution: This package bridges that gap by:

  • Handling SigV4 authentication automatically - Uses your local AWS credentials (from AWS CLI, environment variables, or IAM roles) to sign all MCP requests using SigV4
  • Providing seamless integration - Works with existing MCP clients and frameworks
  • Eliminating custom code - No need to build your own MCP client with SigV4 signing logic

Which Feature Should I Use?

Use as a proxy if you want to:

  • Connect MCP clients like Claude Desktop or Kiro CLI to MCP servers on AWS with IAM credentials
  • Add MCP servers on AWS to your AI assistant's configuration
  • Use a command-line tool that runs as a bridge between your MCP client and AWS

→ Install mcp-proxy-for-aws-cli, the version-pinned CLI distribution: it freezes the entire dependency tree to tested versions. See MCP Proxy.

Use as a library if you want to:

  • Build AI agents programmatically using popular frameworks like LangChain, Strands Agents, or LlamaIndex
  • Integrate AWS IAM-secured MCP servers directly into your Python applications
  • Have fine-grained control over the MCP session lifecycle in your code

→ Install mcp-proxy-for-aws, the library distribution: it keeps loose, co-resolvable dependency ranges so it resolves alongside your own dependencies. See Programmatic Access.

Prerequisites


MCP Proxy

The MCP Proxy serves as a lightweight, client-side bridge between MCP clients (AI assistants and developer tools) and IAM-secured MCP servers on AWS. The proxy handles SigV4 authentication using local AWS credentials and provides dynamic tool discovery.

Installation

Using PyPi

For CLI and uvx use, install mcp-proxy-for-aws-cli. It is a thin, version-pinned distribution: it freezes the proxy's entire transitive dependency tree to tested versions, so a fresh install cannot silently pull in a newer — possibly compromised — release of a dependency. (The unsuffixed mcp-proxy-for-aws is the library distribution with loose, co-resolvable ranges, for importing mcp_proxy_for_aws in your own code — see Programmatic Access.)

bash
# Run the server (pinned CLI distribution)
uvx mcp-proxy-for-aws-cli@latest <SigV4 MCP endpoint URL>

Note: Because mcp-proxy-for-aws-cli pins its entire dependency tree inside the package, even @latest installs a tested, frozen set. Check PyPI for available versions.

Note: The first run may take tens of seconds as uvx downloads and caches dependencies. Subsequent runs will start in seconds. Actual startup time depends on your network and hardware.

Using a local repository

bash
git clone https://github.com/aws/mcp-proxy-for-aws.git
cd mcp-proxy-for-aws
uv run mcp_proxy_for_aws/server.py <SigV4 MCP endpoint URL>

Using Docker

Docker images are published to the public AWS ECR registry.

You can use the pre-built image:

bash
# Pull the latest image
docker pull public.ecr.aws/mcp-proxy-for-aws/mcp-proxy-for-aws:latest

# Or pull a specific version
docker pull public.ecr.aws/mcp-proxy-for-aws/mcp-proxy-for-aws:1.1.6

Or build the image locally:

bash
# Build the Docker image
docker build -t mcp-proxy-for-aws .

Configuration Parameters

ParameterDescriptionDefaultRequired
endpointMCP endpoint URL (e.g., https://your-service.us-east-1.amazonaws.com/mcp)N/AYes
------------
--serviceAWS service name for SigV4 signing, if omitted we try to infer this from the urlInferred from endpoint if not providedNo
--profileAWS profile(s) to use. First profile is the default. Additional profiles enable per-call switching via aws_profile tool parameter (e.g., --profile prod-readonly dev staging)Falls back to AWS_PROFILE if --profile and AWS_MCP_PROXY_PROFILES are not setNo
--regionAWS region to useUses AWS_REGION environment variable if not setNo
--metadataMetadata to inject into MCP requests as key=value pairs (e.g., --metadata KEY1=value1 KEY2=value2)AWS_REGION is automatically injected based on --region if not providedNo
--headerExtra HTTP header as a key=value pair, repeat the flag for more (e.g., --header x-tenant=acme --header x-trace=abc123). Sent as real HTTP headers and covered by the SigV4 signature; values are redacted from logs. Headers set by signing (authorization, date, x-amz-date, x-amz-security-token) are rejected.NoneNo
--read-onlyDisable tools which may require write permissions (tools which DO NOT require write permissions are annotated with readOnlyHint=true)FalseNo
--retriesConfigures number of retries done when calling upstream services, setting this to 0 disables retries.0No
--log-levelSet the logging level (DEBUG/INFO/WARNING/ERROR/CRITICAL)INFONo
--timeoutSet desired timeout in seconds across all operations180No
--connect-timeoutSet desired connect timeout in seconds60No
--read-timeoutSet desired read timeout in seconds120No
--write-timeoutSet desired write timeout in seconds180No
--tool-timeoutMaximum seconds a tool call may take before being cancelled. When set, returns a graceful error to the agent instead of hanging indefinitely300No
--skip-authSkip request signing when AWS credentials are unavailable instead of failingFalseNo
--disable-telemetryDisables telemetry data collectionFalseNo

Optional Environment Variables

Set the environment variables for the MCP Proxy for AWS:

bash
# Credentials through profile
export AWS_PROFILE=<aws_profile>

# Credentials through parameters
export AWS_ACCESS_KEY_ID=<access_key_id>
export AWS_SECRET_ACCESS_KEY=<secret_access_key>
export AWS_SESSION_TOKEN=<session_token>

# AWS Region
export AWS_REGION=<aws_region>

# Multi-profile switching (alternative to --profile flag, useful for plugin integration)
export AWS_MCP_PROXY_PROFILES="prod-readonly dev staging"

[!NOTE] AWS_MCP_PROXY_PROFILES takes precedence over --profile / AWS_PROFILE when set.

[!NOTE] When getting a NoRegionError (surfaced by MCP clients as -32602: Invalid request parameters) and using aws login profiles, please configure the region for the given profile using aws configure set region <region> or set AWS_REGION.

Multi-account access

The proxy supports per-call AWS profile switching, allowing agents to work across multiple accounts without restarting.

Configuration:

bash
# Via CLI flag (first profile is default, rest are switchable)
mcp-proxy-for-aws-cli https://aws-mcp.us-east-1.api.aws/mcp --profile prod-readonly dev staging

# Via environment variable (same behavior, for plugin integration)
AWS_MCP_PROXY_PROFILES="prod-readonly dev staging" mcp-proxy-for-aws-cli https://aws-mcp.us-east-1.api.aws/mcp

How it works:

  • The proxy injects an aws_profile parameter into auth-requiring tools
  • The agent can pass aws_profile on any call to route it through a specific profile's credentials
  • If aws_profile is omitted, the default (first) profile is used
  • Invalid profiles are rejected with an error listing allowed values
  • Each non-default profile gets its own dedicated connection to the backend

Example MCP config (Kiro):

json
{
  "mcpServers": {
    "aws": {
      "command": "uvx",
      "args": ["mcp-proxy-for-aws-cli@latest", "https://aws-mcp.us-east-1.api.aws/mcp"],
      "env": {
        "AWS_MCP_PROXY_PROFILES": "prod-readonly dev staging"
      }
    }
  }
}

Setup Examples

Add the following configuration to your MCP client config file (e.g., for Kiro CLI, edit ~/.kiro/settings/mcp.json): Note Add your own endpoint by replacing <SigV4 MCP endpoint URL>

Running from local - using uv

json
{
  "mcpServers": {
    "<mcp server name>": {
      "disabled": false,
      "type": "stdio",
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/mcp_proxy_for_aws",
        "run",
        "server.py",
        "<SigV4 MCP endpoint URL>",
        "--service",
        "<your service code>",
        "--profile",
        "default",
        "--region",
        "us-east-1",
        "--read-only",
        "--log-level",
        "INFO",
      ]
    }
  }
}

[!NOTE] Cline users should not use --log-level argument because Cline checks the log messages in stderr for text "error" (case insensitive).

Using Docker

Using the pre-built public ECR image:

json
{
  "mcpServers": {
    "<mcp server name>": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "--volume",
        "/full/path/to/.aws:/app/.aws:ro",
        "public.ecr.aws/mcp-proxy-for-aws/mcp-proxy-for-aws:latest",
        "<SigV4 MCP endpoint URL>"
      ],
      "env": {}
    }
  }
}

Or using a locally built image:

json
{
  "mcpServers": {
    "<mcp server name>": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "--volume",
        "/full/path/to/.aws:/app/.aws:ro",
        "mcp-proxy-for-aws",
        "<SigV4 MCP endpoint URL>"
      ],
      "env": {}
    }
  }
}

Programmatic Access

The MCP Proxy for AWS enables programmatic integration of IAM-secured MCP servers into AI agent frameworks. The library provides authenticated transport layers that work with popular Python AI frameworks.

By default, the library resolves AWS credentials automatically from the standard boto3 credential chain (environment variables, shared credentials file, etc.). You can optionally pass credentials programmatically via the credentials parameter. When provided, these take precedence over the aws_profile parameter. Note that aws_region must be explicitly specified when using credentials.

python
from botocore.credentials import Credentials
from mcp_proxy_for_aws.client import aws_iam_streamablehttp_client

creds = Credentials(access_key='...', secret_key='...', token='...')

mcp_client = aws_iam_streamablehttp_client(
    endpoint=mcp_url,
    aws_region=region,
    aws_service=service,
    credentials=creds,  # Optional: explicitly pass AWS credentials
)

Injecting Metadata

You can inject metadata into the MCP _meta field on every request using the metadata parameter. This is useful for passing additional context to the server that cannot be sent as HTTP headers due to size limits.

python
from mcp_proxy_for_aws.client import aws_iam_streamablehttp_client

mcp_client = aws_iam_streamablehttp_client(
    endpoint=mcp_url,
    aws_region=region,
    aws_service=service,
    metadata={
        'custom/session-context': 'my-value',
        'custom/tracking-id': 'abc-123',
    },
)

Integration Patterns

The library supports two integration patterns depending on your framework:

Pattern 1: Client Factory Integration

Use with: Frameworks that accept a factory function that returns an MCP client, e.g. Strands Agents, Microsoft Agent Framework. The aws_iam_streamablehttp_client is passed as a factory to the framework, which handles the connection lifecycle internally.

Example - Strands Agents:

python
from mcp_proxy_for_aws.client import aws_iam_streamablehttp_client

mcp_client_factory = lambda: aws_iam_streamablehttp_client(
    endpoint=mcp_url,    # The URL of the MCP server
    aws_region=region,   # The region of the MCP server
    aws_service=service  # The underlying AWS service, e.g. "bedrock-agentcore"
)

with MCPClient(mcp_client_factory) as mcp_client:
    mcp_tools = mcp_client.list_tools_sync()
    agent = Agent(tools=mcp_tools, ...)

Example - Microsoft Agent Framework:

python
from mcp_proxy_for_aws.client import aws_iam_streamablehttp_client

mcp_client_factory = lambda: aws_iam_streamablehttp_client(
    endpoint=mcp_url,    # The URL of the MCP server
    aws_region=region,   # The region of the MCP server
    aws_service=service  # The underlying AWS service, e.g. "bedrock-agentcore"
)

mcp_tools = MCPStreamableHTTPTool(name="MCP Tools", url=mcp_url)
mcp_tools.get_mcp_client = mcp_client_factory

async with mcp_tools:
    agent = ChatAgent(tools=[mcp_tools], ...)

Pattern 2: Direct MCP Session Integration

Use with: Frameworks that require direct access to the MCP sessions, e.g. LangChain, LlamaIndex. The aws_iam_streamablehttp_client provides the authenticated transport streams, which are then used to create an MCP ClientSession.

Example - LangChain:

python
from mcp_proxy_for_aws.client import aws_iam_streamablehttp_client

mcp_client = aws_iam_streamablehttp_client(
    endpoint=mcp_url,    # The URL of the MCP server
    aws_region=region,   # The region of the MCP server
    aws_service=service  # The underlying AWS service, e.g. "bedrock-agentcore"
)

async with mcp_client as (read, write, session_id_callback):
    async with ClientSession(read, write) as session:
        mcp_tools = await load_mcp_tools(session)
        agent = create_langchain_agent(tools=mcp_tools, ...)

Example - LlamaIndex:

python
from mcp_proxy_for_aws.client import aws_iam_streamablehttp_client

mcp_client = aws_iam_streamablehttp_client(
    endpoint=mcp_url,    # The URL of the MCP server
    aws_region=region,   # The region of the MCP server
    aws_service=service  # The underlying AWS service, e.g. "bedrock-agentcore"
)

async with mcp_client as (read, write, session_id_callback):
    async with ClientSession(read, write) as session:
        mcp_tools = await McpToolSpec(client=session).to_tool_list_async()
        agent = ReActAgent(tools=mcp_tools, ...)

Running Examples

Explore complete working examples for different frameworks in the ./examples/mcp-client directory:

Available examples:

Run examples individually:

bash
cd examples/mcp-client/[framework]  # e.g. examples/mcp-client/strands
uv run main.py

Installation

For programmatic/library use, install mcp-proxy-for-aws — the distribution with loose, co-resolvable dependency ranges. (For CLI/uvx use, install mcp-proxy-for-aws-cli instead, which pins the whole dependency tree — see MCP Proxy.)

The client library is included when you install the package:

bash
pip install mcp-proxy-for-aws

For development:

bash
git clone https://github.com/aws/mcp-proxy-for-aws.git
cd mcp-proxy-for-aws
uv sync

Troubleshooting

Authentication errors

We try to autodetect the service from the url, sometimes this fails, ensure that --service is set correctly to the service you are attempting to connect to. Otherwise the SigV4 signing will not be able to be verified by the service you connect to, resulting in this error. Also ensure that you have valid IAM credentials on your machine before retrying.

For long-running sessions, consider using long-lived credentials:

  • Use an AWS profile via --profile
  • Use IAM Identity Center and run aws sso login before starting the proxy

The proxy reads fresh credentials from disk on every request, so credential refreshes and account switches take effect immediately — no restart or retry required. Simply refresh your credentials (e.g., aws sso login) and the next request will use them.

Client hangs on tool calls

If your MCP client hangs waiting for a tool call response (e.g., due to an unresponsive endpoint), use --tool-timeout to set a maximum duration in seconds for each tool call. When the timeout is exceeded, the proxy returns a graceful error to the agent instead of hanging indefinitely.

Unsigned requests

By default, the proxy signs all outgoing requests with SigV4 using your local AWS credentials. If you need to connect to an MCP endpoint that does not require SigV4 credentials (e.g., a local development server or a publicly accessible endpoint), use the --skip-auth flag:

bash
uvx mcp-proxy-for-aws-cli@latest https://my-endpoint.example.com/mcp --skip-auth

When --skip-auth is set, the proxy sends requests without signing them if AWS credentials are unavailable. If credentials are available, requests are still signed as usual — the flag only changes behavior when credentials cannot be resolved.

Development & Contributing

For development setup, testing, and contribution guidelines, see:

Resources to understand SigV4:

License

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License").

Disclaimer

LLMs are non-deterministic and they make mistakes, we advise you to always thoroughly test and follow the best practices of your organization before using these tools on customer facing accounts. Users of this package are solely responsible for implementing proper security controls and MUST use AWS Identity and Access Management (IAM) to manage access to AWS resources. You are responsible for configuring appropriate IAM policies, roles, and permissions, and any security vulnerabilities resulting from improper IAM configuration are your sole responsibility. By using this package, you acknowledge that you have read and understood this disclaimer and agree to use the package at your own risk.

Установка

TypingMind
Требования:

Node.js 18+

{
  "mcpServers": {
    "aws-mcp-proxy-for-aws": {
      "command": "uvx",
      "args": [
        "mcp-proxy-for-aws"
      ]
    }
  }
}

Используйте MCP MCP Proxy for AWS с разными ИИ-моделями

TypingMind подключает инструменты MCP на уровне рабочего пространства, поэтому после подключения MCP Proxy for AWS вы можете использовать их с разными моделями ИИ в TypingMind, не настраивая подключение отдельно для каждой модели. Эта интеграция MCP работает локально на вашем устройстве через коннектор MCP TypingMind.

Руководство по настройке локального коннектора

Выберите этот способ, если серверу MCP нужен доступ к локальным файлам, приложениям или закрытым ресурсам на вашем компьютере.

1

Откройте настройки MCP

В TypingMind откройте «Настройки», затем «Расширенные настройки», перейдите в раздел «Протокол контекста модели» и выберите «Настроить коннектор».

  1. Откройте TypingMind в браузере.
  2. Нажмите значок настроек.
  3. Перейдите в «Расширенные настройки».
  4. Откройте раздел «Протокол контекста модели».
  5. Нажмите «Настроить коннектор» и выберите «Это устройство».
Экран настройки коннектора MCP в TypingMind с выбранным вариантом «Это устройство»
2

Выполните команду коннектора

Выберите «Это устройство», скопируйте команду из TypingMind и выполните её в терминале. Не останавливайте процесс, пока используете MCP.

  1. Скопируйте команду настройки, показанную в TypingMind.
  2. Откройте «Терминал» в macOS или Windows Terminal в Windows.
  3. Вставьте и выполните команду.
  4. Подтвердите установку пакета, если терминал запросит разрешение продолжить.
  5. Не закрывайте окно терминала и не останавливайте процесс, пока используете инструменты MCP.
3

Добавьте MCP Proxy for AWS как сервер

Когда статус коннектора сменится на «Готов», нажмите «Изменить серверы» и вставьте конфигурацию сервера MCP.

  1. Дождитесь, пока статус коннектора сменится на «Готов».
  2. Нажмите «Изменить серверы».
  3. Вставьте конфигурацию сервера MCP для MCP Proxy for AWS.
  4. Сохраните список серверов.
  5. Обновите статус, если хотите убедиться, что коннектор по-прежнему готов к работе.
Настройки MCP в TypingMind с активным сервером и кнопкой «Изменить серверы»
{
  "mcpServers": {
    "aws-mcp-proxy-for-aws": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-proxy-for-aws"
      ]
    }
  }
}
4

Используйте подключение с разными моделями

Сохраните список серверов, откройте раздел «Плагины», включите инструменты MCP для MCP Proxy for AWS, затем выберите любую поддерживаемую модель ИИ в TypingMind и используйте инструменты в чате или назначьте их ИИ-агенту.

  1. Откройте страницу «Плагины» в TypingMind.
  2. Включите инструменты MCP для MCP Proxy for AWS.
  3. Начните чат и выберите модель ИИ, которую хотите использовать.
  4. Используйте инструменты MCP в чате или назначьте их ИИ-агенту.
  5. При необходимости переключайтесь на другую модель ИИ без повторного подключения MCP.
Чат TypingMind с включёнными инструментами MCP и выбранной ИИ-моделью
Можете помочь мне с этой задачей с помощью MCP Proxy for AWS?
MCP Proxy for AWS
Конечно. Я всё прочитал.
Вот что я нашёл с помощью MCP Proxy for AWS.

Часто задаваемые вопросы

Для чего используется сервер MCP MCP Proxy for AWS?

MCP Proxy for AWS — это сервер MCP, который позволяет совместимым ИИ-клиентам подключаться к внешним инструментам и получать контекст. В TypingMind достаточно один раз добавить этот сервер MCP, чтобы его инструменты стали доступны в вашем рабочем пространстве с ИИ.

Можно ли использовать сервер MCP MCP Proxy for AWS с несколькими ИИ-моделями в TypingMind?

Да. TypingMind подключает инструменты MCP на уровне рабочего пространства, поэтому вы можете использовать MCP Proxy for AWS с разными ИИ-моделями, например Claude, ChatGPT, Gemini или другими моделями, настроенными в TypingMind, без отдельной настройки сервера MCP для каждой модели.

Зачем использовать MCP MCP Proxy for AWS с TypingMind?

TypingMind — один из лучших интерфейсов для чата с LLM: он объединяет разные ИИ-модели, промпты, плагины, ИИ-агентов, ключи API и инструменты MCP в одном рабочем пространстве. Подключив MCP Proxy for AWS, вы сможете использовать его инструменты MCP с предпочитаемыми моделями, сохраняя удобную организацию работы с чатами в TypingMind.

Как подключить сервер MCP MCP Proxy for AWS к TypingMind?

MCP Proxy for AWS работает через локальный коннектор MCP TypingMind. Этот вариант лучше всего подходит, когда серверу MCP нужен доступ к локальным файлам, настольным приложениям, инструментам командной строки или закрытым ресурсам на вашем компьютере.

Какие инструменты предоставляет сервер MCP MCP Proxy for AWS в TypingMind?

MCP Proxy for AWS предоставляет возможности MCP, которые можно включить на странице «Плагины» в TypingMind и использовать в чате или назначить ИИ-агентам.

Нужно ли передавать TypingMind свои ключи API для использования сервера MCP MCP Proxy for AWS?

Нет. TypingMind ориентирован прежде всего на локальную работу и позволяет вам контролировать выбор провайдеров моделей, ключи API, промпты и конфигурацию MCP. Если MCP Proxy for AWS требует аутентификации, при создании подключения добавьте необходимые заголовки, настройки OAuth или локальную конфигурацию для этого сервера MCP.

Похожие серверы MCP

Все

Создайте свою рабочую ИИ-среду сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇