11import { MiddlewareConsumer , Module , NestModule } from '@nestjs/common' ;
2- import { McpModule } from '@rekog /mcp-nest' ;
2+ import { McpModule } from '@tc /mcp-nest' ;
33import { QueryChallengesTool } from './mcp/tools/challenges/queryChallenges.tool' ;
4- import { randomUUID } from 'crypto' ;
54import { GlobalProvidersModule } from './shared/global/globalProviders.module' ;
65import { TopcoderModule } from './shared/topcoder/topcoder.module' ;
76import { HealthCheckController } from './api/health-check/healthCheck.controller' ;
87import { TokenValidatorMiddleware } from './core/auth/middleware/tokenValidator.middleware' ;
9- import { CreateRequestStoreMiddleware } from './core/request/createRequestStore.middleware' ;
10- import { AuthGuard , RolesGuard } from './core/auth/guards' ;
11- import { APP_GUARD } from '@nestjs/core' ;
8+ import { nanoid } from 'nanoid' ;
129
1310@Module ( {
1411 imports : [
@@ -17,30 +14,18 @@ import { APP_GUARD } from '@nestjs/core';
1714 version : '1.0.0' ,
1815 streamableHttp : {
1916 enableJsonResponse : false ,
20- sessionIdGenerator : ( ) => randomUUID ( ) ,
17+ sessionIdGenerator : ( ) => nanoid ( ) ,
2118 statelessMode : false ,
2219 } ,
23- // guards: [AuthGuard, RolesGuard],
2420 } ) ,
2521 GlobalProvidersModule ,
2622 TopcoderModule ,
2723 ] ,
2824 controllers : [ HealthCheckController ] ,
29- providers : [
30- // {
31- // provide: APP_GUARD,
32- // useClass: AuthGuard,
33- // },
34- // {
35- // provide: APP_GUARD,
36- // useClass: RolesGuard,
37- // },
38- QueryChallengesTool ,
39- ] ,
25+ providers : [ QueryChallengesTool ] ,
4026} )
4127export class AppModule implements NestModule {
4228 configure ( consumer : MiddlewareConsumer ) {
43- // consumer.apply(TokenValidatorMiddleware).forRoutes('*');
44- // consumer.apply(CreateRequestStoreMiddleware).forRoutes('*');
29+ consumer . apply ( TokenValidatorMiddleware ) . forRoutes ( '*' ) ;
4530 }
4631}
0 commit comments