Skip to main content
Glama

TypeScript MCP Server Template

by dhinojosac
helloPlugin.ts1.06 kB
import { FastifyPluginAsync } from 'fastify'; // Type for route parameters type HelloParams = { name: string; }; /** * Fastify plugin that provides a simple hello endpoint * Returns a greeting message for the provided name parameter */ const helloPlugin: FastifyPluginAsync = async fastify => { // Register the GET /hello/:name route fastify.get<{ Params: HelloParams }>( '/hello/:name', { schema: { params: { type: 'object', properties: { name: { type: 'string', minLength: 1, }, }, required: ['name'], }, response: { 200: { type: 'object', properties: { greeting: { type: 'string' }, }, required: ['greeting'], }, }, }, }, async request => { const { name } = request.params; // Return greeting response return { greeting: `Hi, ${name}!`, }; } ); }; export default helloPlugin;

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dhinojosac/calendar-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server