@steamfield/stacks-mcp 0.0.0-stage → 0.1.0

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 +119 -2
  2. package/dist/server.js +26775 -0
  3. package/package.json +26 -4
package/README.md CHANGED
@@ -1,3 +1,120 @@
1
- # Temporary Holding Version
1
+ # @steamfield/stacks-mcp
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A stdio MCP server for the stacks workflow: choose a stack, create a project, then run its
4
+ verification checks. Requires Node.js 22 or newer.
5
+
6
+ Run it with:
7
+
8
+ ```sh
9
+ npx -y @steamfield/stacks-mcp
10
+ ```
11
+
12
+ The package includes `@steamfield/stacks` as a dependency and runs its built Node entry.
13
+ No separate CLI installation or `STACKS_MCP_CLI` setting is needed.
14
+
15
+ ## Connecting a client
16
+
17
+ For [Claude Code](https://code.claude.com/docs/en/mcp):
18
+
19
+ ```sh
20
+ claude mcp add stacks -- npx -y @steamfield/stacks-mcp
21
+ ```
22
+
23
+ Add `--scope project` before `--` to save it in the project's `.mcp.json`.
24
+
25
+ For Claude Desktop, add this to `claude_desktop_config.json`:
26
+
27
+ ```json
28
+ {
29
+ "mcpServers": {
30
+ "stacks": {
31
+ "command": "npx",
32
+ "args": ["-y", "@steamfield/stacks-mcp"],
33
+ "env": {
34
+ "PATH": "<directories holding node, git and the tools your verify steps run>"
35
+ }
36
+ }
37
+ }
38
+ }
39
+ ```
40
+
41
+ Desktop does not use your shell's PATH. An absolute path to `npx` may be needed, especially
42
+ with nvm or mise. Set `env.PATH` to include the tools your project's verify steps need,
43
+ such as bun and git. The client's environment becomes every verify step's environment.
44
+
45
+ ## Tools and resources
46
+
47
+ | Tool | Input | Result |
48
+ | --- | --- | --- |
49
+ | `stacks_list` | Optional `group`: `stacks`, `fragments` or `apps` | Whole CLI listing, including rejected entries and project context |
50
+ | `stacks_new` | `stack`, absolute `dir`; optional `preset`, `with`, `without` | Whole scaffold result, including warnings, missing tools and handoff |
51
+ | `stacks_verify` | Absolute existing `dir` | Whole verify result, including step diagnostics and an optional `next` |
52
+
53
+ `list` and `new` run in the server's working directory, which decides which project-origin
54
+ entries they see. `verify` runs in `dir`. New never launches an agent; omitting `preset`
55
+ preserves the CLI's user setting.
56
+
57
+ List and new have `openWorldHint: true`: both may read the hosted API and the configured
58
+ remote index. Verify is also open world because project commands may access external services.
59
+
60
+ Verify executes the project's manifest commands, which may change files or access the network.
61
+ Failed and changed verify outcomes are successful tool calls with a `next` action. Changed
62
+ steps run nothing: a person must accept them in a terminal. The server never passes
63
+ `--accept-changes`.
64
+
65
+ CLI execution failures (`CliFailure`) have `isError: true`, no `structuredContent`, and text containing the
66
+ message, a `Next:` line, then a blank line and JSON metadata (`tag`, `retryable`, optional
67
+ `exitCode` and `details`). Parameter-validation failures also have `isError: true`, but return
68
+ Effect's plain diagnostic naming invalid or missing keys, without the `Next:` line or JSON
69
+ metadata. Progress notifications count step-started and step-finished events when the request
70
+ supplies a progress token; no total is guessed.
71
+
72
+ Read `stacks://guide` for the CLI's guide and `stacks://guide/author` for its authoring guide.
73
+ `stacks://guide/author/{topic}` serves an authoring reference and completes topic names.
74
+ Each read runs the CLI afresh; a failed read is a protocol error. The CLI guide also names
75
+ commands this server does not expose.
76
+
77
+ ## Configuration
78
+
79
+ | Variable | Meaning |
80
+ | --- | --- |
81
+ | `STACKS_MCP_CLI` | Optional absolute path to a built CLI JavaScript entry; overrides the dependency |
82
+ | `STACKS_MCP_TIMEOUT_SECONDS` | Positive integer per-call timeout; default 900 |
83
+ | `STACKS_MCP_LOG_LEVEL` | Case-insensitive Effect log level; default Info |
84
+ | `PATH` | Tools available to project verification commands |
85
+
86
+ The CLI always runs through the server's Node executable, with stdin ignored and the captured
87
+ environment. PATH is never searched for the CLI itself. Logs go to stderr; stdout contains
88
+ only JSON-RPC messages. EOF and SIGTERM shut down cleanly.
89
+
90
+ ## From source
91
+
92
+ From the workspace root:
93
+
94
+ ```sh
95
+ bun install
96
+ bun run --filter @steamfield/stacks build
97
+ bun run --cwd packages/mcp build
98
+ node /absolute/path/to/stacks/packages/mcp/dist/server.js
99
+ ```
100
+
101
+ Register that build with Claude Code using an absolute server path:
102
+
103
+ ```sh
104
+ claude mcp add stacks -- node /absolute/path/to/stacks/packages/mcp/dist/server.js
105
+ ```
106
+
107
+ Use an absolute Node path too if the client cannot find it. `bun run --cwd packages/mcp dev`
108
+ builds and starts the Node bundle. `bun run --cwd packages/mcp pack` writes the publishable
109
+ tarball under `dist/pack/`; the maintainer's `bun run release` publishes format, CLI, then MCP,
110
+ after packing and checking all three.
111
+
112
+ ## Known limits
113
+
114
+ The server supports MCP 2026-07-28 and 2025-11-25 through the installed Effect adapters.
115
+ Cross-implementation tests use the official TypeScript SDK's legacy handshake; modern discovery
116
+ and per-request metadata are exercised with Effect's client and raw stdio.
117
+
118
+ Effect's stdio adapter always advertises logging, completions, and, when resources exist,
119
+ resource subscription and list-change capabilities. These capabilities cannot be disabled through
120
+ its public API. The server exposes no logging controls beyond the adapter's behavior.