devscribe-reason 1.0.7 ā 1.0.9
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/package.json +2 -2
- package/scripts/cli.js +44 -0
- package/scripts/setup.js +8 -30
- package/src/CLAUDE.md +5 -4
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "devscribe-reason",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "MCP server that captures engineering decision reasoning and commits structured markdown to GitHub",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
8
|
-
"devscribe-reason": "scripts/
|
|
8
|
+
"devscribe-reason": "scripts/cli.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"start": "node src/index.js",
|
package/scripts/cli.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { execSync } from "node:child_process";
|
|
4
|
+
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
5
|
+
import { join } from "node:path";
|
|
6
|
+
import { homedir } from "node:os";
|
|
7
|
+
import { globSync } from "glob";
|
|
8
|
+
import { fileURLToPath } from "node:url";
|
|
9
|
+
import { dirname } from "node:path";
|
|
10
|
+
|
|
11
|
+
const args = process.argv.slice(2);
|
|
12
|
+
const command = args[0];
|
|
13
|
+
|
|
14
|
+
// If no command or "server" command, run the MCP server
|
|
15
|
+
if (!command || command === "server") {
|
|
16
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
17
|
+
const __dirname = dirname(__filename);
|
|
18
|
+
const serverPath = join(__dirname, "../src/index.js");
|
|
19
|
+
|
|
20
|
+
// Run the server
|
|
21
|
+
execSync(`node ${serverPath}`, { stdio: "inherit" });
|
|
22
|
+
process.exit(0);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// If "setup" command, run setup
|
|
26
|
+
if (command === "setup") {
|
|
27
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
28
|
+
const __dirname = dirname(__filename);
|
|
29
|
+
const setupPath = join(__dirname, "setup.js");
|
|
30
|
+
|
|
31
|
+
// Run setup
|
|
32
|
+
execSync(`node ${setupPath}`, {
|
|
33
|
+
stdio: "inherit",
|
|
34
|
+
env: process.env,
|
|
35
|
+
});
|
|
36
|
+
process.exit(0);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Unknown command
|
|
40
|
+
console.error(`Unknown command: ${command}`);
|
|
41
|
+
console.error("\nUsage:");
|
|
42
|
+
console.error(" npx devscribe-reason - Start the MCP server");
|
|
43
|
+
console.error(" npx devscribe-reason setup - Configure Claude Code/Cursor");
|
|
44
|
+
process.exit(1);
|
package/scripts/setup.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { execSync
|
|
3
|
+
import { execSync } from "node:child_process";
|
|
4
4
|
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
5
5
|
import { join } from "node:path";
|
|
6
6
|
import { homedir } from "node:os";
|
|
@@ -180,33 +180,11 @@ if (cursorAvailable) {
|
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
if (claudeAvailable || cursorAvailable) {
|
|
183
|
-
console.log("\n
|
|
184
|
-
console.log("
|
|
185
|
-
console.log("
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
192
|
-
const __dirname = dirname(__filename);
|
|
193
|
-
const serverPath = join(__dirname, "../src/index.js");
|
|
194
|
-
|
|
195
|
-
// Set up environment variables for the server
|
|
196
|
-
const serverEnv = {
|
|
197
|
-
...process.env,
|
|
198
|
-
...(token && { GITHUB_TOKEN: token }),
|
|
199
|
-
...(repo && { GITHUB_REPO: repo }),
|
|
200
|
-
GITHUB_BRANCH: branch,
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
const server = spawn("node", [serverPath], {
|
|
204
|
-
env: serverEnv,
|
|
205
|
-
stdio: "inherit",
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
server.on("error", (err) => {
|
|
209
|
-
console.error("Failed to start MCP server:", err);
|
|
210
|
-
process.exit(1);
|
|
211
|
-
});
|
|
183
|
+
console.log("\nā
Setup complete!\n");
|
|
184
|
+
console.log("š The MCP server is now configured for:");
|
|
185
|
+
if (claudeAvailable) console.log(" ⢠Claude Code");
|
|
186
|
+
if (cursorAvailable) console.log(" ⢠Cursor");
|
|
187
|
+
console.log(
|
|
188
|
+
"\nš” The server will start automatically when you open Claude Code or Cursor.\n"
|
|
189
|
+
);
|
|
212
190
|
}
|
package/src/CLAUDE.md
CHANGED
|
@@ -24,20 +24,21 @@ The server exposes four MCP tools that Claude Code calls throughout a coding ses
|
|
|
24
24
|
Works with both Claude Code and Cursor:
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
|
-
GITHUB_TOKEN=ghp_your_token npx devscribe-reason
|
|
27
|
+
GITHUB_TOKEN=ghp_your_token npx devscribe-reason setup
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
This command will:
|
|
31
31
|
- Auto-detect your GitHub repo from git remote
|
|
32
32
|
- Auto-detect Claude Code or Cursor
|
|
33
|
-
- Configure the MCP server automatically
|
|
34
|
-
- Start the MCP server
|
|
33
|
+
- Configure the MCP server automatically in both editors
|
|
35
34
|
|
|
36
35
|
**If you need to specify the repo explicitly:**
|
|
37
36
|
```bash
|
|
38
|
-
GITHUB_TOKEN=ghp_your_token GITHUB_REPO=owner/repo npx devscribe-reason
|
|
37
|
+
GITHUB_TOKEN=ghp_your_token GITHUB_REPO=owner/repo npx devscribe-reason setup
|
|
39
38
|
```
|
|
40
39
|
|
|
40
|
+
**After setup:** The MCP server will start automatically when you open Claude Code or Cursor. You don't need to manually start anything.
|
|
41
|
+
|
|
41
42
|
**GitHub Token:** Create a [Personal Access Token](https://github.com/settings/tokens) with `repo` scope (or `contents: write` for fine-grained tokens).
|
|
42
43
|
|
|
43
44
|
### 2. Add system prompt instructions
|