1
1
import { MiddlewareConsumer , Module , NestModule } from '@nestjs/common' ;
2
- import { McpModule } from '@rekog /mcp-nest' ;
2
+ import { McpModule } from '@tc /mcp-nest' ;
3
3
import { QueryChallengesTool } from './mcp/tools/challenges/queryChallenges.tool' ;
4
- import { randomUUID } from 'crypto' ;
5
4
import { GlobalProvidersModule } from './shared/global/globalProviders.module' ;
6
5
import { TopcoderModule } from './shared/topcoder/topcoder.module' ;
7
6
import { HealthCheckController } from './api/health-check/healthCheck.controller' ;
8
7
import { 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' ;
12
9
13
10
@Module ( {
14
11
imports : [
@@ -17,30 +14,18 @@ import { APP_GUARD } from '@nestjs/core';
17
14
version : '1.0.0' ,
18
15
streamableHttp : {
19
16
enableJsonResponse : false ,
20
- sessionIdGenerator : ( ) => randomUUID ( ) ,
17
+ sessionIdGenerator : ( ) => nanoid ( ) ,
21
18
statelessMode : false ,
22
19
} ,
23
- // guards: [AuthGuard, RolesGuard],
24
20
} ) ,
25
21
GlobalProvidersModule ,
26
22
TopcoderModule ,
27
23
] ,
28
24
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 ] ,
40
26
} )
41
27
export class AppModule implements NestModule {
42
28
configure ( consumer : MiddlewareConsumer ) {
43
- // consumer.apply(TokenValidatorMiddleware).forRoutes('*');
44
- // consumer.apply(CreateRequestStoreMiddleware).forRoutes('*');
29
+ consumer . apply ( TokenValidatorMiddleware ) . forRoutes ( '*' ) ;
45
30
}
46
31
}
0 commit comments