@modeltoolsprotocol/mtpcli 0.2.1 → 0.2.2
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/index.js +43 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9208,7 +9208,7 @@ function cleanJson(obj) {
|
|
|
9208
9208
|
}
|
|
9209
9209
|
|
|
9210
9210
|
// src/index.ts
|
|
9211
|
-
var VERSION3 = "0.2.
|
|
9211
|
+
var VERSION3 = "0.2.2";
|
|
9212
9212
|
function selfDescribe() {
|
|
9213
9213
|
const schema = {
|
|
9214
9214
|
name: "mtpcli",
|
|
@@ -9355,23 +9355,23 @@ function selfDescribe() {
|
|
|
9355
9355
|
},
|
|
9356
9356
|
{
|
|
9357
9357
|
name: "serve",
|
|
9358
|
-
description: "Serve CLI tools as an MCP server over stdio",
|
|
9358
|
+
description: "Serve CLI tools as an MCP server over stdio. Not meant to be run directly; add to your MCP client config instead.",
|
|
9359
9359
|
args: [
|
|
9360
9360
|
{
|
|
9361
9361
|
name: "--tool",
|
|
9362
9362
|
type: "array",
|
|
9363
9363
|
required: true,
|
|
9364
|
-
description: "Tool name(s) to serve"
|
|
9364
|
+
description: "Tool name(s) to serve (must support --describe)"
|
|
9365
9365
|
}
|
|
9366
9366
|
],
|
|
9367
9367
|
examples: [
|
|
9368
9368
|
{
|
|
9369
|
-
description: "
|
|
9370
|
-
command: "mtpcli serve --tool
|
|
9369
|
+
description: "Add to ~/.claude.json as an MCP server",
|
|
9370
|
+
command: '{ "mcpServers": { "my-tools": { "type": "stdio", "command": "mtpcli", "args": ["serve", "--tool", "my-cli-tool"] } } }'
|
|
9371
9371
|
},
|
|
9372
9372
|
{
|
|
9373
|
-
description: "Serve multiple tools",
|
|
9374
|
-
command: "mtpcli serve --tool
|
|
9373
|
+
description: "Serve multiple tools in one MCP server",
|
|
9374
|
+
command: '{ "mcpServers": { "my-tools": { "type": "stdio", "command": "mtpcli", "args": ["serve", "--tool", "tool1", "--tool", "tool2"] } } }'
|
|
9375
9375
|
}
|
|
9376
9376
|
]
|
|
9377
9377
|
},
|
|
@@ -9541,7 +9541,42 @@ authCmd.command("refresh").description("Force-refresh the stored OAuth token for
|
|
|
9541
9541
|
const { runRefresh: runRefresh2 } = await Promise.resolve().then(() => (init_auth(), exports_auth));
|
|
9542
9542
|
await runRefresh2(tool);
|
|
9543
9543
|
});
|
|
9544
|
-
program2.command("serve").description("Serve CLI tools as an MCP server (cli2mcp bridge)").requiredOption("--tool <names...>", "Tool(s) to serve").
|
|
9544
|
+
program2.command("serve").description("Serve CLI tools as an MCP server (cli2mcp bridge)").requiredOption("--tool <names...>", "Tool(s) to serve").addHelpText("after", `
|
|
9545
|
+
This command is meant to be used as an MCP server, not run directly.
|
|
9546
|
+
Add it to your MCP client config (e.g. ~/.claude.json):
|
|
9547
|
+
|
|
9548
|
+
{
|
|
9549
|
+
"mcpServers": {
|
|
9550
|
+
"my-tools": {
|
|
9551
|
+
"type": "stdio",
|
|
9552
|
+
"command": "mtpcli",
|
|
9553
|
+
"args": ["serve", "--tool", "my-cli-tool"]
|
|
9554
|
+
}
|
|
9555
|
+
}
|
|
9556
|
+
}
|
|
9557
|
+
|
|
9558
|
+
Any CLI tool on your PATH that supports --describe can be served.
|
|
9559
|
+
Multiple tools can be combined into a single MCP server:
|
|
9560
|
+
|
|
9561
|
+
mtpcli serve --tool tool1 --tool tool2`).action(async (opts) => {
|
|
9562
|
+
if (process.stdin.isTTY) {
|
|
9563
|
+
process.stderr.write(`Error: 'mtpcli serve' is an MCP server and should not be run directly.
|
|
9564
|
+
` + `Add it to your MCP client config instead. For example, in ~/.claude.json:
|
|
9565
|
+
|
|
9566
|
+
` + ` {
|
|
9567
|
+
` + ` "mcpServers": {
|
|
9568
|
+
` + ` "my-tools": {
|
|
9569
|
+
` + ` "type": "stdio",
|
|
9570
|
+
` + ` "command": "mtpcli",
|
|
9571
|
+
` + ` "args": ["serve", "--tool", ${JSON.stringify(opts.tool[0] ?? "my-cli-tool")}]
|
|
9572
|
+
` + ` }
|
|
9573
|
+
` + ` }
|
|
9574
|
+
` + ` }
|
|
9575
|
+
|
|
9576
|
+
` + `Run 'mtpcli serve --help' for more details.
|
|
9577
|
+
`);
|
|
9578
|
+
process.exit(1);
|
|
9579
|
+
}
|
|
9545
9580
|
const { run: run5 } = await Promise.resolve().then(() => (init_serve(), exports_serve));
|
|
9546
9581
|
await run5(opts.tool);
|
|
9547
9582
|
});
|