modmex-lambda 0.7.2__tar.gz → 0.8.0__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.2 → modmex_lambda-0.8.0}/PKG-INFO +129 -15
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/README.md +128 -14
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/connectors/dynamodb.py +42 -1
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/event_handler/api_gateway.py +21 -4
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/mcp/__init__.py +11 -1
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/mcp/transport.py +55 -19
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/runner.py +23 -5
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/sources/base.py +3 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/sources/dynamodb.py +4 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/sources/kinesis.py +4 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/sources/s3.py +4 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/sources/sns.py +4 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/sources/sqs.py +4 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/pyproject.toml +1 -1
- modmex_lambda-0.8.0/tests/connectors/test_dynamodb_regressions.py +52 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/event_handler/test_api_gateway.py +24 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/mcp/helpers.py +1 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/mcp/test_http.py +129 -2
- modmex_lambda-0.8.0/tests/mcp/test_include_mcp_origins.py +29 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/test_runner.py +55 -8
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/.github/workflows/ci.yml +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/.github/workflows/release.yml +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/.gitignore +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/LICENSE +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/__init__.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/connectors/__init__.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/connectors/cloudwatch.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/connectors/eventbridge.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/connectors/eventbridge_scheduler.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/connectors/icloudwatch.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/connectors/idynamodb.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/connectors/ieventbridge.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/connectors/ieventbridge_scheduler.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/connectors/ilambda.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/connectors/is3.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/connectors/isns.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/connectors/isqs.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/connectors/lambda_.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/connectors/module.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/connectors/s3.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/connectors/sns.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/connectors/sqs.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/data_classes/__init__.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/data_classes/api_gateway_authorizer_event.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/data_classes/api_gateway_proxy_event.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/data_classes/api_gateway_websocket_event.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/data_classes/cognito_user_pool_event.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/data_classes/common.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/dependencies.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/event_handler/__init__.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/event_handler/constants.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/event_handler/content_types.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/event_handler/cors.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/event_handler/dependencies/__init__.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/event_handler/dependencies/compat.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/event_handler/dependencies/dependant.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/event_handler/dependencies/dependency_middleware.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/event_handler/dependencies/depends.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/event_handler/dependencies/params.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/event_handler/dependencies/types.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/event_handler/exception_handler.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/event_handler/exceptions.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/event_handler/gateway_response.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/event_handler/middlewares.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/event_handler/params.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/event_handler/request.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/event_handler/response.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/event_handler/routing.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/event_handler/routing_fallbacks.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/event_handler/types.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/event_sources.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/exceptions.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/logging.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/mcp/middleware.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/mcp/prompt.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/mcp/protocol.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/mcp/registry.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/mcp/resource.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/mcp/schema.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/mcp/server.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/mcp/tool.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/mcp/web_adapter.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/mcp/web_adapter_launcher.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/params.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/parser.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/persistence/__init__.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/persistence/dynamodb/__init__.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/persistence/dynamodb/expressions.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/persistence/dynamodb/keys.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/persistence/dynamodb/materialized_views.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/persistence/dynamodb/stream_fields.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/py.typed +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/request.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/resolver.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/response.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/routing.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/shared/__init__.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/shared/cookies.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/shared/headers_serializer.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/shared/json_encoder.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/shared/types.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/__init__.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/events/__init__.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/events/dynamodb.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/events/kinesis.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/events/s3.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/events/sns.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/events/sqs.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/filters/__init__.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/filters/content.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/filters/event_type.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/filters/latch.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/filters/skip.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/flavors/__init__.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/flavors/base_flavor.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/flavors/cdc.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/flavors/collect.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/flavors/correlate.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/flavors/evaluate.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/flavors/expired.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/flavors/iflavor.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/flavors/job.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/flavors/materialize.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/flavors/s3.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/flavors/schedule.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/flavors/sns.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/flavors/task.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/flavors/update.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/irules_registry.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/operators/__init__.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/operators/cloudwatch.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/operators/dynamodb.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/operators/ioperator.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/operators/lambda_.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/operators/publisher.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/operators/s3.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/operators/scheduler.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/operators/sns.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/operators/sqs.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/rules_registry.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/schedulers.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/sources/__init__.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/utils/__init__.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/utils/apigateway.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/utils/aws.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/utils/batch.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/utils/cloudwatch.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/utils/concurrency.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/utils/contracts.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/utils/data_classes/__init__.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/utils/data_classes/dynamodb.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/utils/decorators.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/utils/dynamodb.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/utils/eventbridge.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/utils/faults.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/utils/filters.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/utils/json_encoder.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/utils/lambda_.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/utils/operators.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/utils/pluralize.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/utils/print.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/utils/retry.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/utils/s3.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/utils/sns.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/utils/split.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/utils/sqs.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/utils/tags.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/utils/time.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/stream/utils/uow.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/tracing.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/modmex_lambda/validation.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/poetry.lock +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/__init__.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/conftest.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/connectors/__init__.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/connectors/conftest.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/connectors/test_cloudwatch.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/connectors/test_dynamodb.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/connectors/test_lazy_clients.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/connectors/test_s3.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/connectors/test_simple_connectors.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/connectors/test_sns.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/connectors/test_sqs.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/data_classes/__init__.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/data_classes/test_api_gateway_proxy_event.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/data_classes/test_cognito_user_pool_event.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/data_classes/test_common.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/event_handler/__init__.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/event_handler/test_cors.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/event_handler/test_dependencies.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/event_handler/test_exception_handler.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/event_handler/test_gateway_response.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/event_handler/test_request.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/event_handler/test_response.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/event_handler/test_routing.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/mcp/__init__.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/mcp/test_middleware.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/mcp/test_resources_prompts.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/mcp/test_server.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/mcp/test_tools.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/mcp/test_transport.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/persistence/__init__.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/persistence/test_dynamodb_expressions.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/persistence/test_dynamodb_keys.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/persistence/test_dynamodb_materialized_views.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/persistence/test_dynamodb_stream_fields.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/shared/__init__.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/shared/test_cookies_headers.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/shared/test_json_encoder.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/__init__.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/conftest.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/events/__init__.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/events/test_dynamodb.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/events/test_kinesis.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/events/test_s3.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/events/test_sns.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/events/test_sqs.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/filters/__init__.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/filters/test_content.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/filters/test_event_type.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/filters/test_latch.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/filters/test_skip.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/flavors/__init__.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/flavors/source_events.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/flavors/test_base_flavor.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/flavors/test_cdc.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/flavors/test_collect.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/flavors/test_correlate.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/flavors/test_evaluate.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/flavors/test_expired.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/flavors/test_job.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/flavors/test_materialize.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/flavors/test_s3.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/flavors/test_schedule.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/flavors/test_sns.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/flavors/test_task.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/flavors/test_update.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/operators/test_scheduler.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/test_dependency_resolver.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/test_faults.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/test_rules_registry.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/test_runner_pipeline.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/test_sources.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/utils/__init__.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/utils/faults.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/utils/test_apigateway.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/utils/test_aws.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/utils/test_batch.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/utils/test_cloudwatch.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/utils/test_concurrency.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/utils/test_decorators.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/utils/test_dynamodb.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/utils/test_eventbridge.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/utils/test_filters.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/utils/test_json_encoder.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/utils/test_lambda.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/utils/test_operators.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/utils/test_pluralize.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/utils/test_print.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/utils/test_retry.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/utils/test_s3.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/utils/test_sns.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/utils/test_split.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/utils/test_sqs.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/utils/test_tags.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/utils/test_time.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/stream/utils/test_uow.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/test_lazy_imports.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/test_logging.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/test_parser_event_sources.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/test_reexports.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/test_tracing.py +0 -0
- {modmex_lambda-0.7.2 → modmex_lambda-0.8.0}/tests/test_validation.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: modmex-lambda
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.0
|
|
4
4
|
Summary: Ultra-lightweight AWS Lambda utilities for API Gateway routing and event handling.
|
|
5
5
|
Author: Modmex
|
|
6
6
|
License: MIT
|
|
@@ -474,6 +474,19 @@ def on_domain_error(exc: DomainError):
|
|
|
474
474
|
If a custom exception handler raises, the resolver falls back to the default
|
|
475
475
|
error response when one exists.
|
|
476
476
|
|
|
477
|
+
An exception with no handler is re-raised: the invocation fails, so Lambda's
|
|
478
|
+
`Errors` metric and alarms see it, and API Gateway answers with a generic 5xx.
|
|
479
|
+
That response carries no CORS headers, so a browser reports a CORS error instead
|
|
480
|
+
of the 500. If browsers call the API, register a catch-all handler, which gets
|
|
481
|
+
the route's CORS headers, and log the exception so it stays visible:
|
|
482
|
+
|
|
483
|
+
```python
|
|
484
|
+
@app.exception_handler(Exception)
|
|
485
|
+
def on_unexpected(exc: Exception):
|
|
486
|
+
logger.exception("Unhandled error")
|
|
487
|
+
return Response(status_code=500, body={"message": "Internal server error"})
|
|
488
|
+
```
|
|
489
|
+
|
|
477
490
|
## CORS
|
|
478
491
|
|
|
479
492
|
Pass `CORSConfig` to the resolver to add CORS headers and automatic preflight
|
|
@@ -865,6 +878,23 @@ handler = KinesisSource(
|
|
|
865
878
|
|
|
866
879
|
Use `concurrency=False` in tests when deterministic order matters.
|
|
867
880
|
|
|
881
|
+
Handled failures (steps wrapped with `faulty`) are published as `fault` events and
|
|
882
|
+
do not fail the invocation. An **unexpected** error that stops a pipeline (a bug,
|
|
883
|
+
an unwrapped step) is re-raised after every pipeline finished and pending faults
|
|
884
|
+
were flushed, so the Lambda invocation fails and AWS retries the batch: records
|
|
885
|
+
after the failure were never processed and must not be acknowledged. `on_error`
|
|
886
|
+
is still called first. Pass `raise_on_error=False` to a source (or `run`) only if
|
|
887
|
+
you deliberately want such errors reported through `on_error` alone.
|
|
888
|
+
|
|
889
|
+
Because a failing batch is retried, bound the retries on the event source so a
|
|
890
|
+
record that always fails (a poison pill) cannot block the stream:
|
|
891
|
+
|
|
892
|
+
- DynamoDB Streams / Kinesis: set `MaximumRetryAttempts`,
|
|
893
|
+
`BisectBatchOnFunctionError: true` (isolates the failing record) and an
|
|
894
|
+
on-failure destination (SQS/SNS) on the event source mapping. Otherwise the
|
|
895
|
+
shard retries until the record expires (24 h by default).
|
|
896
|
+
- SQS: configure a dead-letter queue (`maxReceiveCount` in the redrive policy).
|
|
897
|
+
|
|
868
898
|
### Publisher Options
|
|
869
899
|
|
|
870
900
|
Flavors that publish to EventBridge use a shared publisher. Configure it with
|
|
@@ -1269,9 +1299,10 @@ handler = KinesisSource(registry, concurrency=False).handle
|
|
|
1269
1299
|
|
|
1270
1300
|
## Model Context Protocol (MCP) Server
|
|
1271
1301
|
|
|
1272
|
-
`modmex-lambda`
|
|
1273
|
-
|
|
1274
|
-
|
|
1302
|
+
`modmex-lambda` implements the MCP `2026-07-28` server runtime and adapts it to
|
|
1303
|
+
the existing Lambda HTTP resolvers or to Lambda Web Adapter. MCP is an
|
|
1304
|
+
optional adapter; it reuses the existing dependency injection, middleware and
|
|
1305
|
+
application lifecycle rather than introducing a parallel web framework.
|
|
1275
1306
|
|
|
1276
1307
|
### Basic server
|
|
1277
1308
|
|
|
@@ -1303,6 +1334,65 @@ app.include_mcp(mcp, path="/mcp")
|
|
|
1303
1334
|
handler = app.handler
|
|
1304
1335
|
```
|
|
1305
1336
|
|
|
1337
|
+
Pass `allowed_origins=["https://app.example.com"]` to `include_mcp` to reject
|
|
1338
|
+
requests whose `Origin` header is not in the list (403). MCP asks servers to
|
|
1339
|
+
validate `Origin` against DNS-rebinding attacks; the default `None` leaves it to
|
|
1340
|
+
the infrastructure in front of the function, and `[]` denies every browser origin.
|
|
1341
|
+
|
|
1342
|
+
### Choosing the resolver
|
|
1343
|
+
|
|
1344
|
+
Choose the resolver from the AWS transport and whether the function must
|
|
1345
|
+
stream the HTTP response:
|
|
1346
|
+
|
|
1347
|
+
| AWS transport | Response mode | Resolver | Entrypoint behavior |
|
|
1348
|
+
|---|---|---|---|
|
|
1349
|
+
| API Gateway HTTP API v2 | buffered | `APIGatewayHttpResolver` | `handler(event, context)` |
|
|
1350
|
+
| API Gateway REST API v1 | buffered | `APIGatewayRestResolver` | `handler(event, context)` |
|
|
1351
|
+
| Lambda Function URL | buffered | `APIGatewayHttpResolver` | `handler(event, context)` |
|
|
1352
|
+
| API Gateway REST API v1 | incremental streaming | `LambdaWebAdapterResolver` | `handler.run()` |
|
|
1353
|
+
| Lambda Function URL | incremental streaming | `LambdaWebAdapterResolver` | `handler.run()` |
|
|
1354
|
+
|
|
1355
|
+
Function URLs use the API Gateway HTTP API payload format version 2.0, which is
|
|
1356
|
+
why `APIGatewayHttpResolver` is the correct buffered resolver for both HTTP API
|
|
1357
|
+
and Function URL invocations. The AWS event shape is not used in streaming:
|
|
1358
|
+
Lambda Web Adapter starts the resolver as an HTTP process and forwards HTTP
|
|
1359
|
+
requests to its listening port.
|
|
1360
|
+
|
|
1361
|
+
Buffered HTTP API example:
|
|
1362
|
+
|
|
1363
|
+
```python
|
|
1364
|
+
from modmex_lambda import APIGatewayHttpResolver
|
|
1365
|
+
|
|
1366
|
+
app = APIGatewayHttpResolver()
|
|
1367
|
+
app.include_mcp(mcp, path="/mcp")
|
|
1368
|
+
handler = app.handler
|
|
1369
|
+
```
|
|
1370
|
+
|
|
1371
|
+
Buffered REST API example:
|
|
1372
|
+
|
|
1373
|
+
```python
|
|
1374
|
+
from modmex_lambda import APIGatewayRestResolver
|
|
1375
|
+
|
|
1376
|
+
app = APIGatewayRestResolver()
|
|
1377
|
+
app.include_mcp(mcp, path="/mcp")
|
|
1378
|
+
handler = app.handler
|
|
1379
|
+
```
|
|
1380
|
+
|
|
1381
|
+
Streaming example:
|
|
1382
|
+
|
|
1383
|
+
```python
|
|
1384
|
+
from modmex_lambda import LambdaWebAdapterResolver
|
|
1385
|
+
|
|
1386
|
+
app = LambdaWebAdapterResolver()
|
|
1387
|
+
app.include_mcp(mcp, path="/mcp")
|
|
1388
|
+
handler = app.handler
|
|
1389
|
+
```
|
|
1390
|
+
|
|
1391
|
+
For the streaming example, the deployment must start the Web Adapter process;
|
|
1392
|
+
the `serverless-python-mcp` plugin generates that launcher automatically.
|
|
1393
|
+
Without the plugin, the application can start the HTTP process explicitly by
|
|
1394
|
+
calling `handler.run()`.
|
|
1395
|
+
|
|
1306
1396
|
### Capabilities
|
|
1307
1397
|
|
|
1308
1398
|
The server supports:
|
|
@@ -1314,7 +1404,12 @@ The server supports:
|
|
|
1314
1404
|
- pagination through the opaque `nextCursor` field;
|
|
1315
1405
|
- `structuredContent` in tool results;
|
|
1316
1406
|
- `resultType`, `ttlMs` and `cacheScope` metadata;
|
|
1317
|
-
- JSON responses and buffered `text/event-stream` responses
|
|
1407
|
+
- JSON responses and buffered `text/event-stream` responses through the API
|
|
1408
|
+
Gateway resolvers;
|
|
1409
|
+
- incremental SSE response streaming through `LambdaWebAdapterResolver`;
|
|
1410
|
+
- async handlers for tools, resources and prompts in the streaming transport;
|
|
1411
|
+
- MCP `notifications/progress` events when the client supplies a
|
|
1412
|
+
`progressToken`.
|
|
1318
1413
|
|
|
1319
1414
|
Resources and prompts are registered explicitly:
|
|
1320
1415
|
|
|
@@ -1346,10 +1441,11 @@ Mcp-Method: tools/call
|
|
|
1346
1441
|
Mcp-Name: create_order
|
|
1347
1442
|
```
|
|
1348
1443
|
|
|
1349
|
-
The server
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
in its own
|
|
1444
|
+
The server implements the stateless `2026-07-28` HTTP contract and does not
|
|
1445
|
+
use `initialize`, `ping` or `Mcp-Session-Id`. Requests are independent and may
|
|
1446
|
+
be routed to any Lambda instance. If the application needs state, it must pass
|
|
1447
|
+
an explicit handle in tool arguments or persist that state in its own
|
|
1448
|
+
services. The runtime does not provide a session store.
|
|
1353
1449
|
|
|
1354
1450
|
### Middleware and authorization
|
|
1355
1451
|
|
|
@@ -1367,7 +1463,7 @@ def create_order(order: Order):
|
|
|
1367
1463
|
enforce an Origin allowlist itself. Leaving it as `None` explicitly delegates
|
|
1368
1464
|
Origin validation to API Gateway, WAF, or application middleware.
|
|
1369
1465
|
|
|
1370
|
-
###
|
|
1466
|
+
### Transport boundary
|
|
1371
1467
|
|
|
1372
1468
|
This section applies to `APIGatewayRestResolver` and
|
|
1373
1469
|
`APIGatewayHttpResolver`. JSON is the normal response mode, and the MCP HTTP
|
|
@@ -1376,9 +1472,25 @@ transport can return a buffered SSE representation when the client requests
|
|
|
1376
1472
|
response streaming or a long-lived bidirectional connection.
|
|
1377
1473
|
|
|
1378
1474
|
For incremental response streaming, use `LambdaWebAdapterResolver` together
|
|
1379
|
-
with the `serverless-python-mcp` deployment plugin described below.
|
|
1380
|
-
separate
|
|
1381
|
-
the
|
|
1475
|
+
with the `serverless-python-mcp` deployment plugin described below. This is a
|
|
1476
|
+
separate host adapter because Lambda Web Adapter owns the HTTP process and the
|
|
1477
|
+
response stream; the MCP server and capabilities remain the same. The
|
|
1478
|
+
streaming transport executes tools, resources and prompts through the async
|
|
1479
|
+
dispatcher, so all three capability types may use `async def` handlers.
|
|
1480
|
+
|
|
1481
|
+
When a tool reports progress, the client must send a `progressToken` in
|
|
1482
|
+
`params._meta`. The server emits standard MCP JSON-RPC progress notifications
|
|
1483
|
+
before the final result. Without a token, progress reports are not emitted to
|
|
1484
|
+
the client.
|
|
1485
|
+
|
|
1486
|
+
Streaming responses include `Cache-Control: no-cache`,
|
|
1487
|
+
`Connection: keep-alive`, and `X-Accel-Buffering: no`. The Lambda Web Adapter
|
|
1488
|
+
and the upstream client still control the lifetime of the connection; this
|
|
1489
|
+
integration does not provide a durable session or bidirectional subscription.
|
|
1490
|
+
Malformed requests and protocol/header validation failures are returned as
|
|
1491
|
+
ordinary JSON error responses, even when the client advertises SSE. Successful
|
|
1492
|
+
streaming responses use SSE framing, with the final JSON-RPC response as the
|
|
1493
|
+
last event.
|
|
1382
1494
|
|
|
1383
1495
|
MCP request/response features such as pagination, `structuredContent`, MRTR
|
|
1384
1496
|
result handling, resources and prompts are part of the protocol implementation
|
|
@@ -1424,7 +1536,8 @@ handler = app.handler
|
|
|
1424
1536
|
The configured value is `module.attribute`, such as `app.handler`. For
|
|
1425
1537
|
buffered deployments Serverless invokes `handler(event, context)` directly.
|
|
1426
1538
|
For streaming deployments the plugin stages a temporary launcher that imports
|
|
1427
|
-
the configured `
|
|
1539
|
+
the configured handler returned by `LambdaWebAdapterResolver.handler` and calls
|
|
1540
|
+
`handler.run()`; the
|
|
1428
1541
|
launcher is removed after packaging. Application code never needs an
|
|
1429
1542
|
`if __name__ == "__main__"` block or a permanent `run.sh` file.
|
|
1430
1543
|
|
|
@@ -1439,7 +1552,8 @@ With `streaming: false`, all three transports are supported. Function URL
|
|
|
1439
1552
|
authorizers are limited to `aws_iam` or public access. HTTP API authorizers can
|
|
1440
1553
|
be declared globally under `provider.httpApi.authorizers` and referenced by
|
|
1441
1554
|
name, or declared inline on an individual MCP server using Serverless'
|
|
1442
|
-
compatible authorizer configuration.
|
|
1555
|
+
compatible authorizer configuration. For `http`, authorizers are passed to the
|
|
1556
|
+
native REST API event compiler.
|
|
1443
1557
|
|
|
1444
1558
|
The Lambda Web Adapter layer is attached only to streaming MCP functions and
|
|
1445
1559
|
is selected by the function architecture (`x86_64` or `arm64`). The plugin
|
|
@@ -451,6 +451,19 @@ def on_domain_error(exc: DomainError):
|
|
|
451
451
|
If a custom exception handler raises, the resolver falls back to the default
|
|
452
452
|
error response when one exists.
|
|
453
453
|
|
|
454
|
+
An exception with no handler is re-raised: the invocation fails, so Lambda's
|
|
455
|
+
`Errors` metric and alarms see it, and API Gateway answers with a generic 5xx.
|
|
456
|
+
That response carries no CORS headers, so a browser reports a CORS error instead
|
|
457
|
+
of the 500. If browsers call the API, register a catch-all handler, which gets
|
|
458
|
+
the route's CORS headers, and log the exception so it stays visible:
|
|
459
|
+
|
|
460
|
+
```python
|
|
461
|
+
@app.exception_handler(Exception)
|
|
462
|
+
def on_unexpected(exc: Exception):
|
|
463
|
+
logger.exception("Unhandled error")
|
|
464
|
+
return Response(status_code=500, body={"message": "Internal server error"})
|
|
465
|
+
```
|
|
466
|
+
|
|
454
467
|
## CORS
|
|
455
468
|
|
|
456
469
|
Pass `CORSConfig` to the resolver to add CORS headers and automatic preflight
|
|
@@ -842,6 +855,23 @@ handler = KinesisSource(
|
|
|
842
855
|
|
|
843
856
|
Use `concurrency=False` in tests when deterministic order matters.
|
|
844
857
|
|
|
858
|
+
Handled failures (steps wrapped with `faulty`) are published as `fault` events and
|
|
859
|
+
do not fail the invocation. An **unexpected** error that stops a pipeline (a bug,
|
|
860
|
+
an unwrapped step) is re-raised after every pipeline finished and pending faults
|
|
861
|
+
were flushed, so the Lambda invocation fails and AWS retries the batch: records
|
|
862
|
+
after the failure were never processed and must not be acknowledged. `on_error`
|
|
863
|
+
is still called first. Pass `raise_on_error=False` to a source (or `run`) only if
|
|
864
|
+
you deliberately want such errors reported through `on_error` alone.
|
|
865
|
+
|
|
866
|
+
Because a failing batch is retried, bound the retries on the event source so a
|
|
867
|
+
record that always fails (a poison pill) cannot block the stream:
|
|
868
|
+
|
|
869
|
+
- DynamoDB Streams / Kinesis: set `MaximumRetryAttempts`,
|
|
870
|
+
`BisectBatchOnFunctionError: true` (isolates the failing record) and an
|
|
871
|
+
on-failure destination (SQS/SNS) on the event source mapping. Otherwise the
|
|
872
|
+
shard retries until the record expires (24 h by default).
|
|
873
|
+
- SQS: configure a dead-letter queue (`maxReceiveCount` in the redrive policy).
|
|
874
|
+
|
|
845
875
|
### Publisher Options
|
|
846
876
|
|
|
847
877
|
Flavors that publish to EventBridge use a shared publisher. Configure it with
|
|
@@ -1246,9 +1276,10 @@ handler = KinesisSource(registry, concurrency=False).handle
|
|
|
1246
1276
|
|
|
1247
1277
|
## Model Context Protocol (MCP) Server
|
|
1248
1278
|
|
|
1249
|
-
`modmex-lambda`
|
|
1250
|
-
|
|
1251
|
-
|
|
1279
|
+
`modmex-lambda` implements the MCP `2026-07-28` server runtime and adapts it to
|
|
1280
|
+
the existing Lambda HTTP resolvers or to Lambda Web Adapter. MCP is an
|
|
1281
|
+
optional adapter; it reuses the existing dependency injection, middleware and
|
|
1282
|
+
application lifecycle rather than introducing a parallel web framework.
|
|
1252
1283
|
|
|
1253
1284
|
### Basic server
|
|
1254
1285
|
|
|
@@ -1280,6 +1311,65 @@ app.include_mcp(mcp, path="/mcp")
|
|
|
1280
1311
|
handler = app.handler
|
|
1281
1312
|
```
|
|
1282
1313
|
|
|
1314
|
+
Pass `allowed_origins=["https://app.example.com"]` to `include_mcp` to reject
|
|
1315
|
+
requests whose `Origin` header is not in the list (403). MCP asks servers to
|
|
1316
|
+
validate `Origin` against DNS-rebinding attacks; the default `None` leaves it to
|
|
1317
|
+
the infrastructure in front of the function, and `[]` denies every browser origin.
|
|
1318
|
+
|
|
1319
|
+
### Choosing the resolver
|
|
1320
|
+
|
|
1321
|
+
Choose the resolver from the AWS transport and whether the function must
|
|
1322
|
+
stream the HTTP response:
|
|
1323
|
+
|
|
1324
|
+
| AWS transport | Response mode | Resolver | Entrypoint behavior |
|
|
1325
|
+
|---|---|---|---|
|
|
1326
|
+
| API Gateway HTTP API v2 | buffered | `APIGatewayHttpResolver` | `handler(event, context)` |
|
|
1327
|
+
| API Gateway REST API v1 | buffered | `APIGatewayRestResolver` | `handler(event, context)` |
|
|
1328
|
+
| Lambda Function URL | buffered | `APIGatewayHttpResolver` | `handler(event, context)` |
|
|
1329
|
+
| API Gateway REST API v1 | incremental streaming | `LambdaWebAdapterResolver` | `handler.run()` |
|
|
1330
|
+
| Lambda Function URL | incremental streaming | `LambdaWebAdapterResolver` | `handler.run()` |
|
|
1331
|
+
|
|
1332
|
+
Function URLs use the API Gateway HTTP API payload format version 2.0, which is
|
|
1333
|
+
why `APIGatewayHttpResolver` is the correct buffered resolver for both HTTP API
|
|
1334
|
+
and Function URL invocations. The AWS event shape is not used in streaming:
|
|
1335
|
+
Lambda Web Adapter starts the resolver as an HTTP process and forwards HTTP
|
|
1336
|
+
requests to its listening port.
|
|
1337
|
+
|
|
1338
|
+
Buffered HTTP API example:
|
|
1339
|
+
|
|
1340
|
+
```python
|
|
1341
|
+
from modmex_lambda import APIGatewayHttpResolver
|
|
1342
|
+
|
|
1343
|
+
app = APIGatewayHttpResolver()
|
|
1344
|
+
app.include_mcp(mcp, path="/mcp")
|
|
1345
|
+
handler = app.handler
|
|
1346
|
+
```
|
|
1347
|
+
|
|
1348
|
+
Buffered REST API example:
|
|
1349
|
+
|
|
1350
|
+
```python
|
|
1351
|
+
from modmex_lambda import APIGatewayRestResolver
|
|
1352
|
+
|
|
1353
|
+
app = APIGatewayRestResolver()
|
|
1354
|
+
app.include_mcp(mcp, path="/mcp")
|
|
1355
|
+
handler = app.handler
|
|
1356
|
+
```
|
|
1357
|
+
|
|
1358
|
+
Streaming example:
|
|
1359
|
+
|
|
1360
|
+
```python
|
|
1361
|
+
from modmex_lambda import LambdaWebAdapterResolver
|
|
1362
|
+
|
|
1363
|
+
app = LambdaWebAdapterResolver()
|
|
1364
|
+
app.include_mcp(mcp, path="/mcp")
|
|
1365
|
+
handler = app.handler
|
|
1366
|
+
```
|
|
1367
|
+
|
|
1368
|
+
For the streaming example, the deployment must start the Web Adapter process;
|
|
1369
|
+
the `serverless-python-mcp` plugin generates that launcher automatically.
|
|
1370
|
+
Without the plugin, the application can start the HTTP process explicitly by
|
|
1371
|
+
calling `handler.run()`.
|
|
1372
|
+
|
|
1283
1373
|
### Capabilities
|
|
1284
1374
|
|
|
1285
1375
|
The server supports:
|
|
@@ -1291,7 +1381,12 @@ The server supports:
|
|
|
1291
1381
|
- pagination through the opaque `nextCursor` field;
|
|
1292
1382
|
- `structuredContent` in tool results;
|
|
1293
1383
|
- `resultType`, `ttlMs` and `cacheScope` metadata;
|
|
1294
|
-
- JSON responses and buffered `text/event-stream` responses
|
|
1384
|
+
- JSON responses and buffered `text/event-stream` responses through the API
|
|
1385
|
+
Gateway resolvers;
|
|
1386
|
+
- incremental SSE response streaming through `LambdaWebAdapterResolver`;
|
|
1387
|
+
- async handlers for tools, resources and prompts in the streaming transport;
|
|
1388
|
+
- MCP `notifications/progress` events when the client supplies a
|
|
1389
|
+
`progressToken`.
|
|
1295
1390
|
|
|
1296
1391
|
Resources and prompts are registered explicitly:
|
|
1297
1392
|
|
|
@@ -1323,10 +1418,11 @@ Mcp-Method: tools/call
|
|
|
1323
1418
|
Mcp-Name: create_order
|
|
1324
1419
|
```
|
|
1325
1420
|
|
|
1326
|
-
The server
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
in its own
|
|
1421
|
+
The server implements the stateless `2026-07-28` HTTP contract and does not
|
|
1422
|
+
use `initialize`, `ping` or `Mcp-Session-Id`. Requests are independent and may
|
|
1423
|
+
be routed to any Lambda instance. If the application needs state, it must pass
|
|
1424
|
+
an explicit handle in tool arguments or persist that state in its own
|
|
1425
|
+
services. The runtime does not provide a session store.
|
|
1330
1426
|
|
|
1331
1427
|
### Middleware and authorization
|
|
1332
1428
|
|
|
@@ -1344,7 +1440,7 @@ def create_order(order: Order):
|
|
|
1344
1440
|
enforce an Origin allowlist itself. Leaving it as `None` explicitly delegates
|
|
1345
1441
|
Origin validation to API Gateway, WAF, or application middleware.
|
|
1346
1442
|
|
|
1347
|
-
###
|
|
1443
|
+
### Transport boundary
|
|
1348
1444
|
|
|
1349
1445
|
This section applies to `APIGatewayRestResolver` and
|
|
1350
1446
|
`APIGatewayHttpResolver`. JSON is the normal response mode, and the MCP HTTP
|
|
@@ -1353,9 +1449,25 @@ transport can return a buffered SSE representation when the client requests
|
|
|
1353
1449
|
response streaming or a long-lived bidirectional connection.
|
|
1354
1450
|
|
|
1355
1451
|
For incremental response streaming, use `LambdaWebAdapterResolver` together
|
|
1356
|
-
with the `serverless-python-mcp` deployment plugin described below.
|
|
1357
|
-
separate
|
|
1358
|
-
the
|
|
1452
|
+
with the `serverless-python-mcp` deployment plugin described below. This is a
|
|
1453
|
+
separate host adapter because Lambda Web Adapter owns the HTTP process and the
|
|
1454
|
+
response stream; the MCP server and capabilities remain the same. The
|
|
1455
|
+
streaming transport executes tools, resources and prompts through the async
|
|
1456
|
+
dispatcher, so all three capability types may use `async def` handlers.
|
|
1457
|
+
|
|
1458
|
+
When a tool reports progress, the client must send a `progressToken` in
|
|
1459
|
+
`params._meta`. The server emits standard MCP JSON-RPC progress notifications
|
|
1460
|
+
before the final result. Without a token, progress reports are not emitted to
|
|
1461
|
+
the client.
|
|
1462
|
+
|
|
1463
|
+
Streaming responses include `Cache-Control: no-cache`,
|
|
1464
|
+
`Connection: keep-alive`, and `X-Accel-Buffering: no`. The Lambda Web Adapter
|
|
1465
|
+
and the upstream client still control the lifetime of the connection; this
|
|
1466
|
+
integration does not provide a durable session or bidirectional subscription.
|
|
1467
|
+
Malformed requests and protocol/header validation failures are returned as
|
|
1468
|
+
ordinary JSON error responses, even when the client advertises SSE. Successful
|
|
1469
|
+
streaming responses use SSE framing, with the final JSON-RPC response as the
|
|
1470
|
+
last event.
|
|
1359
1471
|
|
|
1360
1472
|
MCP request/response features such as pagination, `structuredContent`, MRTR
|
|
1361
1473
|
result handling, resources and prompts are part of the protocol implementation
|
|
@@ -1401,7 +1513,8 @@ handler = app.handler
|
|
|
1401
1513
|
The configured value is `module.attribute`, such as `app.handler`. For
|
|
1402
1514
|
buffered deployments Serverless invokes `handler(event, context)` directly.
|
|
1403
1515
|
For streaming deployments the plugin stages a temporary launcher that imports
|
|
1404
|
-
the configured `
|
|
1516
|
+
the configured handler returned by `LambdaWebAdapterResolver.handler` and calls
|
|
1517
|
+
`handler.run()`; the
|
|
1405
1518
|
launcher is removed after packaging. Application code never needs an
|
|
1406
1519
|
`if __name__ == "__main__"` block or a permanent `run.sh` file.
|
|
1407
1520
|
|
|
@@ -1416,7 +1529,8 @@ With `streaming: false`, all three transports are supported. Function URL
|
|
|
1416
1529
|
authorizers are limited to `aws_iam` or public access. HTTP API authorizers can
|
|
1417
1530
|
be declared globally under `provider.httpApi.authorizers` and referenced by
|
|
1418
1531
|
name, or declared inline on an individual MCP server using Serverless'
|
|
1419
|
-
compatible authorizer configuration.
|
|
1532
|
+
compatible authorizer configuration. For `http`, authorizers are passed to the
|
|
1533
|
+
native REST API event compiler.
|
|
1420
1534
|
|
|
1421
1535
|
The Lambda Web Adapter layer is attached only to streaming MCP functions and
|
|
1422
1536
|
is selected by the function architecture (`x86_64` or `arm64`). The plugin
|
|
@@ -68,6 +68,10 @@ class Connector(IDynamodbConnector):
|
|
|
68
68
|
return self._unmarshall_response(response)
|
|
69
69
|
|
|
70
70
|
def query_all(self, input_params):
|
|
71
|
+
# Paginate on a copy: callers often reuse a module-level params dict
|
|
72
|
+
# across warm invocations, and a leftover ExclusiveStartKey would make
|
|
73
|
+
# the next call silently start from the last page.
|
|
74
|
+
input_params = dict(input_params)
|
|
71
75
|
items = []
|
|
72
76
|
while True:
|
|
73
77
|
result = self.query(input_params)
|
|
@@ -79,7 +83,19 @@ class Connector(IDynamodbConnector):
|
|
|
79
83
|
return items
|
|
80
84
|
|
|
81
85
|
def batch_get(self, input_params):
|
|
82
|
-
|
|
86
|
+
chunks = _batch_get_chunks(input_params)
|
|
87
|
+
if len(chunks) == 1:
|
|
88
|
+
return self._batch_get(chunks[0], [])
|
|
89
|
+
results = [self._batch_get(chunk, []) for chunk in chunks]
|
|
90
|
+
responses: dict = {}
|
|
91
|
+
for result in results:
|
|
92
|
+
for table, items in result.get('Responses', {}).items():
|
|
93
|
+
responses.setdefault(table, []).extend(items)
|
|
94
|
+
return {
|
|
95
|
+
**results[-1],
|
|
96
|
+
'Responses': responses,
|
|
97
|
+
'attempts': [attempt for result in results for attempt in result.get('attempts', [])],
|
|
98
|
+
}
|
|
83
99
|
|
|
84
100
|
def _batch_get(self, params, attempts):
|
|
85
101
|
assert_max_retries(attempts, self.retry_config['max_retries'])
|
|
@@ -255,6 +271,31 @@ class Connector(IDynamodbConnector):
|
|
|
255
271
|
}
|
|
256
272
|
|
|
257
273
|
|
|
274
|
+
BATCH_GET_MAX_KEYS = 100 # DynamoDB BatchGetItem limit, across all tables
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
def _batch_get_chunks(params):
|
|
278
|
+
"""Split a BatchGetItem request into requests of at most 100 keys in total."""
|
|
279
|
+
pairs = [
|
|
280
|
+
(table, key)
|
|
281
|
+
for table, request in params.get('RequestItems', {}).items()
|
|
282
|
+
for key in request.get('Keys', [])
|
|
283
|
+
]
|
|
284
|
+
if len(pairs) <= BATCH_GET_MAX_KEYS:
|
|
285
|
+
return [params]
|
|
286
|
+
chunks = []
|
|
287
|
+
for start in range(0, len(pairs), BATCH_GET_MAX_KEYS):
|
|
288
|
+
request_items = {}
|
|
289
|
+
for table, key in pairs[start:start + BATCH_GET_MAX_KEYS]:
|
|
290
|
+
table_request = request_items.setdefault(
|
|
291
|
+
table,
|
|
292
|
+
{**params['RequestItems'][table], 'Keys': []},
|
|
293
|
+
)
|
|
294
|
+
table_request['Keys'].append(key)
|
|
295
|
+
chunks.append({**params, 'RequestItems': request_items})
|
|
296
|
+
return chunks
|
|
297
|
+
|
|
298
|
+
|
|
258
299
|
def unprocessed(params, resp):
|
|
259
300
|
return {
|
|
260
301
|
**params,
|
|
@@ -171,15 +171,27 @@ class ApiGatewayResolver(BaseRouter, IApiGatewayResolver):
|
|
|
171
171
|
def include_router(self, router: Router, prefix: str = "") -> None:
|
|
172
172
|
self._router.include_router(router, prefix=prefix)
|
|
173
173
|
|
|
174
|
-
def include_mcp(
|
|
175
|
-
|
|
174
|
+
def include_mcp(
|
|
175
|
+
self,
|
|
176
|
+
server: Any,
|
|
177
|
+
*,
|
|
178
|
+
path: str = "/mcp",
|
|
179
|
+
allowed_origins: list[str] | None = None,
|
|
180
|
+
) -> None:
|
|
181
|
+
"""Mount a transport-neutral MCP server as a normal HTTP route.
|
|
182
|
+
|
|
183
|
+
``allowed_origins`` is an allowlist for the ``Origin`` header (MCP asks
|
|
184
|
+
servers to validate it against DNS-rebinding attacks); ``None`` leaves the
|
|
185
|
+
policy to the infrastructure in front of the function, ``[]`` denies every
|
|
186
|
+
browser origin.
|
|
187
|
+
"""
|
|
176
188
|
from modmex_lambda.mcp import MCPServer
|
|
177
189
|
from modmex_lambda.mcp.transport import MCPHttpTransport
|
|
178
190
|
|
|
179
191
|
if not isinstance(server, MCPServer):
|
|
180
192
|
raise TypeError("include_mcp expects an MCPServer")
|
|
181
193
|
|
|
182
|
-
transport = MCPHttpTransport(server)
|
|
194
|
+
transport = MCPHttpTransport(server, allowed_origins=allowed_origins)
|
|
183
195
|
|
|
184
196
|
@self.route(path, method="POST", status_code=200)
|
|
185
197
|
def mcp_handler(request: Request) -> Response:
|
|
@@ -252,7 +264,12 @@ class ApiGatewayResolver(BaseRouter, IApiGatewayResolver):
|
|
|
252
264
|
return path[len(prefix) :]
|
|
253
265
|
|
|
254
266
|
if isinstance(prefix, Pattern):
|
|
255
|
-
path
|
|
267
|
+
# A prefix only strips the start of the path. re.sub removed every
|
|
268
|
+
# match, so "/v\d+" turned "/v1/users/7/v2/x" into "/users/7/x"
|
|
269
|
+
# and routed the request to a different handler.
|
|
270
|
+
match = prefix.match(path)
|
|
271
|
+
if match is not None and match.end() > 0:
|
|
272
|
+
path = path[match.end():]
|
|
256
273
|
|
|
257
274
|
if not path:
|
|
258
275
|
return "/"
|
|
@@ -13,7 +13,6 @@ from modmex_lambda.mcp.resource import MCPResource
|
|
|
13
13
|
from modmex_lambda.mcp.prompt import MCPPrompt
|
|
14
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
15
|
from modmex_lambda.mcp.middleware import MCPContext, MCPMiddleware, MCPNextMiddleware, MCPProgressReporter, MCPCancellationToken
|
|
16
|
-
from modmex_lambda.mcp.web_adapter import LambdaWebAdapterResolver
|
|
17
16
|
|
|
18
17
|
__all__ = [
|
|
19
18
|
"JSONRPCError",
|
|
@@ -41,3 +40,14 @@ __all__ = [
|
|
|
41
40
|
"MCPCancellationToken",
|
|
42
41
|
"LambdaWebAdapterResolver",
|
|
43
42
|
]
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def __getattr__(name):
|
|
46
|
+
# LambdaWebAdapterResolver pulls in http.server and is only needed with the
|
|
47
|
+
# Lambda Web Adapter; load it on first access, not with every MCP import.
|
|
48
|
+
if name == "LambdaWebAdapterResolver":
|
|
49
|
+
from modmex_lambda.mcp.web_adapter import LambdaWebAdapterResolver
|
|
50
|
+
|
|
51
|
+
globals()[name] = LambdaWebAdapterResolver
|
|
52
|
+
return LambdaWebAdapterResolver
|
|
53
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|