Skip to content

Commit 5c19ff8

Browse files
committed
Documentation for TS client example
1 parent febc6af commit 5c19ff8

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,29 @@ session = ClientSession(read, write)
151151
await session.initialize()
152152
```
153153

154+
### Typescript client example
155+
156+
This project includes an
157+
[example Typescript MCP client](examples/chatbots/typescript/src/server_clients/lambda_function.ts)
158+
that invokes the 'time' MCP server function from above.
159+
The client invokes a Lambda function named "mcp-server-time" with a payload that is compliant
160+
with the MCP protocol and returns the function's response to the caller.
161+
162+
```typescript
163+
import {
164+
LambdaFunctionParameters,
165+
LambdaFunctionClientTransport,
166+
} from "mcp-lambda";
167+
168+
const serverParams: LambdaFunctionParameters = {
169+
functionName: "mcp-server-time",
170+
regionName: "us-east-2",
171+
};
172+
173+
const transport = new LambdaFunctionClientTransport(serverParams);
174+
await this.client.connect(transport);
175+
```
176+
154177
### Deploy and run the examples
155178

156179
First, install the [AWS CDK CLI](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html#getting_started_install).

0 commit comments

Comments
 (0)