Skip to content

Commit b9f4b0b

Browse files
committed
feat!: Rename the module to mcp-server-in-aws-lambda
1 parent 7b43188 commit b9f4b0b

File tree

18 files changed

+191
-33
lines changed

18 files changed

+191
-33
lines changed

.github/workflows/cdk-checks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ jobs:
4747
- name: Install CDK CLI
4848
run: npm install -g aws-cdk
4949

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

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

5858
- name: Build

.github/workflows/typescript-checks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ jobs:
4242
with:
4343
node-version: 20
4444

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

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

5353
- name: Build

.pre-commit-config.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
default_install_hook_types:
2+
- pre-commit
3+
- commit-msg
4+
5+
repos:
6+
- repo: https://github.com/compilerla/conventional-pre-commit
7+
rev: v4.0.0
8+
hooks:
9+
- id: conventional-pre-commit
10+
stages: [commit-msg]
11+
args: []

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
44

5-
## [0.0.2](https://github.com/awslabs/utilities-for-model-context-protocol-with-aws-lambda/compare/v0.0.1...v0.0.2) (2025-04-01)
5+
## [0.0.2](https://github.com/awslabs/run-model-context-protocol-servers-in-aws-lambda/compare/v0.0.1...v0.0.2) (2025-04-01)

DEVELOP.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# Development guide
2+
3+
## Local tools
4+
5+
Install pre-commit hooks to ensure that your commits follow conventional commit guidelines:
6+
7+
```
8+
pip install pre-commit
9+
pre-commit install
10+
```
11+
112
## Deploy and run the examples
213

314
This guide will walk you through building the source code in this repository,
@@ -39,7 +50,7 @@ cdk bootstrap aws://<aws account id>/us-east-2
3950

4051
### Build the Python module
4152

42-
Install the mcp-lambda Python module from source:
53+
Install the mcp-server-in-aws-lambda Python module from source:
4354

4455
```bash
4556
cd src/python/
@@ -57,7 +68,7 @@ uv run pytest
5768

5869
### Build the Typescript package
5970

60-
Build the mcp-lambda Typescript module:
71+
Build the mcp-server-in-aws-lambda Typescript module:
6172

6273
```bash
6374
cd src/typescript/
@@ -90,7 +101,7 @@ cd examples/servers/weather-alerts/
90101

91102
npm install
92103

93-
npm link mcp-lambda
104+
npm link mcp-server-in-aws-lambda
94105

95106
npm run build
96107

@@ -118,7 +129,7 @@ cd examples/chatbots/typescript/
118129

119130
npm install
120131

121-
npm link mcp-lambda
132+
npm link mcp-server-in-aws-lambda
122133

123134
npm run build
124135

README.md

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

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

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

134133
export const handler: Handler = async (event, context: Context) => {
134+
// Dynamically import ES module into CommonJS Lambda function
135+
const { stdioServerAdapter } = await import("mcp-server-in-aws-lambda");
136+
135137
return await stdioServerAdapter(serverParams, event, context);
136138
};
137139
```
@@ -170,15 +172,28 @@ with the MCP protocol and returns the function's response to the caller.
170172
import {
171173
LambdaFunctionParameters,
172174
LambdaFunctionClientTransport,
173-
} from "mcp-lambda";
175+
} from "mcp-server-in-aws-lambda";
176+
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
174177

175178
const serverParams: LambdaFunctionParameters = {
176179
functionName: "mcp-server-time",
177180
regionName: "us-east-2",
178181
};
179182

183+
const client = new Client(
184+
{
185+
name: "my-client",
186+
version: "0.0.1",
187+
},
188+
{
189+
capabilities: {
190+
sampling: {},
191+
},
192+
}
193+
);
194+
180195
const transport = new LambdaFunctionClientTransport(serverParams);
181-
await this.client.connect(transport);
196+
await client.connect(transport);
182197
```
183198

184199
### Deploy and run the examples

e2e_tests/python/requirements.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ boto3>=1.36.20,<1.37.24
22
mcp>=1.6.0
33
uvicorn>=0.32.1
44

5-
# For testing, this module is installed from local files
6-
# mcp-lambda
5+
# For testing, this module is installed from local files.
6+
# Uncomment this line to build using the module from PyPi
7+
# mcp-server-in-aws-lambda >= 0.0.1

e2e_tests/run_integ_test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ npm link
2525

2626
cd ../../examples/servers/weather-alerts/
2727
npm ci
28-
npm link mcp-lambda
28+
npm link mcp-server-in-aws-lambda
2929
npm run build
3030
cdk deploy --app 'node lib/weather-alerts-mcp-server.js'
3131

@@ -42,6 +42,6 @@ python main.py
4242
# Run the Typescript integ test
4343
cd ../typescript/
4444
npm ci
45-
npm link mcp-lambda
45+
npm link mcp-server-in-aws-lambda
4646
npm run build
4747
npm test

e2e_tests/setup/setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ To set up an AWS account for running integration tests on GitHub:
44
aws cloudformation deploy \
55
--template-file integ-test-authentication.yaml \
66
--stack-name github-integ-test-identity-provider \
7-
--parameter-overrides GitHubOrg=awslabs RepositoryName=utilities-for-model-context-protocol-with-aws-lambda \
7+
--parameter-overrides GitHubOrg=awslabs RepositoryName=run-model-context-protocol-servers-in-aws-lambda \
88
--capabilities CAPABILITY_NAMED_IAM \
99
--region us-east-2
1010

e2e_tests/typescript/src/server_clients/lambda_function.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
LambdaFunctionParameters,
33
LambdaFunctionClientTransport,
4-
} from "mcp-lambda";
4+
} from "mcp-server-in-aws-lambda";
55
import { Server } from "./server.js";
66
import logger from "../logger.js";
77

0 commit comments

Comments
 (0)