@modeltoolsprotocol/mtpcli 0.3.0 → 0.3.1

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.
Files changed (3) hide show
  1. package/README.md +51 -28
  2. package/dist/index.js +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -6,26 +6,20 @@ The command-line interface for the [Model Tools Protocol](https://github.com/mod
6
6
 
7
7
  LLM agents need to discover and use tools. Right now there are two worlds:
8
8
 
9
- **CLI tools** are the backbone of software development. They're composable (`|`), scriptable, version-controlled, and work everywhere. But LLMs can't discover what a CLI does - they have to parse `--help` text, guess at arguments, and hope for the best.
9
+ **CLI tools** are the backbone of software development. They're composable (`|`), scriptable, version-controlled, and work everywhere. But LLMs can't discover what a CLI does. They have to parse `--help` text, guess at arguments, and hope for the best.
10
10
 
11
- **MCP (Model Context Protocol)** solves discovery beautifully. Tools declare typed schemas, and LLM hosts discover them via a structured handshake. But MCP requires running a server process, speaking JSON-RPC over stdio/SSE, and building within the MCP ecosystem. Your existing CLI tools don't get any of this for free.
12
-
13
- These are both good ideas with real tradeoffs:
11
+ **MCP (Model Context Protocol)** solves discovery beautifully. Tools declare typed schemas, and LLM hosts discover them via a structured handshake. But MCP tools aren't composable. Each invocation goes through the model. You can't pipe one MCP tool's output into another. You can't script them without an LLM in the loop.
14
12
 
15
13
  | | CLI tools | MCP tools |
16
14
  |---|---|---|
17
- | **Composability** | First-class. Pipes, shell scripts, xargs -50 years of Unix | Requires an orchestrator or agent framework |
15
+ | **Composability** | First-class. Pipes, shell scripts, xargs. 50 years of Unix | Requires an orchestrator or agent framework |
18
16
  | **Discovery** | Poor. Parse `--help` and hope | Excellent. Typed schemas via handshake |
19
17
  | **Runtime** | Any shell, anywhere | Needs an MCP host (Claude Desktop, etc.) |
20
18
  | **Deployment** | `brew install`, `cargo install`, a binary in PATH | Run a server process, configure the host |
21
19
  | **Interop** | Pipes to anything | Talks to MCP clients only |
22
- | **Scriptable without an LLM** | Yes -that's the whole point of CLIs | Not really -designed for LLM interaction |
23
- | **Streaming / subscriptions** | Limited (stdout streaming) | Built-in (SSE, notifications) |
24
- | **Stateful interaction** | Stateless by design (each invocation is fresh) | Stateful sessions with context |
20
+ | **Scriptable without an LLM** | Yes, that's the whole point of CLIs | Not really, designed for LLM interaction |
25
21
  | **Adoption cost** | One flag/decorator | New protocol, server scaffolding, SDK |
26
22
 
27
- MCP is the right choice when you need stateful sessions, streaming, or deep integration with an LLM host. CLIs are the right choice when you want composability, scriptability, and zero infrastructure.
28
-
29
23
  The gap is discovery. `mtpcli` fills it.
30
24
 
31
25
  ## Install
@@ -34,8 +28,52 @@ The gap is discovery. `mtpcli` fills it.
34
28
  npm install -g @modeltoolsprotocol/mtpcli
35
29
  ```
36
30
 
31
+ ## What it does
32
+
33
+ **mtpcli** bridges the gap between CLI tools and MCP servers. It turns any `--describe` CLI into an MCP server, turns any MCP server into a composable CLI, and handles discovery, auth, and validation along the way.
34
+
37
35
  ## Usage
38
36
 
37
+ ### Serve CLI tools over MCP
38
+
39
+ Any CLI that supports `--describe` becomes an MCP server:
40
+
41
+ ```bash
42
+ $ mtpcli serve --tool atlasctl --tool mytool
43
+
44
+ mtpcli serve: serving 6 tool(s) from 2 CLI tool(s)
45
+ - atlasctl__confluence page get
46
+ - atlasctl__config set
47
+ - atlasctl__config get
48
+ - mytool__convert
49
+ ...
50
+ ```
51
+
52
+ Drop it into your Claude Desktop config and it works like any other MCP server. The bridge reads `--describe`, translates commands to MCP tools, and shells out to the real CLI when the host calls a tool.
53
+
54
+ ### Wrap an MCP server as a CLI
55
+
56
+ Atlassian ships an MCP server at `mcp.atlassian.com`. With `mtpcli wrap`, it's a CLI:
57
+
58
+ ```bash
59
+ # Discover what tools the server offers
60
+ $ mtpcli wrap --url "https://mcp.atlassian.com/v1/mcp" --describe
61
+
62
+ # Fetch a Confluence page
63
+ $ mtpcli wrap --url "https://mcp.atlassian.com/v1/mcp" \
64
+ getConfluencePage -- --cloudId "$CLOUD_ID" --pageId 12345 --contentFormat markdown
65
+
66
+ # Pipe it into jq, grep, or anything else
67
+ $ mtpcli wrap --url "https://mcp.atlassian.com/v1/mcp" \
68
+ getConfluencePage -- --cloudId "$CLOUD_ID" --pageId 12345 --contentFormat markdown \
69
+ | jq -r '.body'
70
+
71
+ # Works with stdio servers too
72
+ $ mtpcli wrap --server "npx @mcp/server-github" --describe
73
+ ```
74
+
75
+ The 2,500+ MCP servers people have built? They're all CLI tools now. Pipe their output, use them in scripts, compose them with other tools.
76
+
39
77
  ### Search for tools and commands
40
78
 
41
79
  ```bash
@@ -52,7 +90,7 @@ mtpcli search --scan-path "git commit"
52
90
  ### Authenticate with a tool
53
91
 
54
92
  ```bash
55
- # OAuth2 login
93
+ # OAuth2 login (opens browser, handles callback)
56
94
  mtpcli auth login mytool
57
95
 
58
96
  # API key / bearer token login
@@ -68,22 +106,7 @@ eval $(mtpcli auth env mytool)
68
106
  mtpcli auth logout mytool
69
107
  ```
70
108
 
71
- ### Serve tools over MCP
72
-
73
- ```bash
74
- # Start an MCP server that bridges describe-compatible tools
75
- mtpcli serve --tool mytool --tool anothertool
76
- ```
77
-
78
- ### Wrap an MCP server as a CLI
79
-
80
- ```bash
81
- # Describe an MCP server's tools
82
- mtpcli wrap --server "npx @mcp/server-github" --describe
83
-
84
- # Call a tool on an MCP server
85
- mtpcli wrap --server "npx @mcp/server-github" search_repos -- --query mtpcli
86
- ```
109
+ See [AUTH.md](AUTH.md) for details on token storage, usage patterns, and bridge integration.
87
110
 
88
111
  ### Validate a tool's --describe output
89
112
 
@@ -114,7 +137,7 @@ mtpcli completions fish mytool | source
114
137
  ### Describe self
115
138
 
116
139
  ```bash
117
- # Output mtpcli's own describe schema (JSON)
140
+ # mtpcli is itself an MTP-compliant tool
118
141
  mtpcli --describe
119
142
  ```
120
143
 
package/dist/index.js CHANGED
@@ -10564,7 +10564,7 @@ function cleanJson(obj) {
10564
10564
  }
10565
10565
 
10566
10566
  // src/index.ts
10567
- var VERSION3 = "0.3.0";
10567
+ var VERSION3 = "0.3.1";
10568
10568
  function selfDescribe() {
10569
10569
  const schema = {
10570
10570
  name: "mtpcli",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modeltoolsprotocol/mtpcli",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "bin": {