Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions backend/src/schedules/schedules.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ import { SchedulesService } from './schedules.service';
imports: [DatabaseModule, TemporalModule, WorkflowsModule],
controllers: [SchedulesController],
providers: [SchedulesService, ScheduleRepository],
exports: [SchedulesService],
})
export class SchedulesModule {}
27 changes: 22 additions & 5 deletions backend/src/studio-mcp/__tests__/studio-mcp.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { describe, it, expect, beforeEach, jest } from 'bun:test';
import { StudioMcpService } from '../studio-mcp.service';
import { monitorWorkflowRun } from '../tools/workflow.tools';
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import type { AuthContext } from '../../auth/types';
import type { WorkflowsService } from '../../workflows/workflows.service';
Expand Down Expand Up @@ -89,18 +90,35 @@ describe('StudioMcpService Unit Tests', () => {
const toolNames = Object.keys(registeredTools).sort();
expect(toolNames).toEqual([
'cancel_run',
'create_secret',
'create_workflow',
'delete_secret',
'delete_workflow',
'get_component',
'get_human_input',
'get_node_io',
'get_run_config',
'get_run_logs',
'get_run_result',
'get_run_status',
'get_run_trace',
'get_workflow',
'list_artifacts',
'list_child_runs',
'list_components',
'list_human_inputs',
'list_run_artifacts',
'list_run_node_io',
'list_runs',
'list_secrets',
'list_workflows',
'resolve_human_input',
'rotate_secret',
'run_workflow',
'update_secret',
'update_workflow',
'update_workflow_metadata',
'view_artifact',
]);
});

Expand Down Expand Up @@ -512,7 +530,6 @@ describe('StudioMcpService Unit Tests', () => {
storeTaskResult: jest.fn().mockResolvedValue(true),
};

const mockServer = {} as McpServer;
const taskId = 'test-task-id';
const runId = 'test-run-id';

Expand All @@ -534,12 +551,12 @@ describe('StudioMcpService Unit Tests', () => {
(global as any).setTimeout = (fn: any) => originalSetTimeout(fn, 1);

try {
await (service as any).monitorWorkflowRun(
await monitorWorkflowRun(
runId,
undefined,
taskId,
mockTaskStore,
mockServer,
workflowsService,
mockAuthContext,
);
} finally {
Expand Down Expand Up @@ -575,12 +592,12 @@ describe('StudioMcpService Unit Tests', () => {
failure: { message: 'boom' },
});

await (service as any).monitorWorkflowRun(
await monitorWorkflowRun(
runId,
undefined,
taskId,
mockTaskStore,
{} as McpServer,
workflowsService,
mockAuthContext,
);

Expand Down
15 changes: 14 additions & 1 deletion backend/src/studio-mcp/studio-mcp.module.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
import { Module } from '@nestjs/common';

import { WorkflowsModule } from '../workflows/workflows.module';
import { StorageModule } from '../storage/storage.module';
import { NodeIOModule } from '../node-io/node-io.module';
import { SchedulesModule } from '../schedules/schedules.module';
import { SecretsModule } from '../secrets/secrets.module';
import { HumanInputsModule } from '../human-inputs/human-inputs.module';
import { StudioMcpController } from './studio-mcp.controller';
import { StudioMcpService } from './studio-mcp.service';

@Module({
imports: [WorkflowsModule],
imports: [
WorkflowsModule,
StorageModule,
NodeIOModule,
SchedulesModule,
SecretsModule,
HumanInputsModule,
// TraceModule is @Global() — no import needed
],
controllers: [StudioMcpController],
providers: [StudioMcpService],
})
Expand Down
Loading