@papyruslabsai/seshat-mcp 0.16.0 → 0.16.2
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/dist/index.js +42 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10,6 +10,46 @@ import path from 'path';
|
|
|
10
10
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
11
11
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
12
12
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
13
|
+
// ─── Setup Command ───────────────────────────────────────────────
|
|
14
|
+
// `npx @papyruslabsai/seshat-mcp setup YOUR_API_KEY` writes the
|
|
15
|
+
// correct MCP config into ~/.claude.json, handling the Windows
|
|
16
|
+
// npx vs npx.cmd difference automatically.
|
|
17
|
+
import fs from 'fs';
|
|
18
|
+
import os from 'os';
|
|
19
|
+
if (process.argv[2] === 'setup') {
|
|
20
|
+
const apiKey = process.argv[3];
|
|
21
|
+
if (!apiKey) {
|
|
22
|
+
console.error('Usage: npx @papyruslabsai/seshat-mcp setup YOUR_API_KEY');
|
|
23
|
+
console.error('Get your free key at https://seshat.papyruslabs.ai');
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
const configPath = path.join(os.homedir(), '.claude.json');
|
|
27
|
+
const isWindows = process.platform === 'win32';
|
|
28
|
+
const npxCommand = isWindows ? 'npx.cmd' : 'npx';
|
|
29
|
+
const mcpEntry = {
|
|
30
|
+
command: npxCommand,
|
|
31
|
+
args: ['-y', '@papyruslabsai/seshat-mcp'],
|
|
32
|
+
env: { SESHAT_API_KEY: apiKey },
|
|
33
|
+
};
|
|
34
|
+
let config = {};
|
|
35
|
+
try {
|
|
36
|
+
config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
// File doesn't exist or isn't valid JSON — start fresh
|
|
40
|
+
}
|
|
41
|
+
if (!config.mcpServers || typeof config.mcpServers !== 'object') {
|
|
42
|
+
config.mcpServers = {};
|
|
43
|
+
}
|
|
44
|
+
config.mcpServers.seshat = mcpEntry;
|
|
45
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2) + '\n', 'utf-8');
|
|
46
|
+
console.log(`Seshat MCP configured in ${configPath}`);
|
|
47
|
+
console.log(` command: ${npxCommand}`);
|
|
48
|
+
console.log(` api key: ${apiKey.slice(0, 4)}...${apiKey.slice(-4)}`);
|
|
49
|
+
console.log('');
|
|
50
|
+
console.log('Restart Claude Code to connect.');
|
|
51
|
+
process.exit(0);
|
|
52
|
+
}
|
|
13
53
|
// ─── Server Instructions ─────────────────────────────────────────
|
|
14
54
|
// Sent to the LLM at connection time. This is the "first contact" pitch.
|
|
15
55
|
const SERVER_INSTRUCTIONS = `Seshat provides structural code analysis backed by a compiled intermediate representation — not heuristic guesses or text search. Every function, class, and route in the synced codebase has been extracted into a typed symbol graph with dependency edges, data flow, constraints, and architectural layer tags. Results are precise and complete — if Seshat says a function has 3 callers, it has exactly 3 callers.
|
|
@@ -482,7 +522,7 @@ function getCloudUrl(path) {
|
|
|
482
522
|
async function main() {
|
|
483
523
|
const server = new Server({
|
|
484
524
|
name: 'seshat',
|
|
485
|
-
version: '0.16.
|
|
525
|
+
version: '0.16.1',
|
|
486
526
|
}, {
|
|
487
527
|
capabilities: { tools: {} },
|
|
488
528
|
instructions: SERVER_INSTRUCTIONS,
|
|
@@ -744,7 +784,7 @@ async function main() {
|
|
|
744
784
|
});
|
|
745
785
|
const transport = new StdioServerTransport();
|
|
746
786
|
await server.connect(transport);
|
|
747
|
-
process.stderr.write(`Seshat MCP v0.16.
|
|
787
|
+
process.stderr.write(`Seshat MCP v0.16.1 connected. Structural intelligence ready.\n`);
|
|
748
788
|
}
|
|
749
789
|
main().catch((err) => {
|
|
750
790
|
process.stderr.write(`Fatal: ${err.message}\n`);
|
package/package.json
CHANGED