-
Notifications
You must be signed in to change notification settings - Fork 41.9k
Move the scenario runner out of the MCP server #331862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Bryan Chen (bryanchen-d)
merged 4 commits into
main
from
copilot/vscode/extract-scenario-runner
Aug 20, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
515e453
Move the scenario runner out of the MCP server
bryanchen-d 72539ec
Add the lockfile for the new scenario package
bryanchen-d 2c6eaa1
Notify on the extracted scenario package
bryanchen-d 42e9eb4
Do not re-declare @types/node in the scenario package
bryanchen-d File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| /*--------------------------------------------------------------------------------------------- | ||
| * Copyright (c) Microsoft Corporation. All rights reserved. | ||
| * Licensed under the MIT License. See License.txt in the project root for license information. | ||
| *--------------------------------------------------------------------------------------------*/ | ||
|
|
||
| import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js'; | ||
| import { z } from 'zod'; | ||
| import { EvidenceService, JSONValue } from '../../scenario'; | ||
|
|
||
| const jsonValueSchema: z.ZodType<JSONValue> = z.lazy(() => z.union([ | ||
| z.string(), | ||
| z.number(), | ||
| z.boolean(), | ||
| z.null(), | ||
| z.array(jsonValueSchema), | ||
| z.record(z.string(), jsonValueSchema) | ||
| ])); | ||
|
|
||
| function isHttpUrl(value: string): boolean { | ||
| try { | ||
| return ['http:', 'https:'].includes(new URL(value).protocol); | ||
| } catch { | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| export function applyEvidenceStartTool(server: McpServer, evidenceService: EvidenceService): RegisteredTool { | ||
| return server.tool( | ||
| 'vscode_automation_evidence_start', | ||
| 'Start VS Code with video and trace recording for a UI validation scenario', | ||
| { | ||
| scenarioId: z.string().describe('Stable scenario identifier'), | ||
| title: z.string().describe('Human-readable scenario title'), | ||
| source: z.string().url().refine(isHttpUrl, 'Source must use HTTP or HTTPS').optional().describe('Source test-plan issue URL'), | ||
| scenarioPath: z.string().optional().describe('Path to the Markdown scenario definition'), | ||
| workspacePath: z.string().optional().describe('Workspace or folder to open'), | ||
| userSettings: z.record(z.string(), jsonValueSchema).optional().describe('User settings to seed before VS Code starts'), | ||
| extraArgs: z.array(z.string()).optional().describe('Additional VS Code command-line arguments') | ||
| }, | ||
| async ({ scenarioId, title, source, scenarioPath, workspacePath, userSettings, extraArgs }) => { | ||
| const runPath = await evidenceService.start(scenarioId, title, source, scenarioPath, workspacePath, userSettings, extraArgs); | ||
| return { | ||
| content: [{ type: 'text' as const, text: `Evidence capture started: ${runPath}` }] | ||
| }; | ||
| } | ||
| ); | ||
| } | ||
|
|
||
| export function applyEvidenceTools(server: McpServer, evidenceService: EvidenceService): RegisteredTool[] { | ||
| return [ | ||
| server.tool( | ||
| 'vscode_automation_evidence_step', | ||
| 'Mark a scenario step in the video and save a screenshot of the current VS Code window', | ||
| { | ||
| id: z.string().describe('Stable step identifier from the scenario'), | ||
| title: z.string().describe('Human-readable step title'), | ||
| status: z.enum(['started', 'passed', 'failed', 'skipped']).describe('Step lifecycle status'), | ||
| details: z.string().optional().describe('Validation result or failure details') | ||
| }, | ||
| async ({ id, title, status, details }) => { | ||
| const result = await evidenceService.step(id, title, status, details); | ||
| return { | ||
| content: [ | ||
| { type: 'text' as const, text: `Evidence saved: ${result.screenshotPath}` }, | ||
| { type: 'image' as const, data: result.screenshot.toString('base64'), mimeType: 'image/png' } | ||
| ] | ||
| }; | ||
| } | ||
| ), | ||
| server.tool( | ||
| 'vscode_automation_evidence_finish', | ||
| 'Finish a UI validation scenario, stop VS Code, and write the evidence report', | ||
| { | ||
| outcome: z.enum(['passed', 'failed', 'aborted']).describe('Overall scenario outcome'), | ||
| notes: z.string().optional().describe('Run summary or blocking condition') | ||
| }, | ||
| async ({ outcome, notes }) => { | ||
| const reportPath = await evidenceService.finish(outcome, notes); | ||
| return { | ||
| content: [{ type: 'text' as const, text: `Evidence report written: ${reportPath}` }] | ||
| }; | ||
| } | ||
| ) | ||
| ]; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| .DS_Store | ||
| npm-debug.log | ||
| Thumbs.db | ||
| node_modules/ | ||
| out/ |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.