feat: load with import

This commit is contained in:
Nevo David 2025-10-16 23:00:37 +07:00
parent d079c1b061
commit acaed7ae9e
2 changed files with 2 additions and 2 deletions

View File

@ -17,7 +17,7 @@ export class MastraService {
postiz: await this._loadToolsService.agent(),
},
logger: new ConsoleLogger({
level: 'debug',
level: 'info',
}),
});

View File

@ -1,11 +1,11 @@
import { INestApplication } from '@nestjs/common';
import { Request, Response } from 'express';
import { MastraService } from '@gitroom/nestjs-libraries/chat/mastra.service';
import { MCPServer } from '@mastra/mcp';
import { randomUUID } from 'crypto';
import { OrganizationService } from '@gitroom/nestjs-libraries/database/prisma/organizations/organization.service';
import { runWithContext } from './async.storage';
export const startMcp = async (app: INestApplication) => {
const MCPServer = await import('@mastra/mcp').then(m => m.MCPServer);
const mastraService = app.get(MastraService, { strict: false });
const organizationService = app.get(OrganizationService, { strict: false });