Skip to content

Commit f22ce27

Browse files
committed
docs: update docs for v0.3.0 stack files release
- README: add stack files section with mcpm.yaml example, 4 new commands in command table, update agent mode to 9 tools - ARCHITECTURE: add stack/ module, export/lock/up/diff commands, update test count to 812+ - CLAUDE.md: add V1.3 shipped section with all stack file features, update tool count and command list - TODOS: mark #3 (backup) as resolved, add #15 (secret storage) - Bump version to v0.3.0
1 parent 3b22787 commit f22ce27

5 files changed

Lines changed: 88 additions & 16 deletions

File tree

CLAUDE.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,11 @@ Build the **open-source, community-owned npm+npm_audit** for MCP:
129129
- **Local storage**: JSON files in `~/.mcpm/` (servers.json, scans.json, cache/)
130130
- **Testing**: Vitest + @vitest/coverage-v8 (80% line, 75% branch thresholds)
131131
- **Build**: tsup (TypeScript → JS)
132-
- **MCP server**: `mcpm serve` exposes 8 tools via `@modelcontextprotocol/sdk` (stdio transport)
132+
- **MCP server**: `mcpm serve` exposes 9 tools via `@modelcontextprotocol/sdk` (stdio transport)
133133
- **Commands**: `mcpm search`, `mcpm install`, `mcpm list`, `mcpm remove`, `mcpm info`,
134134
`mcpm audit`, `mcpm update`, `mcpm doctor`, `mcpm init`, `mcpm import`, `mcpm serve`,
135-
`mcpm disable`, `mcpm enable`, `mcpm alias`, `mcpm completions`
135+
`mcpm disable`, `mcpm enable`, `mcpm alias`, `mcpm completions`,
136+
`mcpm export`, `mcpm lock`, `mcpm up`, `mcpm diff`
136137

137138
### Registry API (upstream, not ours)
138139

@@ -218,6 +219,27 @@ When community quality signals require a backend (user reviews, aggregated telem
218219
- [x] Client ID validation before unsafe casts
219220
- [x] Security hardening: tool path allowlist, health check sandboxing
220221

222+
### V1.3 (stack files — SHIPPED v0.3.0)
223+
224+
- [x] `mcpm export` — dump installed servers to mcpm.yaml stack file format
225+
- [x] `mcpm lock` — resolve semver ranges from registry, trust assess, write mcpm-lock.yaml
226+
- [x] `mcpm up` — batch install from mcpm.yaml with trust policy enforcement
227+
- [x] `mcpm diff` — compare installed state vs declared state (colored output + --json)
228+
- [x] `mcpm_up` MCP server tool (destructiveHint: true)
229+
- [x] Stack file Zod schemas (mcpm.yaml + mcpm-lock.yaml) with YAML parse/serialize
230+
- [x] Semver version resolution (caret + tilde ranges via `semver` package)
231+
- [x] Trust policy enforcement with normalized percentage comparison
232+
- [x] .env file parser for env var resolution (process.env → .env → default → prompt)
233+
- [x] Parallel registry resolution, sequential config writes
234+
- [x] Single .bak snapshot before batch writes
235+
- [x] Per-server error isolation (failures collected, others continue)
236+
- [x] URL server support (Cursor-only, warn for other clients)
237+
- [x] --dry-run, --ci, --profile, --strict, --yes flags on `mcpm up`
238+
- [x] --strict --ci requires --yes for unattended server removal
239+
- [x] Path traversal protection on mcpm_up MCP tool input
240+
- [x] Prototype poisoning protection in .env parser
241+
- [x] Shared isEnoent() utility extracted to src/utils/fs.ts
242+
221243
### V1.5 (community trust)
222244

223245
- [ ] `mcpm publish` — submit to official registry with mandatory security scan gate
@@ -233,7 +255,6 @@ When community quality signals require a backend (user reviews, aggregated telem
233255
- [ ] Dependency graph (which servers compose well together)
234256
- [ ] AI-generated docs (Claude reads source → writes human-friendly tool docs)
235257
- [ ] Compatibility matrix (auto-tested)
236-
- [ ] Semver-aware version resolution + lock files
237258

238259
---
239260

@@ -289,7 +310,7 @@ the registry concept end-to-end before we launch publicly.
289310
290311
├── CLI (terminal) ├── MCP Server (stdio)
291312
│ mcpm search/install/... │ mcpm serve
292-
│ │ 8 tools via JSON-RPC
313+
│ │ 9 tools via JSON-RPC
293314
▼ ▼
294315
mcpm core (Node.js, npm: @getmcpm/cli, bin: mcpm)
295316

README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,33 @@ $ mcpm doctor
104104
[pass] 3 servers installed, 0 with errors
105105
```
106106

107+
### Stack files: docker-compose for MCP
108+
109+
Declare your project's MCP servers in `mcpm.yaml`, lock versions with trust snapshots, and let every team member replicate the setup with one command.
110+
111+
```bash
112+
mcpm export > mcpm.yaml # dump current setup
113+
mcpm lock # resolve versions + trust snapshot
114+
mcpm up # install everything from mcpm.yaml
115+
mcpm diff # compare installed vs declared state
116+
```
117+
118+
Stack files include a trust policy. If a server's trust score drops below the threshold, `mcpm up` blocks it.
119+
120+
```yaml
121+
version: "1"
122+
policy:
123+
minTrustScore: 60
124+
blockOnScoreDrop: true
125+
servers:
126+
io.github.domdomegg/filesystem-mcp:
127+
version: "^1.0.0"
128+
io.github.modelcontextprotocol/servers-github:
129+
version: "1.2.3"
130+
env:
131+
GITHUB_TOKEN: { required: true, secret: true }
132+
```
133+
107134
### Starter packs
108135
109136
Get a working MCP setup in one command.
@@ -154,6 +181,10 @@ Without an external scanner installed, the maximum possible score is 80/100. The
154181
| `mcpm enable <name>` | Re-enable a previously disabled MCP server |
155182
| `mcpm import` | Import existing MCP servers from client config files |
156183
| `mcpm alias` | Create short aliases for long MCP server names |
184+
| `mcpm export` | Export installed servers as an mcpm.yaml stack file |
185+
| `mcpm lock` | Resolve versions and create mcpm-lock.yaml with trust snapshots |
186+
| `mcpm up` | Install all servers from mcpm.yaml with trust verification |
187+
| `mcpm diff` | Compare installed servers against mcpm.yaml and lock file |
157188
| `mcpm completions <shell>` | Generate shell completion scripts (bash, zsh, fish) |
158189
| `mcpm serve` | Start mcpm as an MCP server (stdio transport) |
159190

@@ -174,7 +205,7 @@ mcpm can run as an MCP server itself, letting AI agents search, install, and aud
174205
}
175206
```
176207

177-
This exposes 8 tools: `mcpm_search`, `mcpm_install`, `mcpm_info`, `mcpm_list`, `mcpm_remove`, `mcpm_audit`, `mcpm_doctor`, and `mcpm_setup`.
208+
This exposes 9 tools: `mcpm_search`, `mcpm_install`, `mcpm_info`, `mcpm_list`, `mcpm_remove`, `mcpm_audit`, `mcpm_doctor`, `mcpm_setup`, and `mcpm_up`.
178209

179210
The `mcpm_setup` tool takes a natural language description like "filesystem and GitHub" and handles everything: search, trust scoring, install. One tool call to assemble a working MCP toolchain.
180211

TODOS.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,8 @@
1919

2020
## Pre-launch
2121

22-
### 3. Config Backup-Before-Write
23-
**Priority:** P1
24-
**What:** Before atomic config write, copy existing config to ~/.mcpm/backups/{client}.{timestamp}.json. Keep last 5 backups.
25-
**Why:** If a config write produces malformed JSON, Claude Desktop/Cursor may fail to parse and lose all MCP server configs. Backup enables recovery.
26-
**Depends on:** Config adapter implementation.
22+
### 3. ~~Config Backup-Before-Write~~ DONE (2026-04-06)
23+
**Resolution:** Implemented in BaseAdapter.writeAtomic (base.ts:49). Writes .bak file before every atomic write. mcpm up takes a single .bak snapshot before batch starts (up.ts:223).
2724

2825
### 4. Cross-Platform Config Paths
2926
**Priority:** P1
@@ -63,6 +60,13 @@
6360

6461
## Post-V1
6562

63+
### 15. Encrypted Secret Storage for Stack Files
64+
**Priority:** P2
65+
**What:** Investigate alternatives to plaintext env var storage in client config files. Options: OS keychain integration, encrypted .env files, reference-only storage (pointer to secret manager).
66+
**Why:** Stack files scale team-wide. Every `mcpm up` writes secrets as plaintext JSON to client configs. With 5+ servers each needing API keys, that's 5+ plaintext secrets per developer per IDE.
67+
**Context:** Current approach (plaintext + chmod 600) is the npm/pip norm. But mcpm positions as a security tool. Plaintext secrets in 4 config files per machine is inconsistent with that positioning. Not blocking for V1.3 but matters for enterprise adoption.
68+
**Depends on:** V1.3 stack files (shipped).
69+
6670
### 14. Optional Anonymous Telemetry
6771
**Priority:** P2
6872
**What:** Add opt-in anonymous telemetry (install count, command usage, error types).

docs/ARCHITECTURE.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ mcpm/
2323
│ │ ├── enable.ts — re-enable a disabled server
2424
│ │ ├── toggle.ts — shared disable/enable logic
2525
│ │ ├── completions.ts — shell completion scripts (bash/zsh/fish)
26-
│ │ └── alias.ts — short aliases for server names
26+
│ │ ├── alias.ts — short aliases for server names
27+
│ │ ├── export.ts — export installed servers as mcpm.yaml
28+
│ │ ├── lock.ts — resolve versions + trust → mcpm-lock.yaml
29+
│ │ ├── up.ts — batch install from mcpm.yaml with trust policy
30+
│ │ └── diff.ts — compare installed vs declared state
2731
│ ├── server/
2832
│ │ ├── index.ts — MCP server setup (registerTool, stdio transport)
2933
│ │ ├── tools.ts — Zod input schemas for each tool
@@ -54,11 +58,18 @@ mcpm/
5458
│ │ ├── servers.ts — installed server registry
5559
│ │ ├── cache.ts — HTTP response cache
5660
│ │ └── aliases.ts — server name aliases (~/.mcpm/aliases.json)
61+
│ ├── stack/
62+
│ │ ├── schema.ts — Zod schemas for mcpm.yaml + mcpm-lock.yaml
63+
│ │ ├── resolve.ts — semver range resolution
64+
│ │ ├── policy.ts — trust policy enforcement
65+
│ │ ├── env.ts — .env file parser
66+
│ │ └── index.ts — public API surface
5767
│ └── utils/
5868
│ ├── output.ts — leveled output helpers
5969
│ ├── confirm.ts — confirmation prompts
6070
│ ├── format-entry.ts — format MCP server config entries
61-
│ └── format-trust.ts — format trust score display
71+
│ ├── format-trust.ts — format trust score display
72+
│ └── fs.ts — shared filesystem helpers (isEnoent)
6273
├── src/__tests__/
6374
│ ├── commands/ — 16 command test files
6475
│ ├── config/ — adapter + detector + paths tests
@@ -78,8 +89,9 @@ mcpm/
7889

7990
| Module | Purpose |
8091
|---|---|
81-
| `commands/` | 15 CLI commands, each a self-contained Commander action |
82-
| `server/` | MCP server (stdio): 8 tools wrapping CLI logic via injectable handlers |
92+
| `commands/` | 19 CLI commands, each a self-contained Commander action |
93+
| `server/` | MCP server (stdio): 9 tools wrapping CLI logic via injectable handlers |
94+
| `stack/` | Stack file schemas (mcpm.yaml/mcpm-lock.yaml), semver resolution, trust policy, .env parsing |
8395
| `registry/` | Typed HTTP client for the official MCP Registry API (v0.1 at registry.modelcontextprotocol.io) |
8496
| `config/` | OS-aware config paths, client detection, and per-client config adapters with atomic writes |
8597
| `scanner/` | Trust scoring engine: tier 1 (metadata), tier 2 (static pattern analysis), composite score |
@@ -103,6 +115,10 @@ mcpm/
103115
| `mcpm enable <name>` | Re-enable a previously disabled server |
104116
| `mcpm import` | Import existing servers from client config files |
105117
| `mcpm alias` | Create short aliases for long server names |
118+
| `mcpm export` | Export installed servers as an mcpm.yaml stack file |
119+
| `mcpm lock` | Resolve versions and create mcpm-lock.yaml with trust snapshots |
120+
| `mcpm up` | Install all servers from mcpm.yaml with trust verification |
121+
| `mcpm diff` | Compare installed servers against mcpm.yaml and lock file |
106122
| `mcpm completions <shell>` | Generate shell completion scripts (bash, zsh, fish) |
107123
| `mcpm serve` | Start mcpm as an MCP server (stdio transport) |
108124

@@ -164,7 +180,7 @@ All config writes use atomic file operations (write to `.tmp`, then `fs.rename`)
164180
## Testing
165181

166182
- **Framework**: vitest with `@vitest/coverage-v8`
167-
- **Test count**: 739+ tests
183+
- **Test count**: 812+ tests
168184
- **Coverage thresholds**: lines 80%, branches 75%
169185
- **Test locations**: `src/__tests__/` (command, config, store tests) + colocated `*.test.ts` (registry, scanner)
170186
- **Approach**: injectable `fetchImpl` for registry tests (no network calls), temp directories for config adapter tests

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@getmcpm/cli",
3-
"version": "0.2.2",
3+
"version": "0.3.0",
44
"mcpName": "io.github.getmcpm/cli",
55
"description": "MCP package manager — search, install, and audit MCP servers across Claude Desktop, Cursor, VS Code, and Windsurf",
66
"type": "module",

0 commit comments

Comments
 (0)