@goke/mcp 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth.d.ts.map +1 -0
- package/dist/cli-to-mcp.d.ts.map +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/local-callback-server.d.ts.map +1 -0
- package/dist/oauth-provider.d.ts.map +1 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +2 -2
- package/dist/src/auth.d.ts.map +0 -1
- package/dist/src/cli-to-mcp.d.ts.map +0 -1
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/local-callback-server.d.ts.map +0 -1
- package/dist/src/oauth-provider.d.ts.map +0 -1
- package/dist/src/types.d.ts.map +0 -1
- package/dist/test/add-cli-tools-to-mcp.test.d.ts +0 -5
- package/dist/test/add-cli-tools-to-mcp.test.d.ts.map +0 -1
- package/dist/test/add-cli-tools-to-mcp.test.js +0 -399
- /package/dist/{src/auth.d.ts → auth.d.ts} +0 -0
- /package/dist/{src/auth.js → auth.js} +0 -0
- /package/dist/{src/cli-to-mcp.d.ts → cli-to-mcp.d.ts} +0 -0
- /package/dist/{src/cli-to-mcp.js → cli-to-mcp.js} +0 -0
- /package/dist/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/{src/index.js → index.js} +0 -0
- /package/dist/{src/local-callback-server.d.ts → local-callback-server.d.ts} +0 -0
- /package/dist/{src/local-callback-server.js → local-callback-server.js} +0 -0
- /package/dist/{src/oauth-provider.d.ts → oauth-provider.d.ts} +0 -0
- /package/dist/{src/oauth-provider.js → oauth-provider.js} +0 -0
- /package/dist/{src/types.d.ts → types.d.ts} +0 -0
- /package/dist/{src/types.js → types.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAiB,eAAe,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AA0BxF;;;;;;;;;;;;GAYG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC,CA4E7F;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAazD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-to-mcp.d.ts","sourceRoot":"","sources":["../src/cli-to-mcp.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AASxE,OAAO,EAAmD,KAAK,IAAI,EAA6B,MAAM,MAAM,CAAC;AAwD7G,MAAM,WAAW,uBAAuB;IACtC,GAAG,EAAE,IAAI,CAAC;IACV,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,aAAa,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC;IACjD,gBAAgB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,MAAM,CAAC;CACpD;AA4XD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,IAAI,CAyCvE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAC/E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAKjC,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,YAAY,EAAE,uBAAuB,EAAE,MAAM,iBAAiB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EG;IACH,IAAI,EAAE,MAAM,aAAa,GAAG,SAAS,CAAC;IAEtC;;;OAGG;IACH,IAAI,EAAE,CAAC,KAAK,EAAE,aAAa,GAAG,SAAS,KAAK,IAAI,CAAC;IAEjD;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAElC;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAE3B;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,mDAAmD;IACnD,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,kDAAkD;IAClD,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,4DAA4D;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,sDAAsD;IACtD,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,uCAAuC;IACvC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goke/mcp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "Dynamically generate CLI commands from MCP server tools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"clean": "rm -rf dist",
|
|
45
|
-
"build": "pnpm clean && tsc",
|
|
45
|
+
"build": "pnpm clean && tsc -p tsconfig.build.json",
|
|
46
46
|
"test": "vitest --run",
|
|
47
47
|
"watch": "tsc -w"
|
|
48
48
|
}
|
package/dist/src/auth.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/auth.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAiB,eAAe,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AA0BxF;;;;;;;;;;;;GAYG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC,CA4E7F;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAazD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli-to-mcp.d.ts","sourceRoot":"","sources":["../../src/cli-to-mcp.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AASxE,OAAO,EAAmD,KAAK,IAAI,EAA6B,MAAM,MAAM,CAAC;AAwD7G,MAAM,WAAW,uBAAuB;IACtC,GAAG,EAAE,IAAI,CAAC;IACV,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,aAAa,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC;IACjD,gBAAgB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,MAAM,CAAC;CACpD;AA4XD,wBAAgB,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;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,EAAE,cAAc,CAAC;IAEvB;;OAEG;IACH,SAAS,EAAE,MAAM,cAAc,GAAG,SAAS,CAAC;IAE5C;;OAEG;IACH,SAAS,EAAE,CAAC,KAAK,EAAE,cAAc,GAAG,SAAS,KAAK,IAAI,CAAC;CACxD;AAmID;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAyMlF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"local-callback-server.d.ts","sourceRoot":"","sources":["../../src/local-callback-server.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AA2FxE;;;;;GAKG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,GAAE,qBAA0B,GAAG,OAAO,CAAC;IACtF,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,OAAO,CAAC,cAAc,CAAC,CAAC;IAC/C,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC,CAgFD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-provider.d.ts","sourceRoot":"","sources":["../../src/oauth-provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,KAAK,EACV,sBAAsB,EACtB,0BAA0B,EAC1B,mBAAmB,EACnB,WAAW,EACZ,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,WAAW,CAAC;IACr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GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,4DAA4D;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,sDAAsD;IACtD,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,uCAAuC;IACvC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-cli-tools-to-mcp.test.d.ts","sourceRoot":"","sources":["../../test/add-cli-tools-to-mcp.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -1,399 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* End-to-end tests for exposing a goke CLI as MCP tools.
|
|
3
|
-
*/
|
|
4
|
-
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
5
|
-
import { InMemoryTransport } from "@modelcontextprotocol/sdk/inMemory.js";
|
|
6
|
-
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
7
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
8
|
-
import { CallToolRequestSchema, ErrorCode, ListToolsRequestSchema, McpError } from "@modelcontextprotocol/sdk/types.js";
|
|
9
|
-
import { goke, wrapJsonSchema } from "goke";
|
|
10
|
-
import { z } from "zod";
|
|
11
|
-
import { describe, expect, it } from "vitest";
|
|
12
|
-
import { addCliToolsToMcp } from "../src/cli-to-mcp.js";
|
|
13
|
-
function createCli() {
|
|
14
|
-
const cli = goke("test-cli");
|
|
15
|
-
cli
|
|
16
|
-
.command("say hi", "Say hello")
|
|
17
|
-
.option("--name <name>", z.string().describe("Person to greet"))
|
|
18
|
-
.option("--caps", z.boolean().default(false).describe("Uppercase output"))
|
|
19
|
-
.action((options) => {
|
|
20
|
-
const message = `Hello ${options.name}!`;
|
|
21
|
-
return options.caps ? message.toUpperCase() : message;
|
|
22
|
-
});
|
|
23
|
-
cli
|
|
24
|
-
.command("sum-values", "Add two numbers")
|
|
25
|
-
.option("--left <left>", wrapJsonSchema({
|
|
26
|
-
type: "number",
|
|
27
|
-
description: "Left operand",
|
|
28
|
-
}))
|
|
29
|
-
.option("--right <right>", wrapJsonSchema({
|
|
30
|
-
type: "number",
|
|
31
|
-
description: "Right operand",
|
|
32
|
-
}))
|
|
33
|
-
.action((options) => ({
|
|
34
|
-
sum: options.left + options.right,
|
|
35
|
-
}));
|
|
36
|
-
cli
|
|
37
|
-
.command("echo <message>", "Echo positional message")
|
|
38
|
-
.option("--repeat [repeat]", wrapJsonSchema({
|
|
39
|
-
type: "integer",
|
|
40
|
-
default: 2,
|
|
41
|
-
description: "Repeat count",
|
|
42
|
-
}))
|
|
43
|
-
.action((message, options) => {
|
|
44
|
-
return message.repeat(options.repeat);
|
|
45
|
-
});
|
|
46
|
-
cli
|
|
47
|
-
.command("string-options", "Infer option types from plain string descriptions")
|
|
48
|
-
.option("--title <title>", "Required title")
|
|
49
|
-
.option("--tag [tag]", "Optional tag")
|
|
50
|
-
.option("--dry-run", "Dry run flag")
|
|
51
|
-
.action((options) => {
|
|
52
|
-
return options;
|
|
53
|
-
});
|
|
54
|
-
return cli;
|
|
55
|
-
}
|
|
56
|
-
function firstTextContent(result) {
|
|
57
|
-
const content = "content" in result ? result.content : [];
|
|
58
|
-
return content.find((entry) => entry.type === "text")?.text ?? "";
|
|
59
|
-
}
|
|
60
|
-
function expectCommandDescriptions(tools) {
|
|
61
|
-
const descriptionByName = Object.fromEntries(tools.map((tool) => [tool.name, tool.description]));
|
|
62
|
-
expect(descriptionByName).toMatchObject({
|
|
63
|
-
say_hi: "Say hello",
|
|
64
|
-
"sum-values": "Add two numbers",
|
|
65
|
-
echo: "Echo positional message",
|
|
66
|
-
"string-options": "Infer option types from plain string descriptions",
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
function addUserLowLevelTools(server) {
|
|
70
|
-
server.registerCapabilities({ tools: { listChanged: true } });
|
|
71
|
-
server.setRequestHandler(ListToolsRequestSchema, () => ({
|
|
72
|
-
tools: [
|
|
73
|
-
{
|
|
74
|
-
name: "user_tool",
|
|
75
|
-
description: "Tool added directly by user",
|
|
76
|
-
inputSchema: {
|
|
77
|
-
type: "object",
|
|
78
|
-
properties: {},
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
],
|
|
82
|
-
}));
|
|
83
|
-
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
84
|
-
if (request.params.name !== "user_tool") {
|
|
85
|
-
throw new McpError(ErrorCode.InvalidParams, `Tool ${request.params.name} not found`);
|
|
86
|
-
}
|
|
87
|
-
return {
|
|
88
|
-
content: [{ type: "text", text: "from-user-low-level" }],
|
|
89
|
-
};
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
async function runScenario(mode) {
|
|
93
|
-
const cli = createCli();
|
|
94
|
-
const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();
|
|
95
|
-
const server = mode === "low-level-server"
|
|
96
|
-
? new Server({ name: "test-server", version: "1.0.0" }, { capabilities: {} })
|
|
97
|
-
: new McpServer({ name: "test-server", version: "1.0.0" });
|
|
98
|
-
addCliToolsToMcp({ cli, server });
|
|
99
|
-
const client = new Client({ name: "test-client", version: "1.0.0" }, { capabilities: {} });
|
|
100
|
-
try {
|
|
101
|
-
await server.connect(serverTransport);
|
|
102
|
-
await client.connect(clientTransport);
|
|
103
|
-
const toolsResult = await client.listTools();
|
|
104
|
-
const greetingResult = await client.callTool({
|
|
105
|
-
name: "say_hi",
|
|
106
|
-
arguments: { name: "Tommy" },
|
|
107
|
-
});
|
|
108
|
-
const sumResult = await client.callTool({
|
|
109
|
-
name: "sum-values",
|
|
110
|
-
arguments: { left: 2, right: 3 },
|
|
111
|
-
});
|
|
112
|
-
const echoResult = await client.callTool({
|
|
113
|
-
name: "echo",
|
|
114
|
-
arguments: { message: "ha" },
|
|
115
|
-
});
|
|
116
|
-
const stringOptionsResult = await client.callTool({
|
|
117
|
-
name: "string-options",
|
|
118
|
-
arguments: {
|
|
119
|
-
title: "Release notes",
|
|
120
|
-
dryRun: true,
|
|
121
|
-
},
|
|
122
|
-
});
|
|
123
|
-
return {
|
|
124
|
-
tools: toolsResult.tools,
|
|
125
|
-
greeting: firstTextContent(greetingResult),
|
|
126
|
-
sum: firstTextContent(sumResult),
|
|
127
|
-
echo: firstTextContent(echoResult),
|
|
128
|
-
stringOptions: firstTextContent(stringOptionsResult),
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
finally {
|
|
132
|
-
await client.close();
|
|
133
|
-
await server.close();
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
describe("addCliToolsToMcp", () => {
|
|
137
|
-
it("mounts CLI tools and executes calls with low-level Server", async () => {
|
|
138
|
-
const result = await runScenario("low-level-server");
|
|
139
|
-
expect("\n" + JSON.stringify(result.tools, null, 2)).toMatchInlineSnapshot(`
|
|
140
|
-
"
|
|
141
|
-
[
|
|
142
|
-
{
|
|
143
|
-
"name": "say_hi",
|
|
144
|
-
"description": "Say hello",
|
|
145
|
-
"inputSchema": {
|
|
146
|
-
"type": "object",
|
|
147
|
-
"properties": {
|
|
148
|
-
"name": {
|
|
149
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
150
|
-
"type": "string",
|
|
151
|
-
"description": "Person to greet"
|
|
152
|
-
},
|
|
153
|
-
"caps": {
|
|
154
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
155
|
-
"default": false,
|
|
156
|
-
"description": "Uppercase output",
|
|
157
|
-
"type": "boolean"
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
"required": [
|
|
161
|
-
"name"
|
|
162
|
-
]
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
"name": "sum-values",
|
|
167
|
-
"description": "Add two numbers",
|
|
168
|
-
"inputSchema": {
|
|
169
|
-
"type": "object",
|
|
170
|
-
"properties": {
|
|
171
|
-
"left": {
|
|
172
|
-
"type": "number",
|
|
173
|
-
"description": "Left operand"
|
|
174
|
-
},
|
|
175
|
-
"right": {
|
|
176
|
-
"type": "number",
|
|
177
|
-
"description": "Right operand"
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
|
-
"required": [
|
|
181
|
-
"left",
|
|
182
|
-
"right"
|
|
183
|
-
]
|
|
184
|
-
}
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
"name": "echo",
|
|
188
|
-
"description": "Echo positional message",
|
|
189
|
-
"inputSchema": {
|
|
190
|
-
"type": "object",
|
|
191
|
-
"properties": {
|
|
192
|
-
"message": {
|
|
193
|
-
"type": "string",
|
|
194
|
-
"description": "Positional argument message"
|
|
195
|
-
},
|
|
196
|
-
"repeat": {
|
|
197
|
-
"type": "integer",
|
|
198
|
-
"default": 2,
|
|
199
|
-
"description": "Repeat count"
|
|
200
|
-
}
|
|
201
|
-
},
|
|
202
|
-
"required": [
|
|
203
|
-
"message"
|
|
204
|
-
]
|
|
205
|
-
}
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
"name": "string-options",
|
|
209
|
-
"description": "Infer option types from plain string descriptions",
|
|
210
|
-
"inputSchema": {
|
|
211
|
-
"type": "object",
|
|
212
|
-
"properties": {
|
|
213
|
-
"title": {
|
|
214
|
-
"type": "string",
|
|
215
|
-
"description": "Required title"
|
|
216
|
-
},
|
|
217
|
-
"tag": {
|
|
218
|
-
"type": "string",
|
|
219
|
-
"description": "Optional tag"
|
|
220
|
-
},
|
|
221
|
-
"dryRun": {
|
|
222
|
-
"type": "boolean",
|
|
223
|
-
"description": "Dry run flag"
|
|
224
|
-
}
|
|
225
|
-
},
|
|
226
|
-
"required": [
|
|
227
|
-
"title"
|
|
228
|
-
]
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
]"
|
|
232
|
-
`);
|
|
233
|
-
expectCommandDescriptions(result.tools);
|
|
234
|
-
expect(result.greeting).toBe("Hello Tommy!");
|
|
235
|
-
expect(result.sum).toBe('{\n "sum": 5\n}');
|
|
236
|
-
expect(result.echo).toBe("haha");
|
|
237
|
-
expect(result.stringOptions).toBe('{\n "title": "Release notes",\n "dryRun": true\n}');
|
|
238
|
-
});
|
|
239
|
-
it("mounts CLI tools and executes calls with high-level McpServer", async () => {
|
|
240
|
-
const result = await runScenario("mcp-server");
|
|
241
|
-
expect("\n" + JSON.stringify(result.tools, null, 2)).toMatchInlineSnapshot(`
|
|
242
|
-
"
|
|
243
|
-
[
|
|
244
|
-
{
|
|
245
|
-
"name": "say_hi",
|
|
246
|
-
"description": "Say hello",
|
|
247
|
-
"inputSchema": {
|
|
248
|
-
"type": "object",
|
|
249
|
-
"properties": {
|
|
250
|
-
"name": {
|
|
251
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
252
|
-
"type": "string",
|
|
253
|
-
"description": "Person to greet"
|
|
254
|
-
},
|
|
255
|
-
"caps": {
|
|
256
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
257
|
-
"default": false,
|
|
258
|
-
"description": "Uppercase output",
|
|
259
|
-
"type": "boolean"
|
|
260
|
-
}
|
|
261
|
-
},
|
|
262
|
-
"required": [
|
|
263
|
-
"name"
|
|
264
|
-
]
|
|
265
|
-
}
|
|
266
|
-
},
|
|
267
|
-
{
|
|
268
|
-
"name": "sum-values",
|
|
269
|
-
"description": "Add two numbers",
|
|
270
|
-
"inputSchema": {
|
|
271
|
-
"type": "object",
|
|
272
|
-
"properties": {
|
|
273
|
-
"left": {
|
|
274
|
-
"type": "number",
|
|
275
|
-
"description": "Left operand"
|
|
276
|
-
},
|
|
277
|
-
"right": {
|
|
278
|
-
"type": "number",
|
|
279
|
-
"description": "Right operand"
|
|
280
|
-
}
|
|
281
|
-
},
|
|
282
|
-
"required": [
|
|
283
|
-
"left",
|
|
284
|
-
"right"
|
|
285
|
-
]
|
|
286
|
-
}
|
|
287
|
-
},
|
|
288
|
-
{
|
|
289
|
-
"name": "echo",
|
|
290
|
-
"description": "Echo positional message",
|
|
291
|
-
"inputSchema": {
|
|
292
|
-
"type": "object",
|
|
293
|
-
"properties": {
|
|
294
|
-
"message": {
|
|
295
|
-
"type": "string",
|
|
296
|
-
"description": "Positional argument message"
|
|
297
|
-
},
|
|
298
|
-
"repeat": {
|
|
299
|
-
"type": "integer",
|
|
300
|
-
"default": 2,
|
|
301
|
-
"description": "Repeat count"
|
|
302
|
-
}
|
|
303
|
-
},
|
|
304
|
-
"required": [
|
|
305
|
-
"message"
|
|
306
|
-
]
|
|
307
|
-
}
|
|
308
|
-
},
|
|
309
|
-
{
|
|
310
|
-
"name": "string-options",
|
|
311
|
-
"description": "Infer option types from plain string descriptions",
|
|
312
|
-
"inputSchema": {
|
|
313
|
-
"type": "object",
|
|
314
|
-
"properties": {
|
|
315
|
-
"title": {
|
|
316
|
-
"type": "string",
|
|
317
|
-
"description": "Required title"
|
|
318
|
-
},
|
|
319
|
-
"tag": {
|
|
320
|
-
"type": "string",
|
|
321
|
-
"description": "Optional tag"
|
|
322
|
-
},
|
|
323
|
-
"dryRun": {
|
|
324
|
-
"type": "boolean",
|
|
325
|
-
"description": "Dry run flag"
|
|
326
|
-
}
|
|
327
|
-
},
|
|
328
|
-
"required": [
|
|
329
|
-
"title"
|
|
330
|
-
]
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
]"
|
|
334
|
-
`);
|
|
335
|
-
expectCommandDescriptions(result.tools);
|
|
336
|
-
expect(result.greeting).toBe("Hello Tommy!");
|
|
337
|
-
expect(result.sum).toBe('{\n "sum": 5\n}');
|
|
338
|
-
expect(result.echo).toBe("haha");
|
|
339
|
-
expect(result.stringOptions).toBe('{\n "title": "Release notes",\n "dryRun": true\n}');
|
|
340
|
-
});
|
|
341
|
-
it("composes with user tools already mounted on low-level Server", async () => {
|
|
342
|
-
const cli = createCli();
|
|
343
|
-
const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();
|
|
344
|
-
const server = new Server({ name: "test-server", version: "1.0.0" }, { capabilities: {} });
|
|
345
|
-
const client = new Client({ name: "test-client", version: "1.0.0" }, { capabilities: {} });
|
|
346
|
-
addUserLowLevelTools(server);
|
|
347
|
-
addCliToolsToMcp({ cli, server, commandFilter: (name) => name === "say hi" });
|
|
348
|
-
try {
|
|
349
|
-
await server.connect(serverTransport);
|
|
350
|
-
await client.connect(clientTransport);
|
|
351
|
-
const tools = await client.listTools();
|
|
352
|
-
expect(tools.tools.map((tool) => tool.name).sort()).toEqual(["say_hi", "user_tool"]);
|
|
353
|
-
const cliResult = await client.callTool({
|
|
354
|
-
name: "say_hi",
|
|
355
|
-
arguments: { name: "Tommy" },
|
|
356
|
-
});
|
|
357
|
-
const userResult = await client.callTool({
|
|
358
|
-
name: "user_tool",
|
|
359
|
-
arguments: {},
|
|
360
|
-
});
|
|
361
|
-
expect(firstTextContent(cliResult)).toBe("Hello Tommy!");
|
|
362
|
-
expect(firstTextContent(userResult)).toBe("from-user-low-level");
|
|
363
|
-
}
|
|
364
|
-
finally {
|
|
365
|
-
await client.close();
|
|
366
|
-
await server.close();
|
|
367
|
-
}
|
|
368
|
-
});
|
|
369
|
-
it("composes with user tools already mounted on high-level McpServer", async () => {
|
|
370
|
-
const cli = createCli();
|
|
371
|
-
const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();
|
|
372
|
-
const server = new McpServer({ name: "test-server", version: "1.0.0" });
|
|
373
|
-
const client = new Client({ name: "test-client", version: "1.0.0" }, { capabilities: {} });
|
|
374
|
-
server.tool("user_tool", "Tool added directly by user", async () => ({
|
|
375
|
-
content: [{ type: "text", text: "from-user-mcp-server" }],
|
|
376
|
-
}));
|
|
377
|
-
addCliToolsToMcp({ cli, server, commandFilter: (name) => name === "say hi" });
|
|
378
|
-
try {
|
|
379
|
-
await server.connect(serverTransport);
|
|
380
|
-
await client.connect(clientTransport);
|
|
381
|
-
const tools = await client.listTools();
|
|
382
|
-
expect(tools.tools.map((tool) => tool.name).sort()).toEqual(["say_hi", "user_tool"]);
|
|
383
|
-
const cliResult = await client.callTool({
|
|
384
|
-
name: "say_hi",
|
|
385
|
-
arguments: { name: "Tommy" },
|
|
386
|
-
});
|
|
387
|
-
const userResult = await client.callTool({
|
|
388
|
-
name: "user_tool",
|
|
389
|
-
arguments: {},
|
|
390
|
-
});
|
|
391
|
-
expect(firstTextContent(cliResult)).toBe("Hello Tommy!");
|
|
392
|
-
expect(firstTextContent(userResult)).toBe("from-user-mcp-server");
|
|
393
|
-
}
|
|
394
|
-
finally {
|
|
395
|
-
await client.close();
|
|
396
|
-
await server.close();
|
|
397
|
-
}
|
|
398
|
-
});
|
|
399
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|