@master4n/master-cli 3.0.3 → 3.0.4

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
@@ -9,7 +9,7 @@
9
9
  ![License](https://img.shields.io/npm/l/%40master4n%2Fmaster-cli)
10
10
  ![Owner](https://img.shields.io/badge/Owner-Master4Novice-orange?style=flat)
11
11
 
12
- **Master CLI for developers and AI agents.** 43 headless, JSON-first commands in
12
+ **Master CLI for developers and AI agents.** 51 headless, JSON-first commands in
13
13
  three families: **token savers** (extract exactly what you need — one JSON field,
14
14
  a line range, a file outline — instead of dumping whole files into context),
15
15
  **exact computation** (BigInt math, semver, cron, regex, timezones — verified
@@ -54,6 +54,27 @@ npx -y @master4n/master-cli epoch 1622547800 --json
54
54
  - **Self-describing** — `mfn capabilities --json` lists every command, and
55
55
  [`llms.txt`](./llms.txt) documents the full agent contract.
56
56
 
57
+ ## MCP server (built in)
58
+
59
+ For agent clients that can't run shell commands, `mfn mcp` serves the whole
60
+ toolkit over the [Model Context Protocol](https://modelcontextprotocol.io)
61
+ (stdio transport, zero extra dependencies):
62
+
63
+ ```jsonc
64
+ // e.g. .mcp.json / claude_desktop_config.json / any MCP client
65
+ {
66
+ "mcpServers": {
67
+ "mfn": { "command": "npx", "args": ["-y", "@master4n/master-cli", "mcp"] }
68
+ }
69
+ }
70
+ ```
71
+
72
+ Three tools: `mfn_capabilities` (the manifest), `mfn_run` (`{command, args[]}` —
73
+ runs any catalogued command and returns its single JSON object, guardrails
74
+ included), and `mfn_help` (per-command flags). `update` is deny-listed so an
75
+ MCP-only client can never install packages. `mfn mcp --json` describes the
76
+ server without starting it.
77
+
57
78
  ## Quick start
58
79
 
59
80
  ```sh
@@ -63,7 +84,7 @@ mfn -v # version
63
84
  mfn capabilities --json # machine-readable manifest of all commands
64
85
  ```
65
86
 
66
- ## Commands (50)
87
+ ## Commands (51)
67
88
 
68
89
  Run `mfn capabilities` for the grouped list, `mfn <command> --help` for flags.
69
90
 
@@ -125,6 +146,7 @@ Run `mfn capabilities` for the grouped list, `mfn <command> --help` for flags.
125
146
  | `id` / `hash` / `encode` / `random` | UUID v4/v7/nano · digests · codecs · CSPRNG | `mfn id -t uuid7 -n 3 --json` |
126
147
  | `sc` / `cts` | Fuzzy file find · directory tree | `mfn sc service --json` |
127
148
  | `capabilities` / `update` | Machine-readable manifest · self-update | `mfn capabilities --json` |
149
+ | `mcp` | Serve every command over the Model Context Protocol (stdio) | `mfn mcp` |
128
150
 
129
151
  ### Examples
130
152
 
package/SECURITY.md CHANGED
@@ -38,7 +38,7 @@ use any flag that exists:
38
38
 
39
39
  | Guardrail | Commands | What it prevents |
40
40
  | --------- | -------- | ---------------- |
41
- | **Sensitive-path refusal** (`SensitivePath`, exit 2) | `lines` `json` `schema` `diff` `freq` `regex -f` | Returning the CONTENT of credential stores: `~/.ssh`, `~/.aws`, `~/.gnupg`, `~/.kube`, `.env*`, `*.pem`, `*.key`, `id_rsa*`, `.npmrc`, `.netrc`, `shadow`, … An agent's context window is a log that never rotates. |
41
+ | **Sensitive-path refusal** (`SensitivePath`, exit 2) | `lines` `json` `schema` `diff` `freq` `regex -f` `hash -f` | Returning the CONTENT of credential stores: `~/.ssh`, `~/.aws`, `~/.gnupg`, `~/.kube`, `.env*`, `*.pem`, `*.key`, `id_rsa*`, `.npmrc`, `.netrc`, `shadow`, … An agent's context window is a log that never rotates. `hash -f` is included because a digest of a low-entropy secrets file can be brute-forced offline. |
42
42
  | **Clipboard secret redaction** | `clip` (read) | Passwords/tokens pasted through the clipboard (password managers). Secret-shaped content (private-key blocks, JWTs, AWS/GitHub/Slack/Google/npm/`sk-` tokens) is withheld with `redacted:true`. |
43
43
  | **Env value scanning** | `env` | Redacts by NAME pattern (key/token/secret/…) **and** by VALUE shape — an innocently named variable holding a JWT is still redacted. `mfn env` with no names lists names only. |
44
44
  | **Dotenv never reads values** | `dotenv` | Compares KEY presence between `.env` and `.env.example`; values are never parsed, stored, or returned. |
@@ -48,4 +48,5 @@ import procs from './procs';
48
48
  import disk from './disk';
49
49
  import trash from './trash';
50
50
  import dns from './dns';
51
- export { cts, sc, deco, date, epoch, killProcess, update, capabilities, id, hash, encode, random, port, jsonCmd, count, lines, have, sys, repo, calc, semver, caseCmd, cron, diff, env, size, ext, freq, regex, url, ip, escapeCmd, schema, outlineCmd, imports, replace, recent, pkgCmd, dotenv, wait, ports, http, base, clip, notify, openCmd, procs, disk, trash, dns, };
51
+ import mcp from './mcp';
52
+ export { cts, sc, deco, date, epoch, killProcess, update, capabilities, mcp, id, hash, encode, random, port, jsonCmd, count, lines, have, sys, repo, calc, semver, caseCmd, cron, diff, env, size, ext, freq, regex, url, ip, escapeCmd, schema, outlineCmd, imports, replace, recent, pkgCmd, dotenv, wait, ports, http, base, clip, notify, openCmd, procs, disk, trash, dns, };
@@ -0,0 +1,7 @@
1
+ declare const mcp: {
2
+ command: string;
3
+ describe: string;
4
+ builder: (yargs: any) => any;
5
+ handler: (argv: any) => Promise<void>;
6
+ };
7
+ export default mcp;