Skip to content

Commit e0dd33e

Browse files
committed
Rename the module to mcp-server-in-aws-lambda
1 parent 7b43188 commit e0dd33e

File tree

15 files changed

+53
-30
lines changed

15 files changed

+53
-30
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

DEVELOP.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ cdk bootstrap aws://<aws account id>/us-east-2
3939

4040
### Build the Python module
4141

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

4444
```bash
4545
cd src/python/
@@ -57,7 +57,7 @@ uv run pytest
5757

5858
### Build the Typescript package
5959

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

6262
```bash
6363
cd src/typescript/
@@ -90,7 +90,7 @@ cd examples/servers/weather-alerts/
9090

9191
npm install
9292

93-
npm link mcp-lambda
93+
npm link mcp-server-in-aws-lambda
9494

9595
npm run build
9696

@@ -118,7 +118,7 @@ cd examples/chatbots/typescript/
118118

119119
npm install
120120

121-
npm link mcp-lambda
121+
npm link mcp-server-in-aws-lambda
122122

123123
npm run build
124124

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/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

examples/chatbots/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

examples/chatbots/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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
mcp-server-time
22

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

0 commit comments

Comments
 (0)