Files
mcp-prueba/index.js
josedario87 01067c009f
All checks were successful
build-and-push / build (push) Successful in 15s
build-and-push / deploy (push) Successful in 1s
se supone que ya
2025-05-02 22:08:38 -06:00

20 lines
487 B
JavaScript

import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
import { z } from 'zod';
const server = new McpServer({
name: 'mi-mcp-server',
version: '1.0.0'
});
server.tool(
'saludar',
{ nombre: z.string() },
async ({ nombre }) => ({
content: [{ type: 'text', text: `Hola, ${nombre}! 👋` }]
})
);
const transport = new StdioServerTransport();
await server.connect(transport);