mcpill 1.6.0 → 1.8.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.
- package/CHANGELOG.md +11 -0
- package/README.md +5 -3
- package/dist/cli.js +49 -10
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.8.0
|
|
4
|
+
|
|
5
|
+
- `mcpill run` (stdio) now auto-registers the server in Claude config on start and auto-unregisters on SIGINT, SIGTERM, and process exit — no manual step required
|
|
6
|
+
- `--register` flag and `mcpill unregister` command removed; lifecycle management is now automatic
|
|
7
|
+
|
|
8
|
+
## 1.7.0
|
|
9
|
+
|
|
10
|
+
- `mcpill run` is now side-effect-free by default — stopping the process disconnects the server; no Claude config is written
|
|
11
|
+
- `mcpill run --register` retains the old persistent behavior: registers the server entry in Claude config so Claude manages the process
|
|
12
|
+
- `mcpill unregister` removes the server entry from `.claude/settings.json`, `~/.claude.json`, and Claude Desktop config
|
|
13
|
+
|
|
3
14
|
## 1.6.0
|
|
4
15
|
|
|
5
16
|
- `HELLO-MCP.md` template (scaffolded by `mcpill init`) now includes a commented-out `## Hook:` section stub with inline field explanations for all four Claude Code event types
|
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ Describe your server in plain English, let Claude generate the source files.
|
|
|
20
20
|
mcpill init # scaffolds PILL.md + example source files
|
|
21
21
|
# fill PILL.md # describe your server: tools, resources, prompts
|
|
22
22
|
# tell Claude: "Build this PILL.md" # agent generates source files + runs compile
|
|
23
|
-
mcpill run # start the server
|
|
23
|
+
mcpill run # start the server — registered while running, removed on exit
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
`PILL.md` embeds the agent instructions — Claude knows exactly what to generate and how.
|
|
@@ -31,7 +31,7 @@ mcpill run # start the server
|
|
|
31
31
|
mcpill init # scaffolds server.md + tools/ + prompts/
|
|
32
32
|
# edit source files # tools/*.md, prompts/*.md, server.md
|
|
33
33
|
mcpill compile # compile source → .{name}/ pill artifact
|
|
34
|
-
mcpill run # start the server
|
|
34
|
+
mcpill run # start the server (transient — stops when you do)
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
---
|
|
@@ -87,10 +87,12 @@ Validates all pill directories (`.<name>/`) in the project root.
|
|
|
87
87
|
Starts the MCP server from the pill artifact.
|
|
88
88
|
|
|
89
89
|
```bash
|
|
90
|
-
mcpill run # stdio (default)
|
|
90
|
+
mcpill run # stdio (default) — registered while running, removed on exit
|
|
91
91
|
mcpill run --transport http --port 3333
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
+
For stdio transport, the server entry is automatically written to Claude's config on start and removed on exit (SIGINT, SIGTERM, or normal process exit). HTTP transport is self-hosted — Claude connects to a URL, so no registration occurs.
|
|
95
|
+
|
|
94
96
|
### `mcpill pack`
|
|
95
97
|
|
|
96
98
|
Prepares the pill for npm distribution:
|
package/dist/cli.js
CHANGED
|
@@ -548,6 +548,7 @@ async function runInit(opts) {
|
|
|
548
548
|
// src/commands/run.ts
|
|
549
549
|
import path7 from "path";
|
|
550
550
|
import fs6 from "fs";
|
|
551
|
+
import os from "os";
|
|
551
552
|
import { z as z2 } from "mcpill-runtime";
|
|
552
553
|
import { createServer, applySetup } from "mcpster";
|
|
553
554
|
|
|
@@ -1106,6 +1107,32 @@ async function runValidate(baseDir) {
|
|
|
1106
1107
|
}
|
|
1107
1108
|
|
|
1108
1109
|
// src/commands/run.ts
|
|
1110
|
+
function patchJson(filePath, patcher) {
|
|
1111
|
+
if (!fs6.existsSync(filePath)) return;
|
|
1112
|
+
try {
|
|
1113
|
+
const obj = JSON.parse(fs6.readFileSync(filePath, "utf-8"));
|
|
1114
|
+
patcher(obj);
|
|
1115
|
+
fs6.writeFileSync(filePath, JSON.stringify(obj, null, 2) + "\n", "utf-8");
|
|
1116
|
+
} catch {
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
function desktopConfigPaths() {
|
|
1120
|
+
const home = os.homedir();
|
|
1121
|
+
if (process.platform === "win32") {
|
|
1122
|
+
const appData = process.env.APPDATA ?? path7.join(home, "AppData", "Roaming");
|
|
1123
|
+
return [path7.join(appData, "Claude", "claude_desktop_config.json")];
|
|
1124
|
+
}
|
|
1125
|
+
return [path7.join(home, "Library", "Application Support", "Claude", "claude_desktop_config.json")];
|
|
1126
|
+
}
|
|
1127
|
+
function unregisterSync(name, baseDir) {
|
|
1128
|
+
const remove = (obj) => {
|
|
1129
|
+
const servers = obj.mcpServers;
|
|
1130
|
+
if (servers) delete servers[name];
|
|
1131
|
+
};
|
|
1132
|
+
patchJson(path7.join(baseDir, ".claude", "settings.json"), remove);
|
|
1133
|
+
patchJson(path7.join(os.homedir(), ".claude.json"), remove);
|
|
1134
|
+
for (const p of desktopConfigPaths()) patchJson(p, remove);
|
|
1135
|
+
}
|
|
1109
1136
|
async function runServer(opts) {
|
|
1110
1137
|
const baseDir = path7.resolve(opts.dir ?? process.cwd());
|
|
1111
1138
|
await runValidate(baseDir);
|
|
@@ -1157,15 +1184,27 @@ async function runServer(opts) {
|
|
|
1157
1184
|
resolver: async () => content
|
|
1158
1185
|
});
|
|
1159
1186
|
}
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1187
|
+
if (transport === "stdio") {
|
|
1188
|
+
applySetup(name, tools.map((t) => t.name), {
|
|
1189
|
+
projectPath: baseDir,
|
|
1190
|
+
permissions: "restrictive",
|
|
1191
|
+
register: true,
|
|
1192
|
+
cmdOverride: {
|
|
1193
|
+
command: "mcpill",
|
|
1194
|
+
args: ["run", "--dir", baseDir]
|
|
1195
|
+
}
|
|
1196
|
+
});
|
|
1197
|
+
const cleanup = () => unregisterSync(name, baseDir);
|
|
1198
|
+
process.on("exit", cleanup);
|
|
1199
|
+
process.on("SIGINT", () => {
|
|
1200
|
+
cleanup();
|
|
1201
|
+
process.exit(0);
|
|
1202
|
+
});
|
|
1203
|
+
process.on("SIGTERM", () => {
|
|
1204
|
+
cleanup();
|
|
1205
|
+
process.exit(0);
|
|
1206
|
+
});
|
|
1207
|
+
}
|
|
1169
1208
|
try {
|
|
1170
1209
|
await server.start();
|
|
1171
1210
|
} catch (err) {
|
|
@@ -1569,7 +1608,7 @@ program.name("mcpill").version(pkg.version);
|
|
|
1569
1608
|
program.command("init").description("Scaffold a new .mcpill/ directory").option("--dir <path>", "Target directory").action(async (opts) => {
|
|
1570
1609
|
await runInit(opts);
|
|
1571
1610
|
});
|
|
1572
|
-
program.command("run").description("Start the MCP server").option("--transport <
|
|
1611
|
+
program.command("run").description("Start the MCP server").option("--transport <type>", "Transport: stdio (default) or http").option("--port <n>", "Port number (HTTP only)", parseInt).option("--dir <path>", "Project root containing .mcpill/").action(
|
|
1573
1612
|
async (opts) => {
|
|
1574
1613
|
await runServer(opts);
|
|
1575
1614
|
}
|