modmex-lambda 0.7.1__tar.gz → 0.7.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/PKG-INFO +164 -13
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/README.md +163 -12
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/__init__.py +2 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/logging.py +1 -1
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/mcp/__init__.py +8 -2
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/mcp/middleware.py +46 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/mcp/server.py +13 -3
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/mcp/tool.py +8 -4
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/mcp/transport.py +134 -7
- modmex_lambda-0.7.3/modmex_lambda/mcp/web_adapter.py +155 -0
- modmex_lambda-0.7.3/modmex_lambda/mcp/web_adapter_launcher.py +34 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/pyproject.toml +1 -1
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/mcp/helpers.py +1 -0
- modmex_lambda-0.7.3/tests/mcp/test_http.py +347 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/mcp/test_middleware.py +13 -0
- modmex_lambda-0.7.1/tests/mcp/test_http.py +0 -108
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/.github/workflows/ci.yml +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/.github/workflows/release.yml +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/.gitignore +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/LICENSE +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/connectors/__init__.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/connectors/cloudwatch.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/connectors/dynamodb.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/connectors/eventbridge.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/connectors/eventbridge_scheduler.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/connectors/icloudwatch.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/connectors/idynamodb.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/connectors/ieventbridge.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/connectors/ieventbridge_scheduler.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/connectors/ilambda.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/connectors/is3.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/connectors/isns.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/connectors/isqs.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/connectors/lambda_.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/connectors/module.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/connectors/s3.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/connectors/sns.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/connectors/sqs.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/data_classes/__init__.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/data_classes/api_gateway_authorizer_event.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/data_classes/api_gateway_proxy_event.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/data_classes/api_gateway_websocket_event.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/data_classes/cognito_user_pool_event.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/data_classes/common.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/dependencies.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/event_handler/__init__.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/event_handler/api_gateway.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/event_handler/constants.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/event_handler/content_types.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/event_handler/cors.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/event_handler/dependencies/__init__.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/event_handler/dependencies/compat.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/event_handler/dependencies/dependant.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/event_handler/dependencies/dependency_middleware.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/event_handler/dependencies/depends.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/event_handler/dependencies/params.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/event_handler/dependencies/types.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/event_handler/exception_handler.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/event_handler/exceptions.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/event_handler/gateway_response.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/event_handler/middlewares.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/event_handler/params.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/event_handler/request.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/event_handler/response.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/event_handler/routing.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/event_handler/routing_fallbacks.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/event_handler/types.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/event_sources.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/exceptions.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/mcp/prompt.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/mcp/protocol.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/mcp/registry.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/mcp/resource.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/mcp/schema.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/params.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/parser.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/persistence/__init__.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/persistence/dynamodb/__init__.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/persistence/dynamodb/expressions.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/persistence/dynamodb/keys.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/persistence/dynamodb/materialized_views.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/persistence/dynamodb/stream_fields.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/py.typed +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/request.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/resolver.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/response.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/routing.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/shared/__init__.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/shared/cookies.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/shared/headers_serializer.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/shared/json_encoder.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/shared/types.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/__init__.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/events/__init__.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/events/dynamodb.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/events/kinesis.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/events/s3.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/events/sns.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/events/sqs.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/filters/__init__.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/filters/content.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/filters/event_type.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/filters/latch.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/filters/skip.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/flavors/__init__.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/flavors/base_flavor.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/flavors/cdc.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/flavors/collect.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/flavors/correlate.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/flavors/evaluate.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/flavors/expired.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/flavors/iflavor.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/flavors/job.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/flavors/materialize.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/flavors/s3.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/flavors/schedule.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/flavors/sns.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/flavors/task.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/flavors/update.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/irules_registry.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/operators/__init__.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/operators/cloudwatch.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/operators/dynamodb.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/operators/ioperator.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/operators/lambda_.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/operators/publisher.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/operators/s3.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/operators/scheduler.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/operators/sns.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/operators/sqs.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/rules_registry.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/runner.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/schedulers.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/sources/__init__.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/sources/base.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/sources/dynamodb.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/sources/kinesis.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/sources/s3.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/sources/sns.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/sources/sqs.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/utils/__init__.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/utils/apigateway.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/utils/aws.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/utils/batch.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/utils/cloudwatch.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/utils/concurrency.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/utils/contracts.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/utils/data_classes/__init__.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/utils/data_classes/dynamodb.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/utils/decorators.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/utils/dynamodb.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/utils/eventbridge.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/utils/faults.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/utils/filters.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/utils/json_encoder.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/utils/lambda_.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/utils/operators.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/utils/pluralize.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/utils/print.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/utils/retry.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/utils/s3.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/utils/sns.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/utils/split.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/utils/sqs.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/utils/tags.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/utils/time.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/stream/utils/uow.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/tracing.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/modmex_lambda/validation.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/poetry.lock +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/__init__.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/conftest.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/connectors/__init__.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/connectors/conftest.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/connectors/test_cloudwatch.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/connectors/test_dynamodb.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/connectors/test_lazy_clients.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/connectors/test_s3.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/connectors/test_simple_connectors.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/connectors/test_sns.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/connectors/test_sqs.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/data_classes/__init__.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/data_classes/test_api_gateway_proxy_event.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/data_classes/test_cognito_user_pool_event.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/data_classes/test_common.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/event_handler/__init__.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/event_handler/test_api_gateway.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/event_handler/test_cors.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/event_handler/test_dependencies.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/event_handler/test_exception_handler.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/event_handler/test_gateway_response.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/event_handler/test_request.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/event_handler/test_response.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/event_handler/test_routing.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/mcp/__init__.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/mcp/test_resources_prompts.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/mcp/test_server.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/mcp/test_tools.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/mcp/test_transport.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/persistence/__init__.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/persistence/test_dynamodb_expressions.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/persistence/test_dynamodb_keys.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/persistence/test_dynamodb_materialized_views.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/persistence/test_dynamodb_stream_fields.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/shared/__init__.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/shared/test_cookies_headers.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/shared/test_json_encoder.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/__init__.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/conftest.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/events/__init__.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/events/test_dynamodb.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/events/test_kinesis.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/events/test_s3.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/events/test_sns.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/events/test_sqs.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/filters/__init__.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/filters/test_content.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/filters/test_event_type.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/filters/test_latch.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/filters/test_skip.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/flavors/__init__.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/flavors/source_events.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/flavors/test_base_flavor.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/flavors/test_cdc.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/flavors/test_collect.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/flavors/test_correlate.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/flavors/test_evaluate.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/flavors/test_expired.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/flavors/test_job.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/flavors/test_materialize.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/flavors/test_s3.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/flavors/test_schedule.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/flavors/test_sns.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/flavors/test_task.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/flavors/test_update.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/operators/test_scheduler.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/test_dependency_resolver.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/test_faults.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/test_rules_registry.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/test_runner.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/test_runner_pipeline.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/test_sources.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/utils/__init__.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/utils/faults.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/utils/test_apigateway.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/utils/test_aws.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/utils/test_batch.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/utils/test_cloudwatch.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/utils/test_concurrency.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/utils/test_decorators.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/utils/test_dynamodb.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/utils/test_eventbridge.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/utils/test_filters.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/utils/test_json_encoder.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/utils/test_lambda.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/utils/test_operators.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/utils/test_pluralize.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/utils/test_print.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/utils/test_retry.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/utils/test_s3.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/utils/test_sns.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/utils/test_split.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/utils/test_sqs.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/utils/test_tags.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/utils/test_time.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/stream/utils/test_uow.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/test_lazy_imports.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/test_logging.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/test_parser_event_sources.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/test_reexports.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/test_tracing.py +0 -0
- {modmex_lambda-0.7.1 → modmex_lambda-0.7.3}/tests/test_validation.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: modmex-lambda
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.3
|
|
4
4
|
Summary: Ultra-lightweight AWS Lambda utilities for API Gateway routing and event handling.
|
|
5
5
|
Author: Modmex
|
|
6
6
|
License: MIT
|
|
@@ -1269,9 +1269,10 @@ handler = KinesisSource(registry, concurrency=False).handle
|
|
|
1269
1269
|
|
|
1270
1270
|
## Model Context Protocol (MCP) Server
|
|
1271
1271
|
|
|
1272
|
-
`modmex-lambda`
|
|
1273
|
-
|
|
1274
|
-
|
|
1272
|
+
`modmex-lambda` implements the MCP `2026-07-28` server runtime and adapts it to
|
|
1273
|
+
the existing Lambda HTTP resolvers or to Lambda Web Adapter. MCP is an
|
|
1274
|
+
optional adapter; it reuses the existing dependency injection, middleware and
|
|
1275
|
+
application lifecycle rather than introducing a parallel web framework.
|
|
1275
1276
|
|
|
1276
1277
|
### Basic server
|
|
1277
1278
|
|
|
@@ -1303,6 +1304,60 @@ app.include_mcp(mcp, path="/mcp")
|
|
|
1303
1304
|
handler = app.handler
|
|
1304
1305
|
```
|
|
1305
1306
|
|
|
1307
|
+
### Choosing the resolver
|
|
1308
|
+
|
|
1309
|
+
Choose the resolver from the AWS transport and whether the function must
|
|
1310
|
+
stream the HTTP response:
|
|
1311
|
+
|
|
1312
|
+
| AWS transport | Response mode | Resolver | Entrypoint behavior |
|
|
1313
|
+
|---|---|---|---|
|
|
1314
|
+
| API Gateway HTTP API v2 | buffered | `APIGatewayHttpResolver` | `handler(event, context)` |
|
|
1315
|
+
| API Gateway REST API v1 | buffered | `APIGatewayRestResolver` | `handler(event, context)` |
|
|
1316
|
+
| Lambda Function URL | buffered | `APIGatewayHttpResolver` | `handler(event, context)` |
|
|
1317
|
+
| API Gateway REST API v1 | incremental streaming | `LambdaWebAdapterResolver` | `handler.run()` |
|
|
1318
|
+
| Lambda Function URL | incremental streaming | `LambdaWebAdapterResolver` | `handler.run()` |
|
|
1319
|
+
|
|
1320
|
+
Function URLs use the API Gateway HTTP API payload format version 2.0, which is
|
|
1321
|
+
why `APIGatewayHttpResolver` is the correct buffered resolver for both HTTP API
|
|
1322
|
+
and Function URL invocations. The AWS event shape is not used in streaming:
|
|
1323
|
+
Lambda Web Adapter starts the resolver as an HTTP process and forwards HTTP
|
|
1324
|
+
requests to its listening port.
|
|
1325
|
+
|
|
1326
|
+
Buffered HTTP API example:
|
|
1327
|
+
|
|
1328
|
+
```python
|
|
1329
|
+
from modmex_lambda import APIGatewayHttpResolver
|
|
1330
|
+
|
|
1331
|
+
app = APIGatewayHttpResolver()
|
|
1332
|
+
app.include_mcp(mcp, path="/mcp")
|
|
1333
|
+
handler = app.handler
|
|
1334
|
+
```
|
|
1335
|
+
|
|
1336
|
+
Buffered REST API example:
|
|
1337
|
+
|
|
1338
|
+
```python
|
|
1339
|
+
from modmex_lambda import APIGatewayRestResolver
|
|
1340
|
+
|
|
1341
|
+
app = APIGatewayRestResolver()
|
|
1342
|
+
app.include_mcp(mcp, path="/mcp")
|
|
1343
|
+
handler = app.handler
|
|
1344
|
+
```
|
|
1345
|
+
|
|
1346
|
+
Streaming example:
|
|
1347
|
+
|
|
1348
|
+
```python
|
|
1349
|
+
from modmex_lambda import LambdaWebAdapterResolver
|
|
1350
|
+
|
|
1351
|
+
app = LambdaWebAdapterResolver()
|
|
1352
|
+
app.include_mcp(mcp, path="/mcp")
|
|
1353
|
+
handler = app.handler
|
|
1354
|
+
```
|
|
1355
|
+
|
|
1356
|
+
For the streaming example, the deployment must start the Web Adapter process;
|
|
1357
|
+
the `serverless-python-mcp` plugin generates that launcher automatically.
|
|
1358
|
+
Without the plugin, the application can start the HTTP process explicitly by
|
|
1359
|
+
calling `handler.run()`.
|
|
1360
|
+
|
|
1306
1361
|
### Capabilities
|
|
1307
1362
|
|
|
1308
1363
|
The server supports:
|
|
@@ -1314,7 +1369,12 @@ The server supports:
|
|
|
1314
1369
|
- pagination through the opaque `nextCursor` field;
|
|
1315
1370
|
- `structuredContent` in tool results;
|
|
1316
1371
|
- `resultType`, `ttlMs` and `cacheScope` metadata;
|
|
1317
|
-
- JSON responses and buffered `text/event-stream` responses
|
|
1372
|
+
- JSON responses and buffered `text/event-stream` responses through the API
|
|
1373
|
+
Gateway resolvers;
|
|
1374
|
+
- incremental SSE response streaming through `LambdaWebAdapterResolver`;
|
|
1375
|
+
- async handlers for tools, resources and prompts in the streaming transport;
|
|
1376
|
+
- MCP `notifications/progress` events when the client supplies a
|
|
1377
|
+
`progressToken`.
|
|
1318
1378
|
|
|
1319
1379
|
Resources and prompts are registered explicitly:
|
|
1320
1380
|
|
|
@@ -1346,10 +1406,11 @@ Mcp-Method: tools/call
|
|
|
1346
1406
|
Mcp-Name: create_order
|
|
1347
1407
|
```
|
|
1348
1408
|
|
|
1349
|
-
The server
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
in its own
|
|
1409
|
+
The server implements the stateless `2026-07-28` HTTP contract and does not
|
|
1410
|
+
use `initialize`, `ping` or `Mcp-Session-Id`. Requests are independent and may
|
|
1411
|
+
be routed to any Lambda instance. If the application needs state, it must pass
|
|
1412
|
+
an explicit handle in tool arguments or persist that state in its own
|
|
1413
|
+
services. The runtime does not provide a session store.
|
|
1353
1414
|
|
|
1354
1415
|
### Middleware and authorization
|
|
1355
1416
|
|
|
@@ -1369,7 +1430,97 @@ Origin validation to API Gateway, WAF, or application middleware.
|
|
|
1369
1430
|
|
|
1370
1431
|
### Transport boundary
|
|
1371
1432
|
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1433
|
+
This section applies to `APIGatewayRestResolver` and
|
|
1434
|
+
`APIGatewayHttpResolver`. JSON is the normal response mode, and the MCP HTTP
|
|
1435
|
+
transport can return a buffered SSE representation when the client requests
|
|
1436
|
+
`text/event-stream`. These resolvers do not provide incremental Lambda
|
|
1437
|
+
response streaming or a long-lived bidirectional connection.
|
|
1438
|
+
|
|
1439
|
+
For incremental response streaming, use `LambdaWebAdapterResolver` together
|
|
1440
|
+
with the `serverless-python-mcp` deployment plugin described below. This is a
|
|
1441
|
+
separate host adapter because Lambda Web Adapter owns the HTTP process and the
|
|
1442
|
+
response stream; the MCP server and capabilities remain the same. The
|
|
1443
|
+
streaming transport executes tools, resources and prompts through the async
|
|
1444
|
+
dispatcher, so all three capability types may use `async def` handlers.
|
|
1445
|
+
|
|
1446
|
+
When a tool reports progress, the client must send a `progressToken` in
|
|
1447
|
+
`params._meta`. The server emits standard MCP JSON-RPC progress notifications
|
|
1448
|
+
before the final result. Without a token, progress reports are not emitted to
|
|
1449
|
+
the client.
|
|
1450
|
+
|
|
1451
|
+
Streaming responses include `Cache-Control: no-cache`,
|
|
1452
|
+
`Connection: keep-alive`, and `X-Accel-Buffering: no`. The Lambda Web Adapter
|
|
1453
|
+
and the upstream client still control the lifetime of the connection; this
|
|
1454
|
+
integration does not provide a durable session or bidirectional subscription.
|
|
1455
|
+
Malformed requests and protocol/header validation failures are returned as
|
|
1456
|
+
ordinary JSON error responses, even when the client advertises SSE. Successful
|
|
1457
|
+
streaming responses use SSE framing, with the final JSON-RPC response as the
|
|
1458
|
+
last event.
|
|
1459
|
+
|
|
1460
|
+
MCP request/response features such as pagination, `structuredContent`, MRTR
|
|
1461
|
+
result handling, resources and prompts are part of the protocol implementation
|
|
1462
|
+
and are independent of whether the response is buffered or streamed. Long-
|
|
1463
|
+
lived subscriptions and server-push notification sessions are not provided by
|
|
1464
|
+
these Lambda integrations.
|
|
1465
|
+
|
|
1466
|
+
### Serverless deployment and response streaming
|
|
1467
|
+
|
|
1468
|
+
For Serverless Framework deployments, use the companion npm plugin
|
|
1469
|
+
[`serverless-python-mcp`](https://www.npmjs.com/package/serverless-python-mcp).
|
|
1470
|
+
The plugin synthesizes the Lambda functions and transport resources from
|
|
1471
|
+
`custom.pythonMcp`; the application still owns the resolver and middleware:
|
|
1472
|
+
|
|
1473
|
+
```yaml
|
|
1474
|
+
plugins:
|
|
1475
|
+
- serverless-python-mcp
|
|
1476
|
+
|
|
1477
|
+
custom:
|
|
1478
|
+
pythonMcp:
|
|
1479
|
+
servers:
|
|
1480
|
+
orders:
|
|
1481
|
+
handler: app.handler
|
|
1482
|
+
transport: url # url, http, or httpApi
|
|
1483
|
+
streaming: true
|
|
1484
|
+
path: /mcp # optional; defaults to /mcp
|
|
1485
|
+
```
|
|
1486
|
+
|
|
1487
|
+
The application entrypoint is deliberately the same shape as a regular
|
|
1488
|
+
Serverless Lambda handler:
|
|
1489
|
+
|
|
1490
|
+
```python
|
|
1491
|
+
from modmex_lambda import LambdaWebAdapterResolver
|
|
1492
|
+
|
|
1493
|
+
from server import mcp
|
|
1494
|
+
|
|
1495
|
+
|
|
1496
|
+
app = LambdaWebAdapterResolver()
|
|
1497
|
+
app.include_mcp(mcp, path="/mcp")
|
|
1498
|
+
handler = app.handler
|
|
1499
|
+
```
|
|
1500
|
+
|
|
1501
|
+
The configured value is `module.attribute`, such as `app.handler`. For
|
|
1502
|
+
buffered deployments Serverless invokes `handler(event, context)` directly.
|
|
1503
|
+
For streaming deployments the plugin stages a temporary launcher that imports
|
|
1504
|
+
the configured handler returned by `LambdaWebAdapterResolver.handler` and calls
|
|
1505
|
+
`handler.run()`; the
|
|
1506
|
+
launcher is removed after packaging. Application code never needs an
|
|
1507
|
+
`if __name__ == "__main__"` block or a permanent `run.sh` file.
|
|
1508
|
+
|
|
1509
|
+
Transport mapping:
|
|
1510
|
+
|
|
1511
|
+
- `url`: Lambda Function URL;
|
|
1512
|
+
- `http`: API Gateway REST API (v1);
|
|
1513
|
+
- `httpApi`: API Gateway HTTP API (v2).
|
|
1514
|
+
|
|
1515
|
+
`streaming: true` is supported by `url` and `http`; `httpApi` is buffered-only.
|
|
1516
|
+
With `streaming: false`, all three transports are supported. Function URL
|
|
1517
|
+
authorizers are limited to `aws_iam` or public access. HTTP API authorizers can
|
|
1518
|
+
be declared globally under `provider.httpApi.authorizers` and referenced by
|
|
1519
|
+
name, or declared inline on an individual MCP server using Serverless'
|
|
1520
|
+
compatible authorizer configuration. For `http`, authorizers are passed to the
|
|
1521
|
+
native REST API event compiler.
|
|
1522
|
+
|
|
1523
|
+
The Lambda Web Adapter layer is attached only to streaming MCP functions and
|
|
1524
|
+
is selected by the function architecture (`x86_64` or `arm64`). The plugin
|
|
1525
|
+
uses the regional layer ARN through `AWS::Region`; it does not require a layer
|
|
1526
|
+
entry in the service's global `provider` configuration.
|
|
@@ -1246,9 +1246,10 @@ handler = KinesisSource(registry, concurrency=False).handle
|
|
|
1246
1246
|
|
|
1247
1247
|
## Model Context Protocol (MCP) Server
|
|
1248
1248
|
|
|
1249
|
-
`modmex-lambda`
|
|
1250
|
-
|
|
1251
|
-
|
|
1249
|
+
`modmex-lambda` implements the MCP `2026-07-28` server runtime and adapts it to
|
|
1250
|
+
the existing Lambda HTTP resolvers or to Lambda Web Adapter. MCP is an
|
|
1251
|
+
optional adapter; it reuses the existing dependency injection, middleware and
|
|
1252
|
+
application lifecycle rather than introducing a parallel web framework.
|
|
1252
1253
|
|
|
1253
1254
|
### Basic server
|
|
1254
1255
|
|
|
@@ -1280,6 +1281,60 @@ app.include_mcp(mcp, path="/mcp")
|
|
|
1280
1281
|
handler = app.handler
|
|
1281
1282
|
```
|
|
1282
1283
|
|
|
1284
|
+
### Choosing the resolver
|
|
1285
|
+
|
|
1286
|
+
Choose the resolver from the AWS transport and whether the function must
|
|
1287
|
+
stream the HTTP response:
|
|
1288
|
+
|
|
1289
|
+
| AWS transport | Response mode | Resolver | Entrypoint behavior |
|
|
1290
|
+
|---|---|---|---|
|
|
1291
|
+
| API Gateway HTTP API v2 | buffered | `APIGatewayHttpResolver` | `handler(event, context)` |
|
|
1292
|
+
| API Gateway REST API v1 | buffered | `APIGatewayRestResolver` | `handler(event, context)` |
|
|
1293
|
+
| Lambda Function URL | buffered | `APIGatewayHttpResolver` | `handler(event, context)` |
|
|
1294
|
+
| API Gateway REST API v1 | incremental streaming | `LambdaWebAdapterResolver` | `handler.run()` |
|
|
1295
|
+
| Lambda Function URL | incremental streaming | `LambdaWebAdapterResolver` | `handler.run()` |
|
|
1296
|
+
|
|
1297
|
+
Function URLs use the API Gateway HTTP API payload format version 2.0, which is
|
|
1298
|
+
why `APIGatewayHttpResolver` is the correct buffered resolver for both HTTP API
|
|
1299
|
+
and Function URL invocations. The AWS event shape is not used in streaming:
|
|
1300
|
+
Lambda Web Adapter starts the resolver as an HTTP process and forwards HTTP
|
|
1301
|
+
requests to its listening port.
|
|
1302
|
+
|
|
1303
|
+
Buffered HTTP API example:
|
|
1304
|
+
|
|
1305
|
+
```python
|
|
1306
|
+
from modmex_lambda import APIGatewayHttpResolver
|
|
1307
|
+
|
|
1308
|
+
app = APIGatewayHttpResolver()
|
|
1309
|
+
app.include_mcp(mcp, path="/mcp")
|
|
1310
|
+
handler = app.handler
|
|
1311
|
+
```
|
|
1312
|
+
|
|
1313
|
+
Buffered REST API example:
|
|
1314
|
+
|
|
1315
|
+
```python
|
|
1316
|
+
from modmex_lambda import APIGatewayRestResolver
|
|
1317
|
+
|
|
1318
|
+
app = APIGatewayRestResolver()
|
|
1319
|
+
app.include_mcp(mcp, path="/mcp")
|
|
1320
|
+
handler = app.handler
|
|
1321
|
+
```
|
|
1322
|
+
|
|
1323
|
+
Streaming example:
|
|
1324
|
+
|
|
1325
|
+
```python
|
|
1326
|
+
from modmex_lambda import LambdaWebAdapterResolver
|
|
1327
|
+
|
|
1328
|
+
app = LambdaWebAdapterResolver()
|
|
1329
|
+
app.include_mcp(mcp, path="/mcp")
|
|
1330
|
+
handler = app.handler
|
|
1331
|
+
```
|
|
1332
|
+
|
|
1333
|
+
For the streaming example, the deployment must start the Web Adapter process;
|
|
1334
|
+
the `serverless-python-mcp` plugin generates that launcher automatically.
|
|
1335
|
+
Without the plugin, the application can start the HTTP process explicitly by
|
|
1336
|
+
calling `handler.run()`.
|
|
1337
|
+
|
|
1283
1338
|
### Capabilities
|
|
1284
1339
|
|
|
1285
1340
|
The server supports:
|
|
@@ -1291,7 +1346,12 @@ The server supports:
|
|
|
1291
1346
|
- pagination through the opaque `nextCursor` field;
|
|
1292
1347
|
- `structuredContent` in tool results;
|
|
1293
1348
|
- `resultType`, `ttlMs` and `cacheScope` metadata;
|
|
1294
|
-
- JSON responses and buffered `text/event-stream` responses
|
|
1349
|
+
- JSON responses and buffered `text/event-stream` responses through the API
|
|
1350
|
+
Gateway resolvers;
|
|
1351
|
+
- incremental SSE response streaming through `LambdaWebAdapterResolver`;
|
|
1352
|
+
- async handlers for tools, resources and prompts in the streaming transport;
|
|
1353
|
+
- MCP `notifications/progress` events when the client supplies a
|
|
1354
|
+
`progressToken`.
|
|
1295
1355
|
|
|
1296
1356
|
Resources and prompts are registered explicitly:
|
|
1297
1357
|
|
|
@@ -1323,10 +1383,11 @@ Mcp-Method: tools/call
|
|
|
1323
1383
|
Mcp-Name: create_order
|
|
1324
1384
|
```
|
|
1325
1385
|
|
|
1326
|
-
The server
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
in its own
|
|
1386
|
+
The server implements the stateless `2026-07-28` HTTP contract and does not
|
|
1387
|
+
use `initialize`, `ping` or `Mcp-Session-Id`. Requests are independent and may
|
|
1388
|
+
be routed to any Lambda instance. If the application needs state, it must pass
|
|
1389
|
+
an explicit handle in tool arguments or persist that state in its own
|
|
1390
|
+
services. The runtime does not provide a session store.
|
|
1330
1391
|
|
|
1331
1392
|
### Middleware and authorization
|
|
1332
1393
|
|
|
@@ -1346,7 +1407,97 @@ Origin validation to API Gateway, WAF, or application middleware.
|
|
|
1346
1407
|
|
|
1347
1408
|
### Transport boundary
|
|
1348
1409
|
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1410
|
+
This section applies to `APIGatewayRestResolver` and
|
|
1411
|
+
`APIGatewayHttpResolver`. JSON is the normal response mode, and the MCP HTTP
|
|
1412
|
+
transport can return a buffered SSE representation when the client requests
|
|
1413
|
+
`text/event-stream`. These resolvers do not provide incremental Lambda
|
|
1414
|
+
response streaming or a long-lived bidirectional connection.
|
|
1415
|
+
|
|
1416
|
+
For incremental response streaming, use `LambdaWebAdapterResolver` together
|
|
1417
|
+
with the `serverless-python-mcp` deployment plugin described below. This is a
|
|
1418
|
+
separate host adapter because Lambda Web Adapter owns the HTTP process and the
|
|
1419
|
+
response stream; the MCP server and capabilities remain the same. The
|
|
1420
|
+
streaming transport executes tools, resources and prompts through the async
|
|
1421
|
+
dispatcher, so all three capability types may use `async def` handlers.
|
|
1422
|
+
|
|
1423
|
+
When a tool reports progress, the client must send a `progressToken` in
|
|
1424
|
+
`params._meta`. The server emits standard MCP JSON-RPC progress notifications
|
|
1425
|
+
before the final result. Without a token, progress reports are not emitted to
|
|
1426
|
+
the client.
|
|
1427
|
+
|
|
1428
|
+
Streaming responses include `Cache-Control: no-cache`,
|
|
1429
|
+
`Connection: keep-alive`, and `X-Accel-Buffering: no`. The Lambda Web Adapter
|
|
1430
|
+
and the upstream client still control the lifetime of the connection; this
|
|
1431
|
+
integration does not provide a durable session or bidirectional subscription.
|
|
1432
|
+
Malformed requests and protocol/header validation failures are returned as
|
|
1433
|
+
ordinary JSON error responses, even when the client advertises SSE. Successful
|
|
1434
|
+
streaming responses use SSE framing, with the final JSON-RPC response as the
|
|
1435
|
+
last event.
|
|
1436
|
+
|
|
1437
|
+
MCP request/response features such as pagination, `structuredContent`, MRTR
|
|
1438
|
+
result handling, resources and prompts are part of the protocol implementation
|
|
1439
|
+
and are independent of whether the response is buffered or streamed. Long-
|
|
1440
|
+
lived subscriptions and server-push notification sessions are not provided by
|
|
1441
|
+
these Lambda integrations.
|
|
1442
|
+
|
|
1443
|
+
### Serverless deployment and response streaming
|
|
1444
|
+
|
|
1445
|
+
For Serverless Framework deployments, use the companion npm plugin
|
|
1446
|
+
[`serverless-python-mcp`](https://www.npmjs.com/package/serverless-python-mcp).
|
|
1447
|
+
The plugin synthesizes the Lambda functions and transport resources from
|
|
1448
|
+
`custom.pythonMcp`; the application still owns the resolver and middleware:
|
|
1449
|
+
|
|
1450
|
+
```yaml
|
|
1451
|
+
plugins:
|
|
1452
|
+
- serverless-python-mcp
|
|
1453
|
+
|
|
1454
|
+
custom:
|
|
1455
|
+
pythonMcp:
|
|
1456
|
+
servers:
|
|
1457
|
+
orders:
|
|
1458
|
+
handler: app.handler
|
|
1459
|
+
transport: url # url, http, or httpApi
|
|
1460
|
+
streaming: true
|
|
1461
|
+
path: /mcp # optional; defaults to /mcp
|
|
1462
|
+
```
|
|
1463
|
+
|
|
1464
|
+
The application entrypoint is deliberately the same shape as a regular
|
|
1465
|
+
Serverless Lambda handler:
|
|
1466
|
+
|
|
1467
|
+
```python
|
|
1468
|
+
from modmex_lambda import LambdaWebAdapterResolver
|
|
1469
|
+
|
|
1470
|
+
from server import mcp
|
|
1471
|
+
|
|
1472
|
+
|
|
1473
|
+
app = LambdaWebAdapterResolver()
|
|
1474
|
+
app.include_mcp(mcp, path="/mcp")
|
|
1475
|
+
handler = app.handler
|
|
1476
|
+
```
|
|
1477
|
+
|
|
1478
|
+
The configured value is `module.attribute`, such as `app.handler`. For
|
|
1479
|
+
buffered deployments Serverless invokes `handler(event, context)` directly.
|
|
1480
|
+
For streaming deployments the plugin stages a temporary launcher that imports
|
|
1481
|
+
the configured handler returned by `LambdaWebAdapterResolver.handler` and calls
|
|
1482
|
+
`handler.run()`; the
|
|
1483
|
+
launcher is removed after packaging. Application code never needs an
|
|
1484
|
+
`if __name__ == "__main__"` block or a permanent `run.sh` file.
|
|
1485
|
+
|
|
1486
|
+
Transport mapping:
|
|
1487
|
+
|
|
1488
|
+
- `url`: Lambda Function URL;
|
|
1489
|
+
- `http`: API Gateway REST API (v1);
|
|
1490
|
+
- `httpApi`: API Gateway HTTP API (v2).
|
|
1491
|
+
|
|
1492
|
+
`streaming: true` is supported by `url` and `http`; `httpApi` is buffered-only.
|
|
1493
|
+
With `streaming: false`, all three transports are supported. Function URL
|
|
1494
|
+
authorizers are limited to `aws_iam` or public access. HTTP API authorizers can
|
|
1495
|
+
be declared globally under `provider.httpApi.authorizers` and referenced by
|
|
1496
|
+
name, or declared inline on an individual MCP server using Serverless'
|
|
1497
|
+
compatible authorizer configuration. For `http`, authorizers are passed to the
|
|
1498
|
+
native REST API event compiler.
|
|
1499
|
+
|
|
1500
|
+
The Lambda Web Adapter layer is attached only to streaming MCP functions and
|
|
1501
|
+
is selected by the function architecture (`x86_64` or `arm64`). The plugin
|
|
1502
|
+
uses the regional layer ARN through `AWS::Region`; it does not require a layer
|
|
1503
|
+
entry in the service's global `provider` configuration.
|
|
@@ -19,6 +19,7 @@ __all__ = [
|
|
|
19
19
|
"Tracer",
|
|
20
20
|
"ModmexValidator",
|
|
21
21
|
"ValidationError",
|
|
22
|
+
"LambdaWebAdapterResolver",
|
|
22
23
|
]
|
|
23
24
|
|
|
24
25
|
|
|
@@ -42,6 +43,7 @@ def __getattr__(name):
|
|
|
42
43
|
"Tracer": ("modmex_lambda.tracing", "Tracer"),
|
|
43
44
|
"ModmexValidator": ("modmex_lambda.validation", "ModmexValidator"),
|
|
44
45
|
"ValidationError": ("modmex_lambda.validation", "ValidationError"),
|
|
46
|
+
"LambdaWebAdapterResolver": ("modmex_lambda.mcp.web_adapter", "LambdaWebAdapterResolver"),
|
|
45
47
|
}.get(name)
|
|
46
48
|
if target is None:
|
|
47
49
|
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
@@ -44,7 +44,7 @@ class Logger:
|
|
|
44
44
|
correlation_id_header: str = "x-correlation-id",
|
|
45
45
|
level: str | int | None = None,
|
|
46
46
|
) -> None:
|
|
47
|
-
self._service = service or os.getenv("SERVICE_NAME") or os.getenv("AWS_LAMBDA_FUNCTION_NAME") or "service"
|
|
47
|
+
self._service = service or os.getenv("SERVICE_NAME") or os.getenv("SERVICE") or os.getenv("AWS_LAMBDA_FUNCTION_NAME") or "service"
|
|
48
48
|
self._stream = stream or sys.stdout
|
|
49
49
|
self._serialize = json_serializer or self._serialize_payload
|
|
50
50
|
self._correlation_id_header = correlation_id_header.lower()
|
|
@@ -11,8 +11,9 @@ from modmex_lambda.mcp.server import MCPError, MCPServer
|
|
|
11
11
|
from modmex_lambda.mcp.tool import MCPTool
|
|
12
12
|
from modmex_lambda.mcp.resource import MCPResource
|
|
13
13
|
from modmex_lambda.mcp.prompt import MCPPrompt
|
|
14
|
-
from modmex_lambda.mcp.transport import MCPHttpTransport, SSEEvent, encode_sse, encode_sse_stream, MCP_JSON_CONTENT_TYPE, MCP_SSE_CONTENT_TYPE
|
|
15
|
-
from modmex_lambda.mcp.middleware import MCPContext, MCPMiddleware, MCPNextMiddleware
|
|
14
|
+
from modmex_lambda.mcp.transport import MCPHttpTransport, MCPStreamingHttpTransport, StreamingHTTPResponse, SSEEvent, encode_sse, encode_sse_stream, MCP_JSON_CONTENT_TYPE, MCP_SSE_CONTENT_TYPE
|
|
15
|
+
from modmex_lambda.mcp.middleware import MCPContext, MCPMiddleware, MCPNextMiddleware, MCPProgressReporter, MCPCancellationToken
|
|
16
|
+
from modmex_lambda.mcp.web_adapter import LambdaWebAdapterResolver
|
|
16
17
|
|
|
17
18
|
__all__ = [
|
|
18
19
|
"JSONRPCError",
|
|
@@ -23,6 +24,8 @@ __all__ = [
|
|
|
23
24
|
"MCPServer",
|
|
24
25
|
"MCPError",
|
|
25
26
|
"MCPHttpTransport",
|
|
27
|
+
"MCPStreamingHttpTransport",
|
|
28
|
+
"StreamingHTTPResponse",
|
|
26
29
|
"MCPTool",
|
|
27
30
|
"MCPResource",
|
|
28
31
|
"MCPPrompt",
|
|
@@ -34,4 +37,7 @@ __all__ = [
|
|
|
34
37
|
"MCPContext",
|
|
35
38
|
"MCPMiddleware",
|
|
36
39
|
"MCPNextMiddleware",
|
|
40
|
+
"MCPProgressReporter",
|
|
41
|
+
"MCPCancellationToken",
|
|
42
|
+
"LambdaWebAdapterResolver",
|
|
37
43
|
]
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import inspect
|
|
6
|
+
import threading
|
|
6
7
|
from dataclasses import dataclass, field
|
|
7
8
|
from typing import TYPE_CHECKING, Callable, Protocol, TypeAlias, Union, Any
|
|
8
9
|
|
|
@@ -22,6 +23,35 @@ JSONValue: TypeAlias = Union[
|
|
|
22
23
|
]
|
|
23
24
|
|
|
24
25
|
|
|
26
|
+
@dataclass
|
|
27
|
+
class MCPCancellationToken:
|
|
28
|
+
"""Cooperative cancellation state for a streaming MCP operation."""
|
|
29
|
+
|
|
30
|
+
_event: threading.Event = field(default_factory=threading.Event)
|
|
31
|
+
|
|
32
|
+
@property
|
|
33
|
+
def cancelled(self) -> bool:
|
|
34
|
+
return self._event.is_set()
|
|
35
|
+
|
|
36
|
+
def cancel(self) -> None:
|
|
37
|
+
self._event.set()
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@dataclass
|
|
41
|
+
class MCPProgressReporter:
|
|
42
|
+
"""Cooperative progress publisher available to a running MCP operation."""
|
|
43
|
+
|
|
44
|
+
publish: Callable[[dict[str, JSONValue]], None]
|
|
45
|
+
|
|
46
|
+
def report(self, progress: float, *, total: float | None = None, message: str | None = None) -> None:
|
|
47
|
+
event: dict[str, JSONValue] = {"progress": progress}
|
|
48
|
+
if total is not None:
|
|
49
|
+
event["total"] = total
|
|
50
|
+
if message is not None:
|
|
51
|
+
event["message"] = message
|
|
52
|
+
self.publish(event)
|
|
53
|
+
|
|
54
|
+
|
|
25
55
|
@dataclass
|
|
26
56
|
class MCPContext:
|
|
27
57
|
request: "Request | None"
|
|
@@ -29,8 +59,24 @@ class MCPContext:
|
|
|
29
59
|
capability: str
|
|
30
60
|
name: str
|
|
31
61
|
arguments: dict[str, JSONValue]
|
|
62
|
+
context: dict[str, Any] = field(default_factory=dict)
|
|
32
63
|
state: dict[str, object] = field(default_factory=dict)
|
|
33
64
|
|
|
65
|
+
def __post_init__(self) -> None:
|
|
66
|
+
request_context = getattr(self.request, "context", None)
|
|
67
|
+
if isinstance(request_context, dict):
|
|
68
|
+
self.context = request_context
|
|
69
|
+
|
|
70
|
+
@property
|
|
71
|
+
def progress(self) -> MCPProgressReporter | None:
|
|
72
|
+
value = self.state.get("progress_reporter")
|
|
73
|
+
return value if isinstance(value, MCPProgressReporter) else None
|
|
74
|
+
|
|
75
|
+
@property
|
|
76
|
+
def cancelled(self) -> bool:
|
|
77
|
+
value = self.state.get("cancellation_token")
|
|
78
|
+
return isinstance(value, MCPCancellationToken) and value.cancelled
|
|
79
|
+
|
|
34
80
|
|
|
35
81
|
class MCPNextMiddleware(Protocol):
|
|
36
82
|
def __call__(self, context: MCPContext) -> object: ...
|
|
@@ -17,7 +17,7 @@ from modmex_lambda.mcp.registry import MCPPromptRegistry, MCPResourceRegistry
|
|
|
17
17
|
from modmex_lambda.mcp.prompt import MCPPrompt
|
|
18
18
|
from modmex_lambda.mcp.resource import MCPResource
|
|
19
19
|
from modmex_lambda.mcp.tool import MCPTool
|
|
20
|
-
from modmex_lambda.mcp.middleware import MCPContext, MCPMiddleware
|
|
20
|
+
from modmex_lambda.mcp.middleware import MCPContext, MCPMiddleware, MCPProgressReporter, MCPCancellationToken
|
|
21
21
|
|
|
22
22
|
from modmex_lambda.mcp.protocol import MCP_PROTOCOL_VERSION
|
|
23
23
|
|
|
@@ -314,7 +314,7 @@ class MCPServer:
|
|
|
314
314
|
arguments = params.get("arguments", {})
|
|
315
315
|
if not isinstance(arguments, dict):
|
|
316
316
|
raise ValueError("tools/call 'arguments' must be an object")
|
|
317
|
-
output = tool.invoke(arguments, request=context, middlewares=self.middlewares, middleware_context=
|
|
317
|
+
output = tool.invoke(arguments, request=context, middlewares=self.middlewares, middleware_context=self._tool_context(context, name, arguments))
|
|
318
318
|
return _tool_result(output)
|
|
319
319
|
|
|
320
320
|
def _resources_list(self, params: dict[str, Any], *, context: Any = None) -> dict[str, Any]:
|
|
@@ -361,7 +361,7 @@ class MCPServer:
|
|
|
361
361
|
arguments = params.get("arguments", {})
|
|
362
362
|
if not isinstance(arguments, dict):
|
|
363
363
|
raise ValueError("tools/call 'arguments' must be an object")
|
|
364
|
-
output = await tool.ainvoke(arguments, request=context, middlewares=self.middlewares, middleware_context=
|
|
364
|
+
output = await tool.ainvoke(arguments, request=context, middlewares=self.middlewares, middleware_context=self._tool_context(context, name, arguments))
|
|
365
365
|
return _tool_result(output)
|
|
366
366
|
|
|
367
367
|
async def _resources_read_async(self, params: dict[str, Any], *, context: Any = None) -> dict[str, Any]:
|
|
@@ -386,6 +386,16 @@ class MCPServer:
|
|
|
386
386
|
raise ValueError("prompts/get 'arguments' must be an object")
|
|
387
387
|
return {"resultType": "complete", **await prompt.aget(arguments, context=context, server=self, middlewares=self.middlewares), "ttlMs": 300000, "cacheScope": "private"}
|
|
388
388
|
|
|
389
|
+
def _tool_context(self, request: Any, name: str, arguments: dict[str, Any]) -> MCPContext:
|
|
390
|
+
state: dict[str, object] = {}
|
|
391
|
+
reporter = getattr(request, "progress_reporter", None)
|
|
392
|
+
if isinstance(reporter, MCPProgressReporter):
|
|
393
|
+
state["progress_reporter"] = reporter
|
|
394
|
+
token = getattr(request, "cancellation_token", None)
|
|
395
|
+
if isinstance(token, MCPCancellationToken):
|
|
396
|
+
state["cancellation_token"] = token
|
|
397
|
+
return MCPContext(request=request, server=self, capability="tools", name=name, arguments=arguments, state=state)
|
|
398
|
+
|
|
389
399
|
|
|
390
400
|
def _json_text(value: Any) -> str:
|
|
391
401
|
if isinstance(value, str):
|
|
@@ -91,9 +91,11 @@ class MCPTool:
|
|
|
91
91
|
dependency_overrides=dependency_overrides,
|
|
92
92
|
dependency_resolver=dependency_resolver,
|
|
93
93
|
)
|
|
94
|
-
|
|
94
|
+
if "request" in parameters and "request" not in values:
|
|
95
|
+
values["request"] = request
|
|
96
|
+
for name in ("context", "ctx"):
|
|
95
97
|
if name in parameters and name not in values:
|
|
96
|
-
values[name] =
|
|
98
|
+
values[name] = ctx
|
|
97
99
|
values.update(arguments)
|
|
98
100
|
return self.handler(**values)
|
|
99
101
|
|
|
@@ -120,9 +122,11 @@ class MCPTool:
|
|
|
120
122
|
|
|
121
123
|
def endpoint(ctx: MCPContext) -> Any:
|
|
122
124
|
values = solve_dependencies(dependant=self.dependant, request=request, dependency_overrides=kwargs.get("dependency_overrides"), dependency_resolver=kwargs.get("dependency_resolver"))
|
|
123
|
-
|
|
125
|
+
if "request" in parameters and "request" not in values:
|
|
126
|
+
values["request"] = request
|
|
127
|
+
for name in ("context", "ctx"):
|
|
124
128
|
if name in parameters and name not in values:
|
|
125
|
-
values[name] =
|
|
129
|
+
values[name] = ctx
|
|
126
130
|
values.update(arguments)
|
|
127
131
|
return self.handler(**values)
|
|
128
132
|
|