Skip to content

Commit 6f91fd0

Browse files
committed
API仕様変更に伴うサンプルの修正
1 parent eb68aad commit 6f91fd0

1 file changed

Lines changed: 18 additions & 16 deletions

File tree

example/lambda/index.ts

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,25 @@ import { createHonoApp } from 'aws-lambda-mcp-server';
66

77
const logger = new Logger();
88

9-
const server = new McpServer({
10-
name: 'hello-server',
11-
version: '1.0.0',
12-
});
13-
14-
server.tool(
15-
'say_hello',
16-
{ who: z.string() },
17-
async ({ who }) => ({
18-
content: [{
19-
type: 'text',
20-
text: `${who} さん、こんにちは!`,
21-
}],
22-
}),
23-
);
9+
const createMcpServer = () => {
10+
const server = new McpServer({
11+
name: 'hello-server',
12+
version: '1.0.0',
13+
});
2414

25-
const app = createHonoApp(server);
15+
server.tool(
16+
'say_hello',
17+
{ who: z.string() },
18+
async ({ who }) => ({
19+
content: [{
20+
type: 'text',
21+
text: `${who} さん、こんにちは!`,
22+
}],
23+
}),
24+
);
25+
return server;
26+
};
27+
const app = createHonoApp(createMcpServer);
2628

2729
// Lambda handler
2830
export const handler = handle(app);

0 commit comments

Comments
 (0)