Skip to main content
Glama
chrisleekr

MCP Server Boilerplate

by chrisleekr
notification.ts1.37 kB
import { Server } from '@modelcontextprotocol/sdk/server/index.js'; import { loggingContext, ProgressToken } from '@/core/server'; export interface ProgressNotificationParams { progressToken: ProgressToken; progress: number; total: number; message: string; } /** * Send a progress notification to the server * * BUT it seems not working as expected. Just leave it here for now. * @param server - The server instance * @param params - The progress notification parameters */ export async function sendProgressNotification( server: Server, params: ProgressNotificationParams ): Promise<void> { try { loggingContext.log('info', 'Sending progress notification', { data: { params }, }); await server.notification({ method: 'notifications/progress', params: { message: params.message, progress: params.progress, progressToken: params.progressToken, total: params.total, }, }); loggingContext.log('info', 'Progress notification sent', { data: { params }, }); } catch (error: unknown) { loggingContext.log('warn', 'Failed to send progress notification', { data: { error: { message: error instanceof Error ? error.message : 'Unknown error', stack: error instanceof Error ? error.stack : undefined, }, }, }); } }

Latest Blog Posts

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/chrisleekr/mcp-server-boilerplate'

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