SSE サポート付きの AWS Lambda 関数用の MCP (Model Context Protocol) サーバー インフラストラクチャを提供する Node.js パッケージ。
import { MCPHandlerFactory } from '@markvp/mcp-lambda-layer';
import { z } from 'zod';
// Create MCP handler factory with your configuration
const factory = new MCPHandlerFactory({
tools: {
summarize: {
params: {
text: z.string(),
},
handler: async ({ text }) => {
// Your implementation here - could be any service/model/API
const summary = await yourSummarizeImplementation(text);
return {
content: [{ type: 'text', text: summary }],
};
},
},
},
prompts: {
generate: {
description: 'Generate content based on a prompt',
handler: async extra => {
// Your implementation here - could be any service/model/API
const result = await yourGenerateImplementation(extra.prompt);
return {
content: [{ type: 'text', text: result }],
};
},
},
},
});
// Export the handler directly
export const handler = factory.getHandler();