Skip to main content
Glama
middleware.ts786 B
import { NextFunction, Request, Response } from 'express'; /** * Validate MCP protocol version */ export function validateProtocolVersion(req: Request, res: Response, next: NextFunction): void { const version = req.headers['mcp-protocol-version']; // If no version header, continue (backwards compatibility) if (!version) { next(); return; } // Check supported versions const supportedVersions = ['2025-06-18', '2025-03-26', '2024-11-05']; if (!supportedVersions.includes(version as string)) { res.status(400).json({ jsonrpc: '2.0', error: { code: -32600, message: 'Unsupported protocol version', data: { supported: supportedVersions, requested: version }, }, id: null, }); return; } next(); }

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/datalabs89/tableau-mcp'

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