@mcp-s/cli 0.0.11 → 0.0.13

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/README.md CHANGED
@@ -76,7 +76,7 @@ mcp-s-cli call <tool_name> '{"param": "value"}'
76
76
  mcp-s-cli [options] List all tools
77
77
  mcp-s-cli [options] info Show server details
78
78
  mcp-s-cli [options] info <tool> Show schema for a specific tool
79
- mcp-s-cli [options] grep <pattern> Search tools by glob pattern
79
+ mcp-s-cli [options] grep <query> Search tools by name
80
80
  mcp-s-cli [options] call <tool> Call a tool (reads JSON args from stdin)
81
81
  mcp-s-cli [options] call <tool> <json> Call a tool with inline JSON arguments
82
82
  mcp-s-cli init [--org <org>] [--base-url <url>] [...] Initialize global config
@@ -130,13 +130,13 @@ server
130
130
  ### Search Tools
131
131
 
132
132
  ```bash
133
- # Find tools matching a glob pattern
134
- $ mcp-s-cli grep "*ticket*"
133
+ # Find tools by name (case-insensitive substring match)
134
+ $ mcp-s-cli grep ticket
135
135
  create_ticket
136
136
  update_ticket
137
137
 
138
138
  # With descriptions
139
- $ mcp-s-cli grep "*search*" -d
139
+ $ mcp-s-cli grep search -d
140
140
  search_issues - Search Jira issues by query
141
141
  ```
142
142
 
@@ -406,7 +406,7 @@ Commands:
406
406
  mcp-s-cli # List all tools
407
407
  mcp-s-cli info # Show server details
408
408
  mcp-s-cli info <tool> # Get tool schema
409
- mcp-s-cli grep "<pattern>" # Search tools by name
409
+ mcp-s-cli grep <query> # Search tools by name
410
410
  mcp-s-cli call <tool> # Call tool (stdin for JSON args)
411
411
  mcp-s-cli call <tool> '{}' # Call tool with inline JSON
412
412
 
@@ -446,7 +446,7 @@ Each CLI invocation connects to the single configured server.
446
446
  | Command | Behaviour |
447
447
  | ---------------------------- | --------------------------------- |
448
448
  | `mcp-s-cli` (list all) | Connects to the configured server |
449
- | `mcp-s-cli grep "<pattern>"` | Connects to the configured server |
449
+ | `mcp-s-cli grep <query>` | Connects to the configured server |
450
450
  | `mcp-s-cli info` | Connects to the configured server |
451
451
  | `mcp-s-cli info <tool>` | Connects to the configured server |
452
452
  | `mcp-s-cli call <tool> '{}'` | Connects to the configured server |
package/SKILL.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: mcp-s-cli
3
- description: Interface for MCP (Model Context Protocol) servers via CLI. Use when you need to interact with external tools, APIs, or data sources through MCP servers.
3
+ description: Use when you need to interact with external tools, APIs, or data sources through MCP servers.
4
4
  ---
5
5
 
6
6
  # mcp-s-cli
@@ -9,17 +9,17 @@ Access a single MCP server through the command line. MCP enables interaction wit
9
9
 
10
10
  ## Commands
11
11
 
12
- | Command | Output |
13
- | -------------------------------- | --------------------------------------------------- |
14
- | `mcp-s-cli` | List all available tools |
15
- | `mcp-s-cli info <tool>` | Get tool JSON schema |
16
- | `mcp-s-cli grep "<pattern>"` | Search tools by name (names only, not descriptions) |
17
- | `mcp-s-cli call <tool>` | Call tool (reads JSON from stdin if no args) |
18
- | `mcp-s-cli call <tool> '<json>'` | Call tool with arguments |
12
+ | Command | Output |
13
+ | -------------------------------- | ------------------------------------------------- |
14
+ | `mcp-s-cli` | List all available tools |
15
+ | `mcp-s-cli info <tool>` | Get tool JSON schema |
16
+ | `mcp-s-cli grep <query>` | Search tools by name (case-insensitive substring) |
17
+ | `mcp-s-cli call <tool>` | Call tool (reads JSON from stdin if no args) |
18
+ | `mcp-s-cli call <tool> '<json>'` | Call tool with arguments |
19
19
 
20
20
  ## Workflow
21
21
 
22
- 1. **Discover**: `mcp-s-cli grep "<pattern>"` → find tools by keyword; fall back to `mcp-s-cli` only when you need a full inventory
22
+ 1. **Discover**: `mcp-s-cli grep <query>` → find tools by keyword; fall back to `mcp-s-cli` only when you need a full inventory
23
23
  2. **Inspect**: `mcp-s-cli info <tool>` → get full JSON schema
24
24
  3. **Execute**: `mcp-s-cli call <tool> '<json>'` → run with arguments
25
25
 
@@ -29,7 +29,7 @@ Every command consumes tokens. Pick the cheapest operation that gets the job don
29
29
 
30
30
  ### Discovery: start narrow
31
31
 
32
- - **`grep "<pattern>"`** — cheapest. Use when you can guess a keyword from the user's request (e.g., "read a github file" → `grep "file"` or `grep "content"`).
32
+ - **`grep <query>`** — cheapest. Use when you can guess a keyword from the user's request (e.g., "read a github file" → `grep file` or `grep content`).
33
33
  - **`mcp-s-cli`** (names only) — moderate. Use when you need a full inventory (e.g., "what tools do I have?" or "analyze logs from all tools").
34
34
  - **`mcp-s-cli -d`** (names + descriptions) — most expensive. Use only when names alone aren't enough to pick the right tool.
35
35
 
@@ -41,11 +41,21 @@ Every command consumes tokens. Pick the cheapest operation that gets the job don
41
41
  - **Pipe output** through shell tools (`head`, `grep`, `jq`) to trim large responses before they enter context.
42
42
  - Never fetch a full list when the user only needs a few fields (names, links, IDs).
43
43
 
44
+ ### When a filter produces no output
45
+
46
+ When you pipe through a filter and get empty output, **do not** fall back to the raw unfiltered call. Use the **probe-then-filter** pattern:
47
+
48
+ 1. **Probe**: fetch a _single_ item (e.g., `limit: 1`, or a dedicated get-one tool) without any pipe.
49
+ 2. **Learn**: read the response to understand the actual field names, nesting, and types.
50
+ 3. **Re-run**: call the bulk tool again with a corrected filter based on what you learned.
51
+
44
52
  ### Decision heuristic
45
53
 
46
54
  - User mentions a specific tool or domain keyword → `grep` for it.
47
55
  - User asks a broad question across all tools → list tools first, then act.
56
+ - Task involves multiple items of the same type → use one bulk/list call, not N individual calls.
48
57
  - Tool may return large payloads → use filter params + pipe to trim output.
58
+ - Filter script produced no output → **probe one item** to learn the shape, then re-run with a corrected filter. Never fall back to the raw unfiltered call.
49
59
 
50
60
  ## Examples
51
61
 
@@ -66,7 +76,7 @@ mcp-s-cli call my-tool '{"arg-name": "arg-value"}'
66
76
  cat args.json | mcp-s-cli call my-tool
67
77
 
68
78
  # Search for tools
69
- mcp-s-cli grep "*file*"
79
+ mcp-s-cli grep file
70
80
 
71
81
  # Output is raw text (pipe-friendly)
72
82
  mcp-s-cli call read_file '{"path": "./file"}' | head -10
package/dist/SKILL.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: mcp-s-cli
3
- description: Interface for MCP (Model Context Protocol) servers via CLI. Use when you need to interact with external tools, APIs, or data sources through MCP servers.
3
+ description: Use when you need to interact with external tools, APIs, or data sources through MCP servers.
4
4
  ---
5
5
 
6
6
  # mcp-s-cli
@@ -9,17 +9,17 @@ Access a single MCP server through the command line. MCP enables interaction wit
9
9
 
10
10
  ## Commands
11
11
 
12
- | Command | Output |
13
- | -------------------------------- | --------------------------------------------------- |
14
- | `mcp-s-cli` | List all available tools |
15
- | `mcp-s-cli info <tool>` | Get tool JSON schema |
16
- | `mcp-s-cli grep "<pattern>"` | Search tools by name (names only, not descriptions) |
17
- | `mcp-s-cli call <tool>` | Call tool (reads JSON from stdin if no args) |
18
- | `mcp-s-cli call <tool> '<json>'` | Call tool with arguments |
12
+ | Command | Output |
13
+ | -------------------------------- | ------------------------------------------------- |
14
+ | `mcp-s-cli` | List all available tools |
15
+ | `mcp-s-cli info <tool>` | Get tool JSON schema |
16
+ | `mcp-s-cli grep <query>` | Search tools by name (case-insensitive substring) |
17
+ | `mcp-s-cli call <tool>` | Call tool (reads JSON from stdin if no args) |
18
+ | `mcp-s-cli call <tool> '<json>'` | Call tool with arguments |
19
19
 
20
20
  ## Workflow
21
21
 
22
- 1. **Discover**: `mcp-s-cli grep "<pattern>"` → find tools by keyword; fall back to `mcp-s-cli` only when you need a full inventory
22
+ 1. **Discover**: `mcp-s-cli grep <query>` → find tools by keyword; fall back to `mcp-s-cli` only when you need a full inventory
23
23
  2. **Inspect**: `mcp-s-cli info <tool>` → get full JSON schema
24
24
  3. **Execute**: `mcp-s-cli call <tool> '<json>'` → run with arguments
25
25
 
@@ -29,7 +29,7 @@ Every command consumes tokens. Pick the cheapest operation that gets the job don
29
29
 
30
30
  ### Discovery: start narrow
31
31
 
32
- - **`grep "<pattern>"`** — cheapest. Use when you can guess a keyword from the user's request (e.g., "read a github file" → `grep "file"` or `grep "content"`).
32
+ - **`grep <query>`** — cheapest. Use when you can guess a keyword from the user's request (e.g., "read a github file" → `grep file` or `grep content`).
33
33
  - **`mcp-s-cli`** (names only) — moderate. Use when you need a full inventory (e.g., "what tools do I have?" or "analyze logs from all tools").
34
34
  - **`mcp-s-cli -d`** (names + descriptions) — most expensive. Use only when names alone aren't enough to pick the right tool.
35
35
 
@@ -41,11 +41,21 @@ Every command consumes tokens. Pick the cheapest operation that gets the job don
41
41
  - **Pipe output** through shell tools (`head`, `grep`, `jq`) to trim large responses before they enter context.
42
42
  - Never fetch a full list when the user only needs a few fields (names, links, IDs).
43
43
 
44
+ ### When a filter produces no output
45
+
46
+ When you pipe through a filter and get empty output, **do not** fall back to the raw unfiltered call. Use the **probe-then-filter** pattern:
47
+
48
+ 1. **Probe**: fetch a _single_ item (e.g., `limit: 1`, or a dedicated get-one tool) without any pipe.
49
+ 2. **Learn**: read the response to understand the actual field names, nesting, and types.
50
+ 3. **Re-run**: call the bulk tool again with a corrected filter based on what you learned.
51
+
44
52
  ### Decision heuristic
45
53
 
46
54
  - User mentions a specific tool or domain keyword → `grep` for it.
47
55
  - User asks a broad question across all tools → list tools first, then act.
56
+ - Task involves multiple items of the same type → use one bulk/list call, not N individual calls.
48
57
  - Tool may return large payloads → use filter params + pipe to trim output.
58
+ - Filter script produced no output → **probe one item** to learn the shape, then re-run with a corrected filter. Never fall back to the raw unfiltered call.
49
59
 
50
60
  ## Examples
51
61
 
@@ -66,7 +76,7 @@ mcp-s-cli call my-tool '{"arg-name": "arg-value"}'
66
76
  cat args.json | mcp-s-cli call my-tool
67
77
 
68
78
  # Search for tools
69
- mcp-s-cli grep "*file*"
79
+ mcp-s-cli grep file
70
80
 
71
81
  # Output is raw text (pipe-friendly)
72
82
  mcp-s-cli call read_file '{"path": "./file"}' | head -10
package/dist/daemon.js CHANGED
@@ -414,7 +414,7 @@ import { join as join2 } from "path";
414
414
  import { fileURLToPath } from "url";
415
415
 
416
416
  // src/version.ts
417
- var VERSION = "0.0.11";
417
+ var VERSION = "0.0.13";
418
418
 
419
419
  // src/client.ts
420
420
  function getRetryConfig(settings) {
package/dist/index.js CHANGED
@@ -1298,7 +1298,7 @@ async function cleanupOrphanedDaemons() {
1298
1298
  }
1299
1299
 
1300
1300
  // src/version.ts
1301
- var VERSION = "0.0.11";
1301
+ var VERSION = "0.0.13";
1302
1302
 
1303
1303
  // src/client.ts
1304
1304
  function getRetryConfig(settings) {
@@ -2183,32 +2183,8 @@ function configCommand(opts) {
2183
2183
  }
2184
2184
 
2185
2185
  // src/commands/grep.ts
2186
- function globToRegex(pattern) {
2187
- let escaped = "";
2188
- let i = 0;
2189
- while (i < pattern.length) {
2190
- const char = pattern[i];
2191
- if (char === "*" && pattern[i + 1] === "*") {
2192
- escaped += ".*";
2193
- i += 2;
2194
- while (pattern[i] === "*") {
2195
- i++;
2196
- }
2197
- } else if (char === "*") {
2198
- escaped += "[^/]*";
2199
- i += 1;
2200
- } else if (char === "?") {
2201
- escaped += "[^/]";
2202
- i += 1;
2203
- } else if ("[.+^${}()|\\]".includes(char)) {
2204
- escaped += `\\${char}`;
2205
- i += 1;
2206
- } else {
2207
- escaped += char;
2208
- i += 1;
2209
- }
2210
- }
2211
- return new RegExp(`^${escaped}$`, "i");
2186
+ function matchesToolName(name, query) {
2187
+ return name.toLowerCase().includes(query.toLowerCase());
2212
2188
  }
2213
2189
  async function grepCommand(options) {
2214
2190
  let loaded;
@@ -2220,8 +2196,7 @@ async function grepCommand(options) {
2220
2196
  }
2221
2197
  const { serverConfig, settings } = loaded;
2222
2198
  const serverLabel = "server";
2223
- const pattern = globToRegex(options.pattern);
2224
- debug(`Searching for pattern "${options.pattern}"`);
2199
+ debug(`Searching for "${options.pattern}"`);
2225
2200
  let connection = null;
2226
2201
  const allResults = [];
2227
2202
  let searchError;
@@ -2229,7 +2204,7 @@ async function grepCommand(options) {
2229
2204
  connection = await getConnection(serverLabel, serverConfig, settings);
2230
2205
  const tools = await connection.listTools();
2231
2206
  for (const tool of tools) {
2232
- if (pattern.test(tool.name)) {
2207
+ if (matchesToolName(tool.name, options.pattern)) {
2233
2208
  allResults.push({ server: serverLabel, tool });
2234
2209
  }
2235
2210
  }
@@ -2247,8 +2222,9 @@ async function grepCommand(options) {
2247
2222
  }
2248
2223
  if (allResults.length === 0) {
2249
2224
  console.log(`No tools found matching "${options.pattern}"`);
2250
- console.log(" Tip: Pattern matches tool names only");
2251
- console.log(` Tip: Use '*' for wildcards, e.g. '*file*' or 'read_*'`);
2225
+ console.log(
2226
+ " Tip: Search matches tool names only (substring, case-insensitive)"
2227
+ );
2252
2228
  console.log(` Tip: Run 'mcp-s-cli' to list all available tools`);
2253
2229
  return;
2254
2230
  }
@@ -3313,7 +3289,7 @@ Usage:
3313
3289
  mcp-s-cli [options] List all tools
3314
3290
  mcp-s-cli [options] info Show server details
3315
3291
  mcp-s-cli [options] info <tool> Show tool schema
3316
- mcp-s-cli [options] grep <pattern> Search tools by glob pattern
3292
+ mcp-s-cli [options] grep <query> Search tools by name
3317
3293
  mcp-s-cli [options] call <tool> Call tool (reads JSON from stdin if no args)
3318
3294
  mcp-s-cli [options] call <tool> <json> Call tool with JSON arguments
3319
3295
  mcp-s-cli init --org <org> [--mcp <id>] [--toolkit <tk>] [--user-access-key <key>] Initialize with org
@@ -3344,14 +3320,14 @@ Options:
3344
3320
  --user-access-key <key> User access key \u2014 triggers stdio mode (used with init)
3345
3321
 
3346
3322
  Output:
3347
- mcp-s-cli/info/grep Human-readable text to stdout
3323
+ mcp-s-cli/info/grep Human-readable text to stdout
3348
3324
  call Raw JSON to stdout (for piping)
3349
3325
  Errors Always to stderr
3350
3326
 
3351
3327
  Examples:
3352
3328
  mcp-s-cli # List all tools
3353
3329
  mcp-s-cli -d # List with descriptions
3354
- mcp-s-cli grep "*file*" # Search for file tools
3330
+ mcp-s-cli grep file # Search for file tools
3355
3331
  mcp-s-cli info # Show server details
3356
3332
  mcp-s-cli info read_file # Show tool schema
3357
3333
  mcp-s-cli call read_file '{}' # Call tool
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcp-s/cli",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "description": "A lightweight CLI for connecting AI agents to the Webrix MCP Gateway",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",