Skip to content

Commit ce2d3e4

Browse files
travisbreaksTadao
andcommitted
fix(examples/client-multi-server): align with upstream client/stdio subpath split
Upstream main split StdioClientTransport into the './stdio' subpath of @modelcontextprotocol/client to keep the root entry free of process-spawning runtime dependencies (child_process, cross-spawn). Two changes were needed to align this example with the new layout: 1. src/index.ts: import StdioClientTransport from '@modelcontextprotocol/client/stdio' instead of from the root entry. 2. tsconfig.json: add path mappings for the new client/stdio subpath and the core/public subpath, matching the client-quickstart example. Without these mappings, the example's typecheck resolved client/stdio through the package's exports map to dist, which produced a race condition with parallel build steps that clear dist before rebuilding. Local typecheck:all, lint:all, and build:all all pass. Co-Authored-By: Tadao <tadao@travisfixes.com>
1 parent 8c2f38c commit ce2d3e4

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

examples/client-multi-server/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
import { resolve, dirname } from 'node:path';
1212
import { fileURLToPath } from 'node:url';
1313

14-
import { Client, StdioClientTransport } from '@modelcontextprotocol/client';
14+
import { Client } from '@modelcontextprotocol/client';
15+
import { StdioClientTransport } from '@modelcontextprotocol/client/stdio';
1516

1617
const __dirname = dirname(fileURLToPath(import.meta.url));
1718

examples/client-multi-server/tsconfig.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,13 @@
1212
"forceConsistentCasingInFileNames": true,
1313
"paths": {
1414
"@modelcontextprotocol/client": ["./node_modules/@modelcontextprotocol/client/src/index.ts"],
15+
"@modelcontextprotocol/client/stdio": ["./node_modules/@modelcontextprotocol/client/src/stdio.ts"],
1516
"@modelcontextprotocol/client/_shims": ["./node_modules/@modelcontextprotocol/client/src/shimsNode.ts"],
1617
"@modelcontextprotocol/core": [
1718
"./node_modules/@modelcontextprotocol/client/node_modules/@modelcontextprotocol/core/src/index.ts"
19+
],
20+
"@modelcontextprotocol/core/public": [
21+
"./node_modules/@modelcontextprotocol/client/node_modules/@modelcontextprotocol/core/src/exports/public/index.ts"
1822
]
1923
}
2024
},

0 commit comments

Comments
 (0)