secondbrainos-mcp-server 1.5.0 → 1.5.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/build/index.js +14 -19
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -318,25 +318,21 @@ class SecondBrainOSServer {
|
|
|
318
318
|
}
|
|
319
319
|
// Otherwise treat as a workflow prompt
|
|
320
320
|
const workflowId = this.workflowNameToId.get(promptName) || promptName;
|
|
321
|
-
//
|
|
321
|
+
// Single call — list response now includes prompt metadata per workflow
|
|
322
322
|
const workflowsData = await this.callRunPromptChain('', '');
|
|
323
323
|
const workflowMeta = (workflowsData.workflows || []).find((wf) => wf.workflow_id === workflowId);
|
|
324
|
-
const
|
|
325
|
-
|
|
326
|
-
if (promptIds.length === 0) {
|
|
324
|
+
const prompts = workflowMeta?.prompts || [];
|
|
325
|
+
if (prompts.length === 0) {
|
|
327
326
|
throw new McpError(ErrorCode.InvalidRequest, `No prompts found for workflow: ${workflowId}`);
|
|
328
327
|
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
};
|
|
338
|
-
}));
|
|
339
|
-
const sortedPrompts = promptResults.sort((a, b) => (a.order || 0) - (b.order || 0));
|
|
328
|
+
const sortedPrompts = prompts
|
|
329
|
+
.map((p) => ({
|
|
330
|
+
id: p.prompt_id,
|
|
331
|
+
name: p.name || '',
|
|
332
|
+
order: p.order || 0,
|
|
333
|
+
description: p.description || ''
|
|
334
|
+
}))
|
|
335
|
+
.sort((a, b) => (a.order || 0) - (b.order || 0));
|
|
340
336
|
const workflowDocument = {
|
|
341
337
|
skill_id: workflowId,
|
|
342
338
|
name: workflowMeta?.name || promptName,
|
|
@@ -665,13 +661,12 @@ class SecondBrainOSServer {
|
|
|
665
661
|
// This method is kept for future error handling implementations
|
|
666
662
|
}
|
|
667
663
|
async run() {
|
|
664
|
+
// Write skill files before connecting so Claude Code sees them at session start.
|
|
665
|
+
// This is fast now (~2-3s) since enrichment uses single API calls.
|
|
666
|
+
await this.writeSkillFiles().catch(err => console.error('Failed to write skill files:', err));
|
|
668
667
|
const transport = new StdioServerTransport();
|
|
669
668
|
await this.server.connect(transport);
|
|
670
669
|
console.error("Second Brain OS MCP server running on stdio");
|
|
671
|
-
// Write skill files AFTER connecting so the MCP handshake completes
|
|
672
|
-
// within Claude Code's 30s timeout. Skill files are written in the
|
|
673
|
-
// background — they'll be available for subsequent conversations.
|
|
674
|
-
this.writeSkillFiles().catch(err => console.error('Failed to write skill files:', err));
|
|
675
670
|
}
|
|
676
671
|
}
|
|
677
672
|
SecondBrainOSServer.ALLOWED_EXTENSIONS = ['.txt', '.md'];
|