Skip to main content
Glama

Twilio MCP Server (Docker Edition with Auth Token Support)

by Twine2546
readSpecs.ts•1.43 kB
import fs from 'fs'; import path from 'path'; import SwaggerParser from '@apidevtools/swagger-parser'; import { OpenAPIV3 } from 'openapi-types'; export interface OpenAPISpec { service: string; name: string; path: string; document: OpenAPIV3.Document<OpenAPIV3.OperationObject>; } export default async function readSpecs( dir: string, baseDir: string = dir, fileNames: string[] = [], ): Promise<OpenAPISpec[]> { const entries = fs.readdirSync(dir, { withFileTypes: true }); const specs = await Promise.all( entries.map(async (entry) => { const fullPath = path.join(dir, entry.name); if (entry.isDirectory()) { return readSpecs(fullPath, baseDir); } // Check of yaml only if (!entry.name.endsWith('.yaml') && !entry.name.endsWith('.yml')) { return null; } const service = path.basename(fullPath, path.extname(fullPath)); if (fileNames.length > 0 && !fileNames.includes(service)) { return null; } const document = (await SwaggerParser.bundle( fullPath, )) as OpenAPIV3.Document; const name = service .split('_') .map((w) => w.charAt(0).toUpperCase() + w.slice(1)) .join(''); return [ { service, name, path: fullPath, document, }, ]; }), ); return specs.filter(Boolean).flat() as OpenAPISpec[]; }

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/Twine2546/twilio-mcp-docker'

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