Skip to content

Commit 33d7f34

Browse files
committed
fix: if env object is empty object, StdioClientTransport.start is failed(modelcontextprotocol/typescript-sdk#394)
Signed-off-by: sunrabbit123 <[email protected]>
1 parent adcb105 commit 33d7f34

File tree

6 files changed

+235
-126
lines changed

6 files changed

+235
-126
lines changed

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"build": "tsup",
3636
"lint": "eslint .",
3737
"format": "eslint --fix .",
38+
"test": "vitest",
3839
"prepack": "pnpm build",
3940
"publint": "publint",
4041
"release": "pnpm lint && pnpm prepack && publint && pnpm dlx bumpp"
@@ -43,7 +44,7 @@
4344
"commander": "^13.1.0"
4445
},
4546
"devDependencies": {
46-
"@modelcontextprotocol/sdk": "^1.10.1",
47+
"@modelcontextprotocol/sdk": "^1.9.0",
4748
"@types/node": "^22.14.1",
4849
"@wrtnlabs/eslint-config": "^0.4.3",
4950
"bumpp": "^10.1.0",
@@ -52,6 +53,7 @@
5253
"jiti": "^2.4.2",
5354
"publint": "^0.3.12",
5455
"tsup": "^8.4.0",
55-
"typescript": "^5.8.3"
56+
"typescript": "^5.8.3",
57+
"vitest": "^3.1.2"
5658
}
5759
}

pnpm-lock.yaml

Lines changed: 77 additions & 52 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cli.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@ import { Client } from "@modelcontextprotocol/sdk/client/index.js";
22
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
33
import { program } from "commander";
44

5+
import type { McpConnection } from "./mcp.js";
6+
7+
import { connectMcp } from "./mcp.js";
58
import { createServer } from "./server";
69
import { startSSEServer } from "./sse";
710

8-
import type { McpConnection } from ".";
9-
10-
import { connectMcp } from ".";
11-
1211
export function buildCli<T extends string>(props: { version: string; name: string; mcpServers: Record<T, McpConnection>; env: Record<string, T> }) {
1312
return program
1413
.version(props.version)

0 commit comments

Comments
 (0)