Skip to main content
Glama
main.ts1.23 kB
import { AppModule } from '@/app.module'; import { ValidationPipe } from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; import { NestFactory } from '@nestjs/core'; import { NestExpressApplication } from '@nestjs/platform-express'; import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; async function bootstrap() { const mcpServerRoutes = ['sse', 'mcp', 'messages']; const app = await NestFactory.create<NestExpressApplication>(AppModule); app.enableCors(); app.disable('x-powered-by'); app.setGlobalPrefix('api', { exclude: ['', 'hello', ...mcpServerRoutes] }); app.useGlobalPipes( new ValidationPipe({ transform: true, whitelist: true, forbidNonWhitelisted: false, }), ); const openAPIConfig = new DocumentBuilder() .setTitle('MCP TODO API') .setDescription('The MCP TODO API description') .setVersion('1.0') .addTag('todo') .build(); const documentFactory = () => SwaggerModule.createDocument(app, openAPIConfig); SwaggerModule.setup('api/docs', app, documentFactory); const configService = app.get(ConfigService); const port = configService.get<number>('SERVER_PORT') || 3000; await app.listen(port); } bootstrap();

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

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