mcproc 0.0.0-stage → 0.14.2
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/LICENSE +21 -0
- package/README.md +125 -2
- package/dist/cli.js +13579 -0
- package/dist/cli.js.map +1 -0
- package/docs/hosts.md +84 -0
- package/docs/incidents.md +39 -0
- package/docs/init.md +30 -0
- package/docs/logs.md +50 -0
- package/docs/manifest.md +83 -0
- package/docs/memory.md +57 -0
- package/docs/monit.md +40 -0
- package/docs/readiness.md +53 -0
- package/docs/reloads.md +67 -0
- package/docs/urls.md +56 -0
- package/docs/variables.md +34 -0
- package/docs/worktrees.md +47 -0
- package/package.json +76 -4
- package/runtime/package-lock.json +945 -0
- package/runtime/package.json +8 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kiwagu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,126 @@
|
|
|
1
|
-
#
|
|
1
|
+
# mcproc
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
pm2 process control for coding agents, over MCP and on the command line. One manifest per project
|
|
4
|
+
describes what each launch is; the agent (or you) starts, restarts, reads logs and, above all, sees
|
|
5
|
+
which ports each app really listens on. Works on the local machine and on remote hosts over ssh
|
|
6
|
+
and `docker exec`. The processes are plain pm2 processes: `pm2 monit` in any shell shows the same thing.
|
|
7
|
+
|
|
8
|
+
## Install and register
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm i -g mcproc # or run it with: npx -y mcproc
|
|
12
|
+
claude mcp add -s user mcproc -- mcproc mcp # Claude Code, once, user scope
|
|
13
|
+
```
|
|
14
|
+
From a checkout instead: `bun run build && node dist/cli.js install` writes a `mcproc` launcher into
|
|
15
|
+
`~/.local/bin` (adding that directory to your shell rc when it is not on `PATH` yet); `install --uninstall` removes it.
|
|
16
|
+
Codex (`~/.codex/config.toml`):
|
|
17
|
+
```toml
|
|
18
|
+
[mcp_servers.mcproc]
|
|
19
|
+
command = "mcproc"
|
|
20
|
+
args = ["mcp"]
|
|
21
|
+
```
|
|
22
|
+
The server finds the project from `MCPROC_PROJECT`, then `CLAUDE_PROJECT_DIR` (set by Claude Code),
|
|
23
|
+
then the client's MCP roots, then its working directory, and looks upward for `.mcproc/mcproc.yaml`.
|
|
24
|
+
Every tool also accepts an explicit `project` path.
|
|
25
|
+
|
|
26
|
+
## Quick start
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
cd my-project
|
|
30
|
+
mcproc init # writes .mcproc/ (gitignored) with a manifest draft: on a turbo repo the dev task's apps are live, the rest commented out
|
|
31
|
+
$EDITOR .mcproc/mcproc.yaml # write a description for each app; uncomment what else you need
|
|
32
|
+
mcproc start base # or an app name, or "all"
|
|
33
|
+
mcproc ls # status, pid, uptime and real vs declared ports
|
|
34
|
+
mcproc init --adopt-ports # write the ports ls shows as undeclared into the manifest
|
|
35
|
+
mcproc logs api -n 200
|
|
36
|
+
mcproc logs base --since 2m # every app of a profile, merged by time stamp
|
|
37
|
+
mcproc doctor # why a host cannot be driven, and what to do
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## The manifest: `.mcproc/mcproc.yaml`
|
|
41
|
+
|
|
42
|
+
```yaml
|
|
43
|
+
version: 1
|
|
44
|
+
project: demo # pm2 namespace and process-name prefix; default: directory name
|
|
45
|
+
vars: # per-checkout values (docs/variables.md)
|
|
46
|
+
slot: 0
|
|
47
|
+
apps:
|
|
48
|
+
libs:
|
|
49
|
+
description: one-shot build of the shared libraries into dist/
|
|
50
|
+
kind: task # runs once; ls shows done / failed (exit N)
|
|
51
|
+
run: npm run build:libs
|
|
52
|
+
api-build:
|
|
53
|
+
description: tsc watch build of the API into dist/
|
|
54
|
+
kind: build # build | server | worker | task (default server)
|
|
55
|
+
run: npx tsc -w -p apps/api
|
|
56
|
+
api:
|
|
57
|
+
description: HTTP API serving /health
|
|
58
|
+
run: node dist/apps/api/main.js
|
|
59
|
+
cwd: . # relative to the project root
|
|
60
|
+
env: { PORT: 3310 }
|
|
61
|
+
port: 3310 # declared listening port (or ports: [3310, 9230])
|
|
62
|
+
url: http://localhost:3310/ # the address to open; ls/describe show it with the HTTP answer (docs/urls.md)
|
|
63
|
+
memory: 600M # expected memory (docs/memory.md)
|
|
64
|
+
containers: [demo-db] # docker containers the app owns
|
|
65
|
+
watch: [dist/apps/api] # pm2 restarts the server when the build output changes
|
|
66
|
+
depends_on:
|
|
67
|
+
- { app: libs, condition: completed } # wait for the build to exit 0
|
|
68
|
+
- api-build # plain name = started (start order only)
|
|
69
|
+
profiles:
|
|
70
|
+
base: [libs, api-build, api] # "all" is built in
|
|
71
|
+
hosts: # "local" is implicit
|
|
72
|
+
stand:
|
|
73
|
+
ssh: stand # alias from ~/.ssh/config; no secrets live here
|
|
74
|
+
cwd: /srv/demo # project root on that host
|
|
75
|
+
prod:
|
|
76
|
+
ssh: prod
|
|
77
|
+
docker: { container: demo-app, user: node }
|
|
78
|
+
cwd: /home/node/demo
|
|
79
|
+
readonly: true # every mutating tool is refused here
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
The folder is created with a `.gitignore` containing `*`: it never enters your repository, so each
|
|
83
|
+
checkout keeps its own. `.mcproc/README.md` holds free-form notes that `describe` returns. The remaining
|
|
84
|
+
fields, the kinds and the process naming: [the manifest](docs/manifest.md).
|
|
85
|
+
|
|
86
|
+
## Tools (MCP) and commands (CLI)
|
|
87
|
+
|
|
88
|
+
| tool (CLI form when it differs) | what it does |
|
|
89
|
+
|------|--------------|
|
|
90
|
+
| `describe [app]` | the project summary (apps with descriptions, profiles, hosts, the notes file), or one app in detail |
|
|
91
|
+
| `ls [app]` | one row per app from the host it runs on: status, pid, uptime, restarts, memory and CPU of the process tree, ports with `✓`/`✗` against the declared ones, the URL's answer; `reloads` adds the in-process reloads since the pm2 start |
|
|
92
|
+
| `ports [port]` | every listening socket on the host with its pid and owning app, or who holds one port |
|
|
93
|
+
| `logs` | one app's tail, or several apps merged by time: the latest lines, `since` a span or a time, or `last` ([logs](docs/logs.md)) |
|
|
94
|
+
| `incidents [app]` | new errors with context since they were last taken, plus crashes and restarts; `peek` looks without taking ([incidents](docs/incidents.md)) |
|
|
95
|
+
| `wait <app>` with `until` (CLI `--until`) | block until listening, url-ok, exited, a log line matches, idle, or reloaded ([readiness](docs/readiness.md)) |
|
|
96
|
+
| `start`, `restart`, `stop`, `delete <target>` | by app or profile; `start` launches dependencies first and waits for their conditions, `reload` restarts the apps already online, and a stand the host cannot hold yet is `queued` ([memory](docs/memory.md)) |
|
|
97
|
+
| `flush [app]` | truncate the pm2 log files; incidents start over from there |
|
|
98
|
+
| `init` | a manifest draft from the repository's scripts and workspaces; `adopt_ports` writes the ports `ls` reports as undeclared into the existing manifest ([init](docs/init.md)) |
|
|
99
|
+
| `hosts`, `doctor` | the hosts and the apps bound to each; per-host readiness, which pm2 a host would use and why, where each url answers ([hosts](docs/hosts.md)) |
|
|
100
|
+
| `unpack` | bring pm2, and Node when the host has none, to a host ([hosts](docs/hosts.md#hosts-without-pm2-unpack)) |
|
|
101
|
+
| `leases`, `lease_cancel` (CLI `leases cancel <id>`) | this machine's memory lease queue; cancel a pending lease ([memory](docs/memory.md)) |
|
|
102
|
+
| `exec -- <command>` | a one-off command from the project root with the manifest's `exec.env`, under a lease with `--memory` |
|
|
103
|
+
| `worktree_add`, `worktree_ls`, `worktree_remove` (CLI `worktree add \| ls \| remove`) | an isolated checkout per branch with its own slot, slug and ports ([worktrees](docs/worktrees.md)) |
|
|
104
|
+
|
|
105
|
+
Every tool takes `project`; the tools that act on apps take `host` too, and without it each app is reached where it
|
|
106
|
+
runs ([hosts](docs/hosts.md)). Leases, `exec` and worktrees are local to this machine. Read-only tools are annotated as such; mutating tools refuse `readonly` hosts and unknown app names before touching
|
|
107
|
+
any host. `mcproc monit` is the terminal dashboard on the same data ([monit](docs/monit.md)).
|
|
108
|
+
|
|
109
|
+
## Documentation
|
|
110
|
+
|
|
111
|
+
- [The manifest](docs/manifest.md): every field, the kinds, process names
|
|
112
|
+
- [`init`](docs/init.md): how the draft is made, turbo monorepos, adopting ports
|
|
113
|
+
- [Hosts](docs/hosts.md): apps on several hosts, what a host needs, how ports are found, `unpack`
|
|
114
|
+
- [Variables](docs/variables.md): per-checkout values and the override file
|
|
115
|
+
- [Worktrees](docs/worktrees.md): one checkout per branch, each with its own slot
|
|
116
|
+
- [Memory](docs/memory.md): budgets, the lease queue, `exec`
|
|
117
|
+
- [Readiness](docs/readiness.md): `wait` and `depends_on` conditions
|
|
118
|
+
- [Logs](docs/logs.md): since a point in time, live following, colors
|
|
119
|
+
- [Incidents](docs/incidents.md): new errors, what counts as one, per-app patterns
|
|
120
|
+
- [Reloads](docs/reloads.md): the in-process reloads of watchers, and where they show
|
|
121
|
+
- [URLs](docs/urls.md): where a url is checked from and what the answer means
|
|
122
|
+
- [monit](docs/monit.md): the dashboard and its keys
|
|
123
|
+
|
|
124
|
+
## License
|
|
125
|
+
|
|
126
|
+
MIT, see [LICENSE](LICENSE).
|