Skip to content

Commit 53cea4a

Browse files
committed
update mcp plugin
1 parent 89b3b62 commit 53cea4a

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

packages/mcp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@utcp/mcp",
3-
"version": "1.0.14",
3+
"version": "1.0.16",
44
"description": "Model Context Protocol integration for UTCP",
55
"main": "dist/index.cjs",
66
"module": "dist/index.js",

packages/mcp/src/mcp_communication_protocol.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,15 @@ export class McpCommunicationProtocol implements CommunicationProtocol {
8888

8989
if (serverConfig.transport === 'stdio') {
9090
const stdioConfig = serverConfig as McpStdioServer;
91-
const isWindows = process.platform === "win32";
92-
const commandString = [stdioConfig.command, ...(stdioConfig.args || [])]
93-
.map(part => part.includes(' ') ? `"${part}"` : part)
94-
.join(' ');
9591

9692
const combinedEnv: Record<string, string> = {
9793
...(process.env as Record<string, string>),
9894
...(stdioConfig.env || {}),
9995
};
10096

10197
transport = new StdioClientTransport({
102-
command: isWindows ? 'cmd.exe' : 'sh',
103-
args: isWindows ? ['/c', commandString] : ['-c', commandString],
98+
command: stdioConfig.command,
99+
args: stdioConfig.args || [],
104100
cwd: stdioConfig.cwd,
105101
env: combinedEnv,
106102
});

packages/mcp/tests/mcp_communication_protocol.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ describe("McpCommunicationProtocol", () => {
167167
const result = await protocol.registerManual(mockClient, callTemplate);
168168
expect(result.success).toBe(true);
169169
expect(result.manual.tools.length).toBeGreaterThan(0);
170-
expect(result.manual.tools.some(t => t?.name === "mock_stdio_server.echo")).toBe(true);
170+
expect(result.manual.tools.some(t => t?.name === "mock_stdio_manual.mock_stdio_server.echo")).toBe(true);
171171
} finally {
172172
await protocol.close();
173173
}
@@ -220,8 +220,8 @@ describe("McpCommunicationProtocol", () => {
220220
const result = await protocol.registerManual(mockClient, callTemplate);
221221
expect(result.success).toBe(true);
222222
expect(result.manual.tools).toHaveLength(2);
223-
expect(result.manual.tools[0]?.name).toBe("mock_http_server.echo");
224-
expect(result.manual.tools[1]?.name).toBe("mock_http_server.add");
223+
expect(result.manual.tools[0]?.name).toBe("mock_http_manual.mock_http_server.echo");
224+
expect(result.manual.tools[1]?.name).toBe("mock_http_manual.mock_http_server.add");
225225
});
226226

227227
test("should call a tool with structured output via http", async () => {

0 commit comments

Comments
 (0)