DM

danilop/mcp2lambda

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

109 stars 21 forks Качество 84 Тренд 29MIT

danilop/mcp2lambda — это кандидат на MCP-сервер, импортированный из https://github.com/danilop/mcp2lambda.

Обзор

danilop/mcp2lambda — это кандидат на MCP-сервер, импортированный из https://github.com/danilop/mcp2lambda.

Обзор (машинный перевод)

Запускайте любую AWS Lambda-функцию как Large Language Model (LLM) tool без изменений кода, используя протокол Model Context Protocol (MCP) от Anthropic.

Этот MCP-сервер служит мостом между MCP-клиентами и функциями AWS Lambda, позволяя генеративным AI-моделям получать доступ и запускать Lambda-функции как инструменты. Это полезно, например, для доступа к частным ресурсам, таким как внутренние приложения и базы данных, без необходимости предоставлять доступ к публичным сетям. Такой подход позволяет модели использовать другие сервисы AWS, частные сети и публичный интернет.

С точки зрения безопасности этот подход реализует разделение обязанностей, позволяя модели вызывать функции Lambda, но не получать прямой доступ к другим сервисам AWS. Клиенту нужны только учетные данные AWS для вызова функций Lambda. Функции Lambda затем могут взаимодействовать с другими сервисами AWS (используя роль функции) и получать доступ к публичным или частным сетям.

Сервер MCP предоставляет доступ к двум инструментам:

  1. Первый инструмент может автоматически обнаружить все функции Lambda в вашей учетной записи, которые совпадают с префиксом или разрешенным списком имён. Этот инструмент разделяет имена функций и их описания с моделью.

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

README

Показан фрагмент оригинального README. Открыть оригинал.

MCP2Lambda

Run any AWS Lambda function as a Large Language Model (LLM) tool without code changes using Anthropic’s Model Context Protocol (MCP).

graph LR
    A[Model]  B[MCP Client]
    B  C["MCP2Lambda(MCP Server)"]
    C  D[Lambda Function]
    D  E[Other AWS Services]
    D  F[Internet]
    D  G[VPC]
    
    style A fill:#f9f,stroke:#333,stroke-width:2px
    style B fill:#bbf,stroke:#333,stroke-width:2px
    style C fill:#bfb,stroke:#333,stroke-width:4px
    style D fill:#fbb,stroke:#333,stroke-width:2px
    style E fill:#fbf,stroke:#333,stroke-width:2px
    style F fill:#dff,stroke:#333,stroke-width:2px
    style G fill:#ffd,stroke:#333,stroke-width:2px

This MCP server acts as a bridge between MCP clients and AWS Lambda functions, allowing generative AI models to access and run Lambda functions as tools. This is useful, for example, to access private resources such as internal applications and databases without the need to provide public network access. This approach allows the model to use other AWS services, private networks, and the public internet.

From a security perspective, this approach implements segregation of duties by allowing the model to invoke the Lambda functions but not to access the other AWS services directly. The client only needs AWS credentials to invoke the Lambda functions. The Lambda functions can then interact with other AWS services (using the function role) and access public or private networks.

The MCP server gives access to two tools:

  1. The first tool can autodiscover all Lambda functions in your account that match a prefix or an allowed list of names. This tool shares the names of the functions and their descriptions with the model.

  2. The second tool allows to invoke those Lambda functions by name passing the required parameters.

No code changes are required. You should change these configurations to improve results:

Strategy Selection

The gateway supports two different strategies for handling Lambda functions:

  1. Pre-Discovery Mode (default: enabled): Registers each Lambda function as an individual tool at startup. This provides a more intuitive interface where each function appears as its own named tool.

  2. Generic Mode: Uses two generic tools (list_lambda_functions and invoke_lambda_function) to interact with Lambda functions.

You can control this behavior through:

  • Environment variable: PRE_DISCOVERY=true|false
  • CLI flag: --no-pre-discovery (disables pre-discovery mode)

Example:

# Disable pre-discovery mode
export PRE_DISCOVERY=false
python main.py

# Or using CLI flag to disable pre-discovery
Открыть полный README на GitHub

Установка

This server does not publish a one-line install command.

Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "mcpServers": { "mcp2lambda": { "command": "uv", "args": [ "--directory", "<full path to the mcp2lambda directory>", "run", "main.py" ] } } }