@anthropologies/claudestory 0.1.6 → 0.1.7
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 +2 -8
- package/dist/cli.js +33 -25
- package/dist/mcp.js +32 -24
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -95,16 +95,10 @@ The MCP server provides 19 tools for Claude Code integration. It imports the sam
|
|
|
95
95
|
### Setup with Claude Code
|
|
96
96
|
|
|
97
97
|
```bash
|
|
98
|
-
claude mcp add claudestory -- npx -y @anthropologies/claudestory --mcp
|
|
98
|
+
claude mcp add claudestory -s user -- npx -y @anthropologies/claudestory --mcp
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
-
That's it. No global install required.
|
|
102
|
-
|
|
103
|
-
For a specific project root (recommended when working across multiple projects):
|
|
104
|
-
|
|
105
|
-
```bash
|
|
106
|
-
claude mcp add claudestory -- env CLAUDESTORY_PROJECT_ROOT=/path/to/project npx -y @anthropologies/claudestory --mcp
|
|
107
|
-
```
|
|
101
|
+
That's it. One command, global — works in every project that has a `.story/` directory. No global install required. The MCP server auto-discovers the project root by walking up from the working directory.
|
|
108
102
|
|
|
109
103
|
### MCP Tools
|
|
110
104
|
|
package/dist/cli.js
CHANGED
|
@@ -3590,50 +3590,58 @@ import { realpathSync, existsSync as existsSync5 } from "fs";
|
|
|
3590
3590
|
import { resolve as resolve7, join as join8, isAbsolute } from "path";
|
|
3591
3591
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3592
3592
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3593
|
-
function
|
|
3593
|
+
function tryDiscoverRoot() {
|
|
3594
3594
|
const envRoot = process.env[ENV_VAR2];
|
|
3595
3595
|
if (envRoot) {
|
|
3596
3596
|
if (!isAbsolute(envRoot)) {
|
|
3597
|
-
process.stderr.write(`
|
|
3597
|
+
process.stderr.write(`Warning: ${ENV_VAR2} must be an absolute path, got: ${envRoot}
|
|
3598
3598
|
`);
|
|
3599
|
-
|
|
3599
|
+
return null;
|
|
3600
3600
|
}
|
|
3601
3601
|
const resolved = resolve7(envRoot);
|
|
3602
|
-
let canonical;
|
|
3603
3602
|
try {
|
|
3604
|
-
canonical = realpathSync(resolved);
|
|
3605
|
-
|
|
3606
|
-
|
|
3603
|
+
const canonical = realpathSync(resolved);
|
|
3604
|
+
if (existsSync5(join8(canonical, CONFIG_PATH2))) {
|
|
3605
|
+
return canonical;
|
|
3606
|
+
}
|
|
3607
|
+
process.stderr.write(`Warning: No .story/config.json at ${canonical}
|
|
3607
3608
|
`);
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
if (!existsSync5(join8(canonical, CONFIG_PATH2))) {
|
|
3611
|
-
process.stderr.write(`Error: No .story/config.json at ${canonical}
|
|
3609
|
+
} catch {
|
|
3610
|
+
process.stderr.write(`Warning: ${ENV_VAR2} path does not exist: ${resolved}
|
|
3612
3611
|
`);
|
|
3613
|
-
process.exit(1);
|
|
3614
3612
|
}
|
|
3615
|
-
return
|
|
3613
|
+
return null;
|
|
3616
3614
|
}
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3615
|
+
try {
|
|
3616
|
+
const root = discoverProjectRoot();
|
|
3617
|
+
return root ? realpathSync(root) : null;
|
|
3618
|
+
} catch {
|
|
3619
|
+
return null;
|
|
3621
3620
|
}
|
|
3622
|
-
return realpathSync(root);
|
|
3623
3621
|
}
|
|
3624
3622
|
async function main() {
|
|
3625
|
-
const root =
|
|
3623
|
+
const root = tryDiscoverRoot();
|
|
3626
3624
|
const server = new McpServer(
|
|
3627
3625
|
{ name: "claudestory", version },
|
|
3628
3626
|
{
|
|
3629
|
-
instructions: "Start with claudestory_status for a project overview, then claudestory_ticket_next for the highest-priority work, then claudestory_handover_latest for session context."
|
|
3627
|
+
instructions: root ? "Start with claudestory_status for a project overview, then claudestory_ticket_next for the highest-priority work, then claudestory_handover_latest for session context." : "No .story/ project found in the current directory. Navigate to a project with a .story/ directory, or set CLAUDESTORY_PROJECT_ROOT."
|
|
3630
3628
|
}
|
|
3631
3629
|
);
|
|
3632
|
-
|
|
3630
|
+
if (root) {
|
|
3631
|
+
registerAllTools(server, root);
|
|
3632
|
+
process.stderr.write(`claudestory MCP server running (root: ${root})
|
|
3633
|
+
`);
|
|
3634
|
+
} else {
|
|
3635
|
+
server.registerTool("claudestory_status", {
|
|
3636
|
+
description: "Project summary \u2014 returns error if no .story/ project found"
|
|
3637
|
+
}, () => Promise.resolve({
|
|
3638
|
+
content: [{ type: "text", text: "No .story/ project found. Navigate to a directory containing .story/ or set CLAUDESTORY_PROJECT_ROOT." }],
|
|
3639
|
+
isError: true
|
|
3640
|
+
}));
|
|
3641
|
+
process.stderr.write("claudestory MCP server running (no project found \u2014 tools will report errors)\n");
|
|
3642
|
+
}
|
|
3633
3643
|
const transport = new StdioServerTransport();
|
|
3634
3644
|
await server.connect(transport);
|
|
3635
|
-
process.stderr.write(`claudestory MCP server running (root: ${root})
|
|
3636
|
-
`);
|
|
3637
3645
|
}
|
|
3638
3646
|
var ENV_VAR2, CONFIG_PATH2, version;
|
|
3639
3647
|
var init_mcp = __esm({
|
|
@@ -3644,7 +3652,7 @@ var init_mcp = __esm({
|
|
|
3644
3652
|
init_tools();
|
|
3645
3653
|
ENV_VAR2 = "CLAUDESTORY_PROJECT_ROOT";
|
|
3646
3654
|
CONFIG_PATH2 = ".story/config.json";
|
|
3647
|
-
version = "0.1.
|
|
3655
|
+
version = "0.1.7";
|
|
3648
3656
|
main().catch((err) => {
|
|
3649
3657
|
process.stderr.write(`Fatal: ${err instanceof Error ? err.message : String(err)}
|
|
3650
3658
|
`);
|
|
@@ -5168,7 +5176,7 @@ async function runCli() {
|
|
|
5168
5176
|
registerRecapCommand: registerRecapCommand2,
|
|
5169
5177
|
registerExportCommand: registerExportCommand2
|
|
5170
5178
|
} = await Promise.resolve().then(() => (init_register(), register_exports));
|
|
5171
|
-
const version2 = "0.1.
|
|
5179
|
+
const version2 = "0.1.7";
|
|
5172
5180
|
class HandledError extends Error {
|
|
5173
5181
|
constructor() {
|
|
5174
5182
|
super("HANDLED_ERROR");
|
package/dist/mcp.js
CHANGED
|
@@ -2491,51 +2491,59 @@ function registerAllTools(server, pinnedRoot) {
|
|
|
2491
2491
|
// src/mcp/index.ts
|
|
2492
2492
|
var ENV_VAR2 = "CLAUDESTORY_PROJECT_ROOT";
|
|
2493
2493
|
var CONFIG_PATH2 = ".story/config.json";
|
|
2494
|
-
var version = "0.1.
|
|
2495
|
-
function
|
|
2494
|
+
var version = "0.1.7";
|
|
2495
|
+
function tryDiscoverRoot() {
|
|
2496
2496
|
const envRoot = process.env[ENV_VAR2];
|
|
2497
2497
|
if (envRoot) {
|
|
2498
2498
|
if (!isAbsolute(envRoot)) {
|
|
2499
|
-
process.stderr.write(`
|
|
2499
|
+
process.stderr.write(`Warning: ${ENV_VAR2} must be an absolute path, got: ${envRoot}
|
|
2500
2500
|
`);
|
|
2501
|
-
|
|
2501
|
+
return null;
|
|
2502
2502
|
}
|
|
2503
2503
|
const resolved = resolve7(envRoot);
|
|
2504
|
-
let canonical;
|
|
2505
2504
|
try {
|
|
2506
|
-
canonical = realpathSync(resolved);
|
|
2507
|
-
|
|
2508
|
-
|
|
2505
|
+
const canonical = realpathSync(resolved);
|
|
2506
|
+
if (existsSync5(join8(canonical, CONFIG_PATH2))) {
|
|
2507
|
+
return canonical;
|
|
2508
|
+
}
|
|
2509
|
+
process.stderr.write(`Warning: No .story/config.json at ${canonical}
|
|
2509
2510
|
`);
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
if (!existsSync5(join8(canonical, CONFIG_PATH2))) {
|
|
2513
|
-
process.stderr.write(`Error: No .story/config.json at ${canonical}
|
|
2511
|
+
} catch {
|
|
2512
|
+
process.stderr.write(`Warning: ${ENV_VAR2} path does not exist: ${resolved}
|
|
2514
2513
|
`);
|
|
2515
|
-
process.exit(1);
|
|
2516
2514
|
}
|
|
2517
|
-
return
|
|
2515
|
+
return null;
|
|
2518
2516
|
}
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2517
|
+
try {
|
|
2518
|
+
const root = discoverProjectRoot();
|
|
2519
|
+
return root ? realpathSync(root) : null;
|
|
2520
|
+
} catch {
|
|
2521
|
+
return null;
|
|
2523
2522
|
}
|
|
2524
|
-
return realpathSync(root);
|
|
2525
2523
|
}
|
|
2526
2524
|
async function main() {
|
|
2527
|
-
const root =
|
|
2525
|
+
const root = tryDiscoverRoot();
|
|
2528
2526
|
const server = new McpServer(
|
|
2529
2527
|
{ name: "claudestory", version },
|
|
2530
2528
|
{
|
|
2531
|
-
instructions: "Start with claudestory_status for a project overview, then claudestory_ticket_next for the highest-priority work, then claudestory_handover_latest for session context."
|
|
2529
|
+
instructions: root ? "Start with claudestory_status for a project overview, then claudestory_ticket_next for the highest-priority work, then claudestory_handover_latest for session context." : "No .story/ project found in the current directory. Navigate to a project with a .story/ directory, or set CLAUDESTORY_PROJECT_ROOT."
|
|
2532
2530
|
}
|
|
2533
2531
|
);
|
|
2534
|
-
|
|
2532
|
+
if (root) {
|
|
2533
|
+
registerAllTools(server, root);
|
|
2534
|
+
process.stderr.write(`claudestory MCP server running (root: ${root})
|
|
2535
|
+
`);
|
|
2536
|
+
} else {
|
|
2537
|
+
server.registerTool("claudestory_status", {
|
|
2538
|
+
description: "Project summary \u2014 returns error if no .story/ project found"
|
|
2539
|
+
}, () => Promise.resolve({
|
|
2540
|
+
content: [{ type: "text", text: "No .story/ project found. Navigate to a directory containing .story/ or set CLAUDESTORY_PROJECT_ROOT." }],
|
|
2541
|
+
isError: true
|
|
2542
|
+
}));
|
|
2543
|
+
process.stderr.write("claudestory MCP server running (no project found \u2014 tools will report errors)\n");
|
|
2544
|
+
}
|
|
2535
2545
|
const transport = new StdioServerTransport();
|
|
2536
2546
|
await server.connect(transport);
|
|
2537
|
-
process.stderr.write(`claudestory MCP server running (root: ${root})
|
|
2538
|
-
`);
|
|
2539
2547
|
}
|
|
2540
2548
|
main().catch((err) => {
|
|
2541
2549
|
process.stderr.write(`Fatal: ${err instanceof Error ? err.message : String(err)}
|