Skip to content

chore(deps): update boto3 requirement from <1.37.24,>=1.36.20 to >=1.36.20,<1.37.26 in /e2e_tests/python #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/cdk-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ jobs:
- name: Install CDK CLI
run: npm install -g aws-cdk

- name: Build and link mcp-lambda package
- name: Build and link mcp-server-in-aws-lambda package
run: npm ci && npm run build && npm link
working-directory: ./src/typescript

- name: Install dependencies
run: npm ci && npm link mcp-lambda
run: npm ci && npm link mcp-server-in-aws-lambda
working-directory: ./examples/servers/weather-alerts

- name: Build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/typescript-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ jobs:
with:
node-version: 20

- name: Build and link mcp-lambda package
- name: Build and link mcp-server-in-aws-lambda package
run: npm ci && npm run build && npm link
working-directory: ./src/typescript

- name: Install dependencies
run: npm ci && npm link mcp-lambda
run: npm ci && npm link mcp-server-in-aws-lambda
working-directory: ./examples/chatbots/typescript

- name: Build
Expand Down
8 changes: 4 additions & 4 deletions DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ cdk bootstrap aws://<aws account id>/us-east-2

### Build the Python module

Install the mcp-lambda Python module from source:
Install the mcp-server-in-aws-lambda Python module from source:

```bash
cd src/python/
Expand All @@ -57,7 +57,7 @@ uv run pytest

### Build the Typescript package

Build the mcp-lambda Typescript module:
Build the mcp-server-in-aws-lambda Typescript module:

```bash
cd src/typescript/
Expand Down Expand Up @@ -90,7 +90,7 @@ cd examples/servers/weather-alerts/

npm install

npm link mcp-lambda
npm link mcp-server-in-aws-lambda

npm run build

Expand Down Expand Up @@ -118,7 +118,7 @@ cd examples/chatbots/typescript/

npm install

npm link mcp-lambda
npm link mcp-server-in-aws-lambda

npm run build

Expand Down
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ flowchart LR
- This package currently supports MCP servers and clients written in Python and Typescript.
Other languages such as Kotlin are not supported.
- The server adapters only adapt stdio MCP servers, not servers written for other protocols such as SSE.
- The server adapters does not maintain any MCP server state across Lambda function invocations.
- The server adapters do not maintain any MCP server state across Lambda function invocations.
Only stateless MCP servers are a good fit for using this adapter. For example, MCP servers
that invoke stateless tools like the [time MCP server](https://github.com/modelcontextprotocol/servers/tree/main/src/time)
or make stateless web requests like the [fetch MCP server](https://github.com/modelcontextprotocol/servers/tree/main/src/fetch).
Expand Down Expand Up @@ -124,14 +124,16 @@ It will:

```typescript
import { Handler, Context } from "aws-lambda";
import { stdioServerAdapter } from "mcp-lambda";

const serverParams = {
command: "npx",
args: ["--offline", "openapi-mcp-server", "./weather-alerts-openapi.json"],
};

export const handler: Handler = async (event, context: Context) => {
// Dynamically import ES module into CommonJS Lambda function
const { stdioServerAdapter } = await import("mcp-server-in-aws-lambda");

return await stdioServerAdapter(serverParams, event, context);
};
```
Expand Down Expand Up @@ -170,15 +172,28 @@ with the MCP protocol and returns the function's response to the caller.
import {
LambdaFunctionParameters,
LambdaFunctionClientTransport,
} from "mcp-lambda";
} from "mcp-server-in-aws-lambda";
import { Client } from "@modelcontextprotocol/sdk/client/index.js";

const serverParams: LambdaFunctionParameters = {
functionName: "mcp-server-time",
regionName: "us-east-2",
};

const client = new Client(
{
name: "my-client",
version: "0.0.1",
},
{
capabilities: {
sampling: {},
},
}
);

const transport = new LambdaFunctionClientTransport(serverParams);
await this.client.connect(transport);
await client.connect(transport);
```

### Deploy and run the examples
Expand Down
7 changes: 4 additions & 3 deletions e2e_tests/python/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
boto3>=1.36.20,<1.37.24
boto3>=1.36.20,<1.37.26
mcp>=1.6.0
uvicorn>=0.32.1

# For testing, this module is installed from local files
# mcp-lambda
# For testing, this module is installed from local files.
# Uncomment this line to build using the module from PyPi
# mcp-server-in-aws-lambda >= 0.0.1
4 changes: 2 additions & 2 deletions e2e_tests/run_integ_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ npm link

cd ../../examples/servers/weather-alerts/
npm ci
npm link mcp-lambda
npm link mcp-server-in-aws-lambda
npm run build
cdk deploy --app 'node lib/weather-alerts-mcp-server.js'

Expand All @@ -42,6 +42,6 @@ python main.py
# Run the Typescript integ test
cd ../typescript/
npm ci
npm link mcp-lambda
npm link mcp-server-in-aws-lambda
npm run build
npm test
2 changes: 1 addition & 1 deletion e2e_tests/typescript/src/server_clients/lambda_function.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
LambdaFunctionParameters,
LambdaFunctionClientTransport,
} from "mcp-lambda";
} from "mcp-server-in-aws-lambda";
import { Server } from "./server.js";
import logger from "../logger.js";

Expand Down
5 changes: 3 additions & 2 deletions examples/chatbots/python/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ boto3>=1.36.20,<1.37.24
mcp>=1.6.0
uvicorn>=0.32.1

# For testing, this module is installed from local files
# mcp-lambda
# For testing, this module is installed from local files.
# Uncomment this line to build using the module from PyPi
# mcp-server-in-aws-lambda >= 0.0.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
LambdaFunctionParameters,
LambdaFunctionClientTransport,
} from "mcp-lambda";
} from "mcp-server-in-aws-lambda";
import { Server } from "./server.js";
import logger from "../logger.js";

Expand Down
5 changes: 3 additions & 2 deletions examples/servers/time/function/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
mcp-server-time

# For testing, this module is installed from local files
# mcp-lambda
# For testing, this module is installed from local files.
# Uncomment this line to build using the module from PyPi
# mcp-server-in-aws-lambda >= 0.0.1
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const serverParams = {
};

export const handler: Handler = async (event, context: Context) => {
const { stdioServerAdapter } = await import("mcp-lambda");
// Dynamically import ES module into CommonJS Lambda function
const { stdioServerAdapter } = await import("mcp-server-in-aws-lambda");

return await stdioServerAdapter(serverParams, event, context);
};
11 changes: 7 additions & 4 deletions examples/servers/weather-alerts/lib/weather-alerts-mcp-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export class WeatherAlertsMcpServer extends cdk.Stack {
) {
super(scope, id, props);

// Package local module as a layer for testing
// For testing, the mcp-server-in-aws-lambda package is bundled from local files.
// Remove this layer if using the mcp-server-in-aws-lambda package from npm.
const mcpLambdaLayer = new LayerVersion(this, "McpLambdaLayer", {
code: Code.fromAsset(path.join(__dirname, "../../../../src/typescript"), {
bundling: {
Expand All @@ -24,8 +25,8 @@ export class WeatherAlertsMcpServer extends cdk.Stack {
"bash",
"-c",
[
"mkdir -p /asset-output/nodejs/node_modules/mcp-lambda",
`cp -r /asset-input/* /asset-output/nodejs/node_modules/mcp-lambda/`,
"mkdir -p /asset-output/nodejs/node_modules/mcp-server-in-aws-lambda",
`cp -r /asset-input/* /asset-output/nodejs/node_modules/mcp-server-in-aws-lambda/`,
].join(" && "),
],
},
Expand All @@ -52,7 +53,9 @@ export class WeatherAlertsMcpServer extends cdk.Stack {
layers: [mcpLambdaLayer],
bundling: {
nodeModules: ["openapi-mcp-server"],
externalModules: ["mcp-lambda"],
// For testing, the mcp-server-in-aws-lambda package is bundled from local files using the Lambda layer above.
// Remove the layer and this externalModules configuration if using the mcp-server-in-aws-lambda package from npm.
externalModules: ["mcp-server-in-aws-lambda"],
commandHooks: {
beforeBundling(inputDir: string, outputDir: string): string[] {
return [];
Expand Down
2 changes: 1 addition & 1 deletion src/python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
name = "mcp-lambda"
name = "mcp-server-in-aws-lambda"
dynamic = ["version"]
description = "Model Context Protocol SDK for AWS Lambda"
requires-python = ">=3.11"
Expand Down
2 changes: 1 addition & 1 deletion src/python/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "mcp-lambda",
"name": "mcp-server-in-aws-lambda",
"description": "Model Context Protocol SDK for AWS Lambda",
"version": "0.0.2",
"type": "module",
Expand Down