Skip to content

Commit 06c2952

Browse files
authored
chore: work around the SDK's MCP client issues (#1137)
MCP SDK client does not set windowsHide when spawning the process unless it is on windows under Electron (not sure why). But I think we can safely pretend to be "electron". Refs modelcontextprotocol/typescript-sdk#1638 Refs #1100
1 parent d7d26a1 commit 06c2952

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/daemon/daemon.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ async function setupMCPClient() {
5454
console.log('Setting up MCP client connection...');
5555

5656
// Create stdio transport for chrome-devtools-mcp
57+
// Workaround for https://github.com/modelcontextprotocol/typescript-sdk/blob/v1.x/src/client/stdio.ts#L128
58+
// which causes the console window to show on Windows.
59+
// @ts-expect-error no types for type.
60+
process.type = 'mcp-client';
5761
mcpTransport = new StdioClientTransport({
5862
command: process.execPath,
5963
args: [INDEX_SCRIPT_PATH, ...mcpServerArgs],

0 commit comments

Comments
 (0)