File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -151,6 +151,29 @@ session = ClientSession(read, write)
151151await 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
156179First, install the [ AWS CDK CLI] ( https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html#getting_started_install ) .
You can’t perform that action at this time.
0 commit comments