@grainulation/wheat 1.0.8 → 1.0.10
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/README.md +3 -1
- package/bin/wheat-mcp.cjs +18 -0
- package/bin/wheat-mcp.js +24 -0
- package/lib/init.js +18 -4
- package/lib/serve-mcp.js +7 -3
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -39,11 +39,13 @@ Works with [Claude Code](https://claude.com/claude-code), [Cursor](https://curso
|
|
|
39
39
|
For native tool access in Claude Code:
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
|
-
claude mcp add wheat -- npx -y @grainulation/wheat
|
|
42
|
+
claude mcp add wheat -- npx -y @grainulation/wheat-mcp
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
This gives Claude direct access to wheat's claims engine — add-claim, compile, search, status — without shelling out.
|
|
46
46
|
|
|
47
|
+
> **Note:** `wheat mcp` still works as a subcommand, but the dedicated `wheat-mcp` entry point is recommended for MCP integrations — it bypasses CLI dispatch and starts the server directly.
|
|
48
|
+
|
|
47
49
|
## See it in 30 seconds
|
|
48
50
|
|
|
49
51
|
```bash
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* wheat-mcp (CJS) — Dedicated MCP server entry point
|
|
4
|
+
*
|
|
5
|
+
* CJS wrapper that dynamically imports the ESM serve-mcp module.
|
|
6
|
+
* Claude Code's plugin transport reliably keeps CJS-spawned processes
|
|
7
|
+
* alive but drops ESM processes. This file bridges the gap.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const dirIdx = process.argv.indexOf("--dir");
|
|
11
|
+
const dir = dirIdx !== -1 && process.argv[dirIdx + 1]
|
|
12
|
+
? process.argv[dirIdx + 1]
|
|
13
|
+
: process.cwd();
|
|
14
|
+
|
|
15
|
+
// Dynamic import of ESM module from CJS
|
|
16
|
+
import("../lib/serve-mcp.js").then((mod) => {
|
|
17
|
+
mod.startServer(dir);
|
|
18
|
+
});
|
package/bin/wheat-mcp.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* wheat-mcp — Dedicated MCP server entry point
|
|
4
|
+
*
|
|
5
|
+
* Skips the CLI dispatch chain (bin/wheat.js) and starts the MCP server
|
|
6
|
+
* directly. This avoids the async import overhead, install-prompt, and
|
|
7
|
+
* arg parsing that can cause connection timeouts in Claude Code's
|
|
8
|
+
* plugin transport (30s stdio initialization timeout).
|
|
9
|
+
*
|
|
10
|
+
* Usage:
|
|
11
|
+
* node bin/wheat-mcp.js [--dir <path>]
|
|
12
|
+
* npx @grainulation/wheat-mcp [--dir <path>]
|
|
13
|
+
*
|
|
14
|
+
* Zero npm dependencies.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { startServer } from "../lib/serve-mcp.js";
|
|
18
|
+
|
|
19
|
+
const dirIdx = process.argv.indexOf("--dir");
|
|
20
|
+
const dir = dirIdx !== -1 && process.argv[dirIdx + 1]
|
|
21
|
+
? process.argv[dirIdx + 1]
|
|
22
|
+
: process.cwd();
|
|
23
|
+
|
|
24
|
+
startServer(dir);
|
package/lib/init.js
CHANGED
|
@@ -344,7 +344,7 @@ function writeMcpJson(dir) {
|
|
|
344
344
|
const mcpPath = target(dir, ".mcp.json");
|
|
345
345
|
const wheatEntry = {
|
|
346
346
|
command: "npx",
|
|
347
|
-
args: ["-y", "@grainulation/wheat
|
|
347
|
+
args: ["-y", "@grainulation/wheat-mcp"],
|
|
348
348
|
};
|
|
349
349
|
|
|
350
350
|
let config = { mcpServers: {} };
|
|
@@ -577,10 +577,24 @@ export async function run(dir, args) {
|
|
|
577
577
|
fs.renameSync(tmpClaims, claimsPath);
|
|
578
578
|
console.log(" \x1b[32m+\x1b[0m claims.json");
|
|
579
579
|
|
|
580
|
-
// CLAUDE.md
|
|
580
|
+
// CLAUDE.md (preserve existing content unless --force)
|
|
581
581
|
const claudePath = target(dir, "CLAUDE.md");
|
|
582
|
-
fs.
|
|
583
|
-
|
|
582
|
+
const claudeExists = fs.existsSync(claudePath);
|
|
583
|
+
if (claudeExists && flags.force) {
|
|
584
|
+
// --force with existing file: back up before overwriting
|
|
585
|
+
fs.copyFileSync(claudePath, claudePath + ".bak");
|
|
586
|
+
fs.writeFileSync(claudePath, claudeMd);
|
|
587
|
+
console.log(" \x1b[32m+\x1b[0m CLAUDE.md (backed up existing to CLAUDE.md.bak)");
|
|
588
|
+
} else if (claudeExists) {
|
|
589
|
+
// Existing file, no --force: append wheat section with separator
|
|
590
|
+
const existing = fs.readFileSync(claudePath, "utf8");
|
|
591
|
+
fs.writeFileSync(claudePath, existing + "\n\n---\n\n" + claudeMd);
|
|
592
|
+
console.log(" \x1b[32m+\x1b[0m CLAUDE.md (appended wheat sprint section)");
|
|
593
|
+
} else {
|
|
594
|
+
// No existing file: write normally
|
|
595
|
+
fs.writeFileSync(claudePath, claudeMd);
|
|
596
|
+
console.log(" \x1b[32m+\x1b[0m CLAUDE.md");
|
|
597
|
+
}
|
|
584
598
|
|
|
585
599
|
// .claude/commands/wheat/
|
|
586
600
|
const copied = copyCommands(dir);
|
package/lib/serve-mcp.js
CHANGED
|
@@ -22,7 +22,10 @@
|
|
|
22
22
|
*
|
|
23
23
|
* Protocol: MCP over stdio (JSON-RPC 2.0, newline-delimited)
|
|
24
24
|
*
|
|
25
|
-
* Install:
|
|
25
|
+
* Install (recommended):
|
|
26
|
+
* claude mcp add wheat -- npx @grainulation/wheat-mcp
|
|
27
|
+
*
|
|
28
|
+
* Legacy (still works, but routes through CLI dispatch):
|
|
26
29
|
* claude mcp add wheat -- npx @grainulation/wheat mcp
|
|
27
30
|
*
|
|
28
31
|
* Zero npm dependencies.
|
|
@@ -850,10 +853,11 @@ export async function run(dir, args) {
|
|
|
850
853
|
console.log(`wheat mcp -- Local MCP server for Claude Code
|
|
851
854
|
|
|
852
855
|
Usage:
|
|
853
|
-
wheat
|
|
856
|
+
wheat-mcp [--dir <path>] (recommended)
|
|
857
|
+
wheat mcp [--dir <path>] (legacy, still works)
|
|
854
858
|
|
|
855
859
|
Install in Claude Code:
|
|
856
|
-
claude mcp add wheat -- npx @grainulation/wheat
|
|
860
|
+
claude mcp add wheat -- npx @grainulation/wheat-mcp
|
|
857
861
|
|
|
858
862
|
Tools exposed:
|
|
859
863
|
wheat/compile Run the compiler
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grainulation/wheat",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "Research-driven development framework — structured claims, compiled evidence, deterministic output",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "grainulation contributors",
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
"./load-claims": "./lib/load-claims.js"
|
|
37
37
|
},
|
|
38
38
|
"bin": {
|
|
39
|
-
"wheat": "bin/wheat.js"
|
|
39
|
+
"wheat": "bin/wheat.js",
|
|
40
|
+
"wheat-mcp": "bin/wheat-mcp.js"
|
|
40
41
|
},
|
|
41
42
|
"files": [
|
|
42
43
|
"bin/",
|
|
@@ -46,7 +47,7 @@
|
|
|
46
47
|
"templates/"
|
|
47
48
|
],
|
|
48
49
|
"scripts": {
|
|
49
|
-
"test": "node --test test/cli.test.js test/compiler.test.js test/guard.test.js test/init.test.js test/migration.test.js"
|
|
50
|
+
"test": "node --test test/cli.test.js test/compiler.test.js test/guard.test.js test/init.test.js test/migration.test.js test/mcp.test.js"
|
|
50
51
|
},
|
|
51
52
|
"engines": {
|
|
52
53
|
"node": ">=20"
|