@papyruslabsai/seshat-mcp 0.16.8 → 0.16.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.
Files changed (2) hide show
  1. package/dist/index.js +21 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -43,7 +43,14 @@ if (process.argv[2] === 'setup') {
43
43
  }
44
44
  config.mcpServers.seshat = mcpEntry;
45
45
  fs.writeFileSync(configPath, JSON.stringify(config, null, 2) + '\n', 'utf-8');
46
+ // Also persist API key to ~/.seshat/config.json so it's available even when
47
+ // a project-level .mcp.json overrides the user-level config without an env block.
48
+ const seshatDir = path.join(os.homedir(), '.seshat');
49
+ if (!fs.existsSync(seshatDir))
50
+ fs.mkdirSync(seshatDir, { recursive: true });
51
+ fs.writeFileSync(path.join(seshatDir, 'config.json'), JSON.stringify({ apiKey }, null, 2) + '\n', 'utf-8');
46
52
  console.log(`Seshat MCP configured in ${configPath}`);
53
+ console.log(`API key persisted to ${path.join(seshatDir, 'config.json')}`);
47
54
  console.log(` command: ${npxCommand}`);
48
55
  console.log(` api key: ${apiKey.slice(0, 4)}...${apiKey.slice(-4)}`);
49
56
  console.log('');
@@ -595,10 +602,22 @@ async function main() {
595
602
  // ─── CallTool handler ──────────────────────────────────────────
596
603
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
597
604
  const { name, arguments: args } = request.params;
598
- const apiKey = process.env.SESHAT_API_KEY;
605
+ let apiKey = process.env.SESHAT_API_KEY;
606
+ if (!apiKey) {
607
+ // Fallback: read from ~/.seshat/config.json (written by `setup` command).
608
+ // This covers the case where a project-level .mcp.json overrides the
609
+ // user-level config without passing the env block.
610
+ try {
611
+ const cfg = JSON.parse(fs.readFileSync(path.join(os.homedir(), '.seshat', 'config.json'), 'utf-8'));
612
+ apiKey = cfg.apiKey;
613
+ }
614
+ catch {
615
+ // file doesn't exist or isn't valid JSON
616
+ }
617
+ }
599
618
  if (!apiKey) {
600
619
  return {
601
- content: [{ type: 'text', text: JSON.stringify({ error: 'SESHAT_API_KEY environment variable is required. Get your free key at https://seshat.papyruslabs.ai' }, null, 2) }],
620
+ content: [{ type: 'text', text: JSON.stringify({ error: 'SESHAT_API_KEY not found. Run: npx @papyruslabsai/seshat-mcp setup YOUR_API_KEY' }, null, 2) }],
602
621
  isError: true,
603
622
  };
604
623
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@papyruslabsai/seshat-mcp",
3
- "version": "0.16.8",
3
+ "version": "0.16.9",
4
4
  "description": "Semantic MCP server — exposes a codebase's structure, dependencies, and constraints as queryable tools",
5
5
  "type": "module",
6
6
  "bin": {