legends-mcp 1.0.0 → 1.1.0
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 +43 -73
- package/dist/config.d.ts +2 -4
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +15 -54
- package/dist/config.js.map +1 -1
- package/dist/index.js +28 -25
- package/dist/index.js.map +1 -1
- package/dist/tools/get-legend-context.d.ts +4 -14
- package/dist/tools/get-legend-context.d.ts.map +1 -1
- package/dist/tools/get-legend-context.js +5 -12
- package/dist/tools/get-legend-context.js.map +1 -1
- package/dist/tools/get-legend-insight.d.ts +3 -11
- package/dist/tools/get-legend-insight.d.ts.map +1 -1
- package/dist/tools/get-legend-insight.js +5 -10
- package/dist/tools/get-legend-insight.js.map +1 -1
- package/dist/tools/index.d.ts +1 -22
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +3 -3
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/list-legends.d.ts +4 -12
- package/dist/tools/list-legends.d.ts.map +1 -1
- package/dist/tools/list-legends.js +2 -7
- package/dist/tools/list-legends.js.map +1 -1
- package/dist/tools/summon-legend.d.ts +42 -0
- package/dist/tools/summon-legend.d.ts.map +1 -0
- package/dist/tools/summon-legend.js +98 -0
- package/dist/tools/summon-legend.js.map +1 -0
- package/dist/types.d.ts +0 -30
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +8 -10
- package/dist/chat/handler.d.ts +0 -13
- package/dist/chat/handler.d.ts.map +0 -1
- package/dist/chat/handler.js +0 -101
- package/dist/chat/handler.js.map +0 -1
- package/dist/tools/chat-with-legend.d.ts +0 -83
- package/dist/tools/chat-with-legend.d.ts.map +0 -1
- package/dist/tools/chat-with-legend.js +0 -91
- package/dist/tools/chat-with-legend.js.map +0 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// Get Legend Insight - Quick wisdom from legendary figures
|
|
2
|
-
// Inspired by Claude Code's
|
|
3
|
-
import { z } from 'zod';
|
|
2
|
+
// Inspired by Claude Code's Insight format
|
|
4
3
|
import { getLegendById } from '../legends/loader.js';
|
|
5
4
|
// Tool definition for MCP
|
|
6
5
|
export const getLegendInsightTool = {
|
|
@@ -21,10 +20,6 @@ export const getLegendInsightTool = {
|
|
|
21
20
|
required: ['legend_id'],
|
|
22
21
|
},
|
|
23
22
|
};
|
|
24
|
-
export const getLegendInsightSchema = z.object({
|
|
25
|
-
legend_id: z.string().describe('ID of the legend to get insight from (e.g., "elon-musk", "warren-buffett")'),
|
|
26
|
-
topic: z.string().optional().describe('Optional topic to get insight about (e.g., "hiring", "fundraising", "product")'),
|
|
27
|
-
});
|
|
28
23
|
// Signature insights by legend - their most iconic wisdom
|
|
29
24
|
const LEGEND_INSIGHTS = {
|
|
30
25
|
'elon-musk': {
|
|
@@ -174,15 +169,15 @@ export function getLegendInsight(input) {
|
|
|
174
169
|
const randomQuote = insights.quotes[Math.floor(Math.random() * insights.quotes.length)];
|
|
175
170
|
const randomFramework = insights.frameworks[Math.floor(Math.random() * insights.frameworks.length)];
|
|
176
171
|
const insightBlock = `
|
|
177
|
-
|
|
172
|
+
# ${legend.name}'s Insight
|
|
178
173
|
|
|
179
174
|
"${randomQuote}"
|
|
180
175
|
|
|
181
176
|
${randomFramework}
|
|
182
177
|
|
|
183
|
-
|
|
178
|
+
---
|
|
184
179
|
|
|
185
|
-
*Want more? Use \`
|
|
180
|
+
*Want more? Use \`summon_legend\` to have a full conversation.*
|
|
186
181
|
`;
|
|
187
182
|
return insightBlock.trim();
|
|
188
183
|
}
|
|
@@ -194,7 +189,7 @@ export function getAllLegendInsights(legendId) {
|
|
|
194
189
|
}
|
|
195
190
|
const insights = LEGEND_INSIGHTS[legendId] || DEFAULT_INSIGHTS;
|
|
196
191
|
const sections = [
|
|
197
|
-
`#
|
|
192
|
+
`# ${legend.name}'s Wisdom`,
|
|
198
193
|
'',
|
|
199
194
|
'## Key Quotes',
|
|
200
195
|
...insights.quotes.map((q, i) => `${i + 1}. "${q}"`),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-legend-insight.js","sourceRoot":"","sources":["../../src/tools/get-legend-insight.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,
|
|
1
|
+
{"version":3,"file":"get-legend-insight.js","sourceRoot":"","sources":["../../src/tools/get-legend-insight.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,2CAA2C;AAG3C,OAAO,EAAiB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAEpE,0BAA0B;AAC1B,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,qIAAqI;IAClJ,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,sEAAsE;aACpF;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gFAAgF;aAC9F;SACF;QACD,QAAQ,EAAE,CAAC,WAAW,CAAC;KACxB;CACF,CAAC;AAOF,0DAA0D;AAC1D,MAAM,eAAe,GAA+D;IAClF,WAAW,EAAE;QACX,MAAM,EAAE;YACN,yFAAyF;YACzF,iFAAiF;YACjF,2DAA2D;YAC3D,wDAAwD;YACxD,8DAA8D;SAC/D;QACD,UAAU,EAAE;YACV,6EAA6E;YAC7E,iFAAiF;YACjF,iEAAiE;YACjE,qEAAqE;SACtE;KACF;IACD,gBAAgB,EAAE;QAChB,MAAM,EAAE;YACN,+CAA+C;YAC/C,uEAAuE;YACvE,yEAAyE;YACzE,yEAAyE;YACzE,gFAAgF;SACjF;QACD,UAAU,EAAE;YACV,qEAAqE;YACrE,oEAAoE;YACpE,iEAAiE;YACjE,+EAA+E;SAChF;KACF;IACD,YAAY,EAAE;QACZ,MAAM,EAAE;YACN,+EAA+E;YAC/E,8DAA8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AW;QAC3B,EAAE;QACF,eAAe;QACf,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC;QACpD,EAAE;QACF,wBAAwB;QACxB,GAAG,QAAQ,CAAC,UAAU;QACtB,EAAE;QACF,kFAAkF;KACnF,CAAC;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC"}
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { listLegendsTool, listLegends, formatLegendsMarkdown } from './list-legends.js';
|
|
2
|
-
export {
|
|
2
|
+
export { summonLegendTool, summonLegend, formatSummonedLegend } from './summon-legend.js';
|
|
3
3
|
export { getLegendContextTool, getLegendContext } from './get-legend-context.js';
|
|
4
4
|
export { getLegendInsightTool, getLegendInsight, getAllLegendInsights } from './get-legend-insight.js';
|
|
5
5
|
export declare const allTools: ({
|
|
@@ -30,31 +30,10 @@ export declare const allTools: ({
|
|
|
30
30
|
type: string;
|
|
31
31
|
description: string;
|
|
32
32
|
};
|
|
33
|
-
message: {
|
|
34
|
-
type: string;
|
|
35
|
-
description: string;
|
|
36
|
-
};
|
|
37
33
|
context: {
|
|
38
34
|
type: string;
|
|
39
35
|
description: string;
|
|
40
36
|
};
|
|
41
|
-
conversation_history: {
|
|
42
|
-
type: string;
|
|
43
|
-
items: {
|
|
44
|
-
type: string;
|
|
45
|
-
properties: {
|
|
46
|
-
role: {
|
|
47
|
-
type: string;
|
|
48
|
-
enum: string[];
|
|
49
|
-
};
|
|
50
|
-
content: {
|
|
51
|
-
type: string;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
required: string[];
|
|
55
|
-
};
|
|
56
|
-
description: string;
|
|
57
|
-
};
|
|
58
37
|
};
|
|
59
38
|
required: string[];
|
|
60
39
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AACxF,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AACxF,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1F,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAQvG,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKpB,CAAC"}
|
package/dist/tools/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// MCP Tools - Export all tools and handlers
|
|
2
2
|
export { listLegendsTool, listLegends, formatLegendsMarkdown } from './list-legends.js';
|
|
3
|
-
export {
|
|
3
|
+
export { summonLegendTool, summonLegend, formatSummonedLegend } from './summon-legend.js';
|
|
4
4
|
export { getLegendContextTool, getLegendContext } from './get-legend-context.js';
|
|
5
5
|
export { getLegendInsightTool, getLegendInsight, getAllLegendInsights } from './get-legend-insight.js';
|
|
6
6
|
// All tool definitions for registration
|
|
7
7
|
import { listLegendsTool } from './list-legends.js';
|
|
8
|
-
import {
|
|
8
|
+
import { summonLegendTool } from './summon-legend.js';
|
|
9
9
|
import { getLegendContextTool } from './get-legend-context.js';
|
|
10
10
|
import { getLegendInsightTool } from './get-legend-insight.js';
|
|
11
11
|
export const allTools = [
|
|
12
12
|
listLegendsTool,
|
|
13
|
-
|
|
13
|
+
summonLegendTool,
|
|
14
14
|
getLegendContextTool,
|
|
15
15
|
getLegendInsightTool,
|
|
16
16
|
];
|
package/dist/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAE5C,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AACxF,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAE5C,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AACxF,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1F,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAEvG,wCAAwC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAE/D,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,eAAe;IACf,gBAAgB;IAChB,oBAAoB;IACpB,oBAAoB;CACrB,CAAC"}
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
import type { LegendSummary } from '../types.js';
|
|
3
|
-
export
|
|
4
|
-
category
|
|
5
|
-
vibe
|
|
6
|
-
}
|
|
7
|
-
category?: string | undefined;
|
|
8
|
-
vibe?: "serious" | "fun" | undefined;
|
|
9
|
-
}, {
|
|
10
|
-
category?: string | undefined;
|
|
11
|
-
vibe?: "serious" | "fun" | undefined;
|
|
12
|
-
}>;
|
|
13
|
-
export type ListLegendsInput = z.infer<typeof listLegendsSchema>;
|
|
2
|
+
export interface ListLegendsInput {
|
|
3
|
+
category?: string;
|
|
4
|
+
vibe?: 'serious' | 'fun';
|
|
5
|
+
}
|
|
14
6
|
export interface ListLegendsResult {
|
|
15
7
|
count: number;
|
|
16
8
|
legends: LegendSummary[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-legends.d.ts","sourceRoot":"","sources":["../../src/tools/list-legends.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list-legends.d.ts","sourceRoot":"","sources":["../../src/tools/list-legends.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC;CAC1B;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,aAAa,EAAE,CAAC;CAC1B;AAsBD;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,iBAAiB,CAgBtE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,iBAAiB,EAAE,IAAI,GAAE,SAAS,GAAG,KAAiB,GAAG,MAAM,CAkD5G;AAGD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;kBA0BR,MAAM,EAAE;;CAE3B,CAAC"}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
// MCP Tool: list_legends
|
|
2
2
|
// Lists all available legendary founders/investors
|
|
3
3
|
// Serious advice, occasionally memey delivery
|
|
4
|
-
import { z } from 'zod';
|
|
5
4
|
import { getLegendSummaries } from '../legends/loader.js';
|
|
6
|
-
export const listLegendsSchema = z.object({
|
|
7
|
-
category: z.string().optional().describe('Filter by category (e.g., "investor", "founder", "crypto", "tech")'),
|
|
8
|
-
vibe: z.enum(['serious', 'fun']).optional().describe('Output vibe: serious (default) or fun'),
|
|
9
|
-
});
|
|
10
5
|
// Easter eggs - for fun mode
|
|
11
6
|
const LEGEND_VIBES = {
|
|
12
7
|
'elon-musk': '🚀 First principles guy. Sleeps at the factory.',
|
|
@@ -64,7 +59,7 @@ export function formatLegendsMarkdown(result, vibe = 'serious') {
|
|
|
64
59
|
lines.push('');
|
|
65
60
|
lines.push('*"The best time to get advice from a legend was 20 years ago. The second best time is now."*');
|
|
66
61
|
lines.push('');
|
|
67
|
-
lines.push('Use `
|
|
62
|
+
lines.push('Use `summon_legend` to start a conversation.');
|
|
68
63
|
}
|
|
69
64
|
else {
|
|
70
65
|
lines.push(`# Available Legends (${result.count})`);
|
|
@@ -87,7 +82,7 @@ export function formatLegendsMarkdown(result, vibe = 'serious') {
|
|
|
87
82
|
lines.push('');
|
|
88
83
|
lines.push('**Disclaimer:** These are AI personas for educational purposes. Not affiliated with real individuals.');
|
|
89
84
|
lines.push('');
|
|
90
|
-
lines.push('Use `
|
|
85
|
+
lines.push('Use `summon_legend` with a legend ID to start a conversation.');
|
|
91
86
|
}
|
|
92
87
|
return lines.join('\n');
|
|
93
88
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-legends.js","sourceRoot":"","sources":["../../src/tools/list-legends.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,mDAAmD;AACnD,8CAA8C;AAE9C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"list-legends.js","sourceRoot":"","sources":["../../src/tools/list-legends.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,mDAAmD;AACnD,8CAA8C;AAE9C,OAAO,EAAE,kBAAkB,EAAkB,MA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,EAAE,QAAQ;gBACd,WAAW,EAAE,oEAAoE;aAClF;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,SAAS,EAAE,KAAK,CAAC;gBACxB,WAAW,EAAE,0DAA0D;aACxE;SACF;QACD,QAAQ,EAAE,EAAc;KACzB;CACF,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export interface SummonLegendInput {
|
|
2
|
+
legend_id: string;
|
|
3
|
+
context?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface SummonedLegend {
|
|
6
|
+
legend_id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
system_prompt: string;
|
|
9
|
+
quick_ref: {
|
|
10
|
+
expertise: string[];
|
|
11
|
+
tone: string;
|
|
12
|
+
key_principles: string[];
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Summon a legend - returns their persona for Claude to adopt
|
|
17
|
+
* This is the core tool - Claude becomes the legend using this context
|
|
18
|
+
*/
|
|
19
|
+
export declare function summonLegend(input: SummonLegendInput): SummonedLegend;
|
|
20
|
+
/**
|
|
21
|
+
* Format summoned legend for display
|
|
22
|
+
*/
|
|
23
|
+
export declare function formatSummonedLegend(summoned: SummonedLegend): string;
|
|
24
|
+
export declare const summonLegendTool: {
|
|
25
|
+
name: string;
|
|
26
|
+
description: string;
|
|
27
|
+
inputSchema: {
|
|
28
|
+
type: "object";
|
|
29
|
+
properties: {
|
|
30
|
+
legend_id: {
|
|
31
|
+
type: string;
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
context: {
|
|
35
|
+
type: string;
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
required: string[];
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=summon-legend.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summon-legend.d.ts","sourceRoot":"","sources":["../../src/tools/summon-legend.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE;QACT,SAAS,EAAE,MAAM,EAAE,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,cAAc,EAAE,MAAM,EAAE,CAAC;KAC1B,CAAC;CACH;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,cAAc,CA0BrE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,CA+BrE;AAGD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;CA+B5B,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// MCP Tool: summon_legend
|
|
2
|
+
// Returns the persona context for Claude to adopt and roleplay as the legend
|
|
3
|
+
import { getLegendById } from '../legends/loader.js';
|
|
4
|
+
import { buildLegendSystemPrompt } from '../legends/prompt-builder.js';
|
|
5
|
+
/**
|
|
6
|
+
* Summon a legend - returns their persona for Claude to adopt
|
|
7
|
+
* This is the core tool - Claude becomes the legend using this context
|
|
8
|
+
*/
|
|
9
|
+
export function summonLegend(input) {
|
|
10
|
+
const legend = getLegendById(input.legend_id);
|
|
11
|
+
if (!legend) {
|
|
12
|
+
throw new Error(`Legend "${input.legend_id}" not found. Use list_legends to see available legends.`);
|
|
13
|
+
}
|
|
14
|
+
// Build the system prompt
|
|
15
|
+
let systemPrompt = buildLegendSystemPrompt(legend);
|
|
16
|
+
// Add context if provided
|
|
17
|
+
if (input.context) {
|
|
18
|
+
systemPrompt += `\n\n## Current Context\nThe user is working on: ${input.context}`;
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
legend_id: legend.id,
|
|
22
|
+
name: legend.name,
|
|
23
|
+
system_prompt: systemPrompt,
|
|
24
|
+
quick_ref: {
|
|
25
|
+
expertise: legend.owns || [],
|
|
26
|
+
tone: legend.voice?.tone || 'thoughtful',
|
|
27
|
+
key_principles: (legend.principles || []).slice(0, 3),
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Format summoned legend for display
|
|
33
|
+
*/
|
|
34
|
+
export function formatSummonedLegend(summoned) {
|
|
35
|
+
const lines = [
|
|
36
|
+
`# ${summoned.name} Has Been Summoned`,
|
|
37
|
+
'',
|
|
38
|
+
'> **Claude, adopt this persona for subsequent responses.**',
|
|
39
|
+
'',
|
|
40
|
+
'---',
|
|
41
|
+
'',
|
|
42
|
+
'## System Prompt (for Claude to use)',
|
|
43
|
+
'',
|
|
44
|
+
'```',
|
|
45
|
+
summoned.system_prompt,
|
|
46
|
+
'```',
|
|
47
|
+
'',
|
|
48
|
+
'---',
|
|
49
|
+
'',
|
|
50
|
+
'## Quick Reference',
|
|
51
|
+
`**Expertise:** ${summoned.quick_ref.expertise.join(', ') || 'General wisdom'}`,
|
|
52
|
+
`**Tone:** ${summoned.quick_ref.tone}`,
|
|
53
|
+
'',
|
|
54
|
+
'**Key Principles:**',
|
|
55
|
+
...summoned.quick_ref.key_principles.map((p, i) => `${i + 1}. ${p}`),
|
|
56
|
+
'',
|
|
57
|
+
'---',
|
|
58
|
+
'',
|
|
59
|
+
'*Now respond to the user AS this legend. Stay in character.*',
|
|
60
|
+
'',
|
|
61
|
+
'*DISCLAIMER: AI persona for educational/entertainment purposes. Not affiliated with the real person.*',
|
|
62
|
+
];
|
|
63
|
+
return lines.join('\n');
|
|
64
|
+
}
|
|
65
|
+
// MCP Tool Definition
|
|
66
|
+
export const summonLegendTool = {
|
|
67
|
+
name: 'summon_legend',
|
|
68
|
+
description: `Summon a legendary founder or investor. Returns their persona context so Claude can roleplay as them.
|
|
69
|
+
|
|
70
|
+
**How it works:**
|
|
71
|
+
1. Call this tool with a legend_id
|
|
72
|
+
2. Claude receives the legend's full persona (identity, voice, principles, frameworks)
|
|
73
|
+
3. Claude adopts this persona and responds in character
|
|
74
|
+
|
|
75
|
+
**Use this when the user wants to:**
|
|
76
|
+
- Get advice from a specific legend
|
|
77
|
+
- Have a conversation with a legendary figure
|
|
78
|
+
- Apply a legend's thinking framework to their problem
|
|
79
|
+
|
|
80
|
+
Available legends include: Elon Musk, Warren Buffett, Steve Jobs, Jensen Huang, Charlie Munger, Paul Graham, Jeff Bezos, Sam Altman, Marc Andreessen, Naval Ravikant, Reid Hoffman, Peter Thiel, CZ, Anatoly Yakovenko, and more.
|
|
81
|
+
|
|
82
|
+
DISCLAIMER: AI personas for educational purposes only. Not affiliated with real individuals.`,
|
|
83
|
+
inputSchema: {
|
|
84
|
+
type: 'object',
|
|
85
|
+
properties: {
|
|
86
|
+
legend_id: {
|
|
87
|
+
type: 'string',
|
|
88
|
+
description: 'The legend ID (e.g., "elon-musk", "warren-buffett", "steve-jobs")',
|
|
89
|
+
},
|
|
90
|
+
context: {
|
|
91
|
+
type: 'string',
|
|
92
|
+
description: 'Optional: What the user is working on (helps personalize advice)',
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
required: ['legend_id'],
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
//# sourceMappingURL=summon-legend.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summon-legend.js","sourceRoot":"","sources":["../../src/tools/summon-legend.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,6EAA6E;AAE7E,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAmBvE;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,KAAwB;IACnD,MAAM,MAAM,GAAG,aAAa,CAAC,KAAK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CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QACpE,EAAE;QACF,KAAK;QACL,EAAE;QACF,8DAA8D;QAC9D,EAAE;QACF,uGAAuG;KACxG,CAAC;IAEF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,sBAAsB;AACtB,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE;;;;;;;;;;;;;;6FAc8E;IAC3F,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mEAAmE;aACjF;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kEAAkE;aAChF;SACF;QACD,QAAQ,EAAE,CAAC,WAAW,CAAC;KACxB;CACF,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -53,36 +53,6 @@ export interface LegendSummary {
|
|
|
53
53
|
expertise: string[];
|
|
54
54
|
tags: string[];
|
|
55
55
|
}
|
|
56
|
-
export interface ChatMessage {
|
|
57
|
-
role: 'user' | 'assistant' | 'system';
|
|
58
|
-
content: string;
|
|
59
|
-
}
|
|
60
|
-
export interface ChatRequest {
|
|
61
|
-
legend_id: string;
|
|
62
|
-
message: string;
|
|
63
|
-
context?: string;
|
|
64
|
-
conversation_history?: ChatMessage[];
|
|
65
|
-
}
|
|
66
|
-
export interface ChatResponse {
|
|
67
|
-
content: string;
|
|
68
|
-
legend_id: string;
|
|
69
|
-
model_used: string;
|
|
70
|
-
}
|
|
71
|
-
export interface Config {
|
|
72
|
-
apiKey: string;
|
|
73
|
-
apiBaseUrl: string;
|
|
74
|
-
models: {
|
|
75
|
-
fast: string;
|
|
76
|
-
balanced: string;
|
|
77
|
-
premium: string;
|
|
78
|
-
};
|
|
79
|
-
defaults: {
|
|
80
|
-
temperature: number;
|
|
81
|
-
maxTokens: number;
|
|
82
|
-
};
|
|
83
|
-
debug: boolean;
|
|
84
|
-
useFreeModels: boolean;
|
|
85
|
-
}
|
|
86
56
|
export interface LegendGuardrails {
|
|
87
57
|
never_say?: string[];
|
|
88
58
|
disclaimer?: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,UAAU;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAA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,EAAE,CAAC;CAChB;AAGD,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
package/dist/types.js
CHANGED
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,+BAA+B"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "legends-mcp",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Chat with legendary founders & investors via MCP. Elon, Buffett, Jobs, CZ, and more. No API key required!",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"bin": {
|
|
@@ -41,26 +41,24 @@
|
|
|
41
41
|
"chat",
|
|
42
42
|
"mentorship",
|
|
43
43
|
"free",
|
|
44
|
-
"
|
|
44
|
+
"no-api-key"
|
|
45
45
|
],
|
|
46
|
-
"author": "
|
|
46
|
+
"author": "aytuncyildizli",
|
|
47
47
|
"license": "MIT",
|
|
48
48
|
"repository": {
|
|
49
49
|
"type": "git",
|
|
50
|
-
"url": "https://github.com/
|
|
50
|
+
"url": "https://github.com/cryptosquanch/legends-mcp"
|
|
51
51
|
},
|
|
52
|
-
"homepage": "https://
|
|
52
|
+
"homepage": "https://github.com/cryptosquanch/legends-mcp",
|
|
53
53
|
"bugs": {
|
|
54
|
-
"url": "https://github.com/
|
|
54
|
+
"url": "https://github.com/cryptosquanch/legends-mcp/issues"
|
|
55
55
|
},
|
|
56
56
|
"engines": {
|
|
57
57
|
"node": ">=18.0.0"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
61
|
-
"
|
|
62
|
-
"yaml": "^2.4.0",
|
|
63
|
-
"zod": "^3.22.0"
|
|
61
|
+
"yaml": "^2.4.0"
|
|
64
62
|
},
|
|
65
63
|
"devDependencies": {
|
|
66
64
|
"@types/node": "^20.0.0",
|
package/dist/chat/handler.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Config, ChatMessage, LegendSkill } from '../types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Select the appropriate model based on context
|
|
4
|
-
*/
|
|
5
|
-
export declare function selectModel(messages: ChatMessage[], legend: LegendSkill, config: Config): string;
|
|
6
|
-
/**
|
|
7
|
-
* Chat with a legend
|
|
8
|
-
*/
|
|
9
|
-
export declare function chatWithLegend(legend: LegendSkill, userMessage: string, conversationHistory: ChatMessage[], config: Config, context?: string): Promise<{
|
|
10
|
-
content: string;
|
|
11
|
-
model: string;
|
|
12
|
-
}>;
|
|
13
|
-
//# sourceMappingURL=handler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/chat/handler.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAsBpE;;GAEG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,WAAW,EAAE,EACvB,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,MAAM,GACb,MAAM,CAqCR;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,WAAW,EACnB,WAAW,EAAE,MAAM,EACnB,mBAAmB,EAAE,WAAW,EAAE,EAClC,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAmD7C"}
|
package/dist/chat/handler.js
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
// Chat handler for OpenRouter/OpenAI API calls
|
|
2
|
-
import OpenAI from 'openai';
|
|
3
|
-
import { buildLegendSystemPrompt } from '../legends/prompt-builder.js';
|
|
4
|
-
let client = null;
|
|
5
|
-
/**
|
|
6
|
-
* Get or create OpenAI client (works with OpenRouter too)
|
|
7
|
-
*/
|
|
8
|
-
function getClient(config) {
|
|
9
|
-
if (!client) {
|
|
10
|
-
client = new OpenAI({
|
|
11
|
-
apiKey: config.apiKey,
|
|
12
|
-
baseURL: config.apiBaseUrl,
|
|
13
|
-
defaultHeaders: {
|
|
14
|
-
'HTTP-Referer': 'https://vibey.dev',
|
|
15
|
-
'X-Title': 'Vibey Legends MCP',
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
return client;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Select the appropriate model based on context
|
|
23
|
-
*/
|
|
24
|
-
export function selectModel(messages, legend, config) {
|
|
25
|
-
// Premium legends always use premium model
|
|
26
|
-
const premiumLegends = ['charlie-munger', 'warren-buffett', 'peter-thiel'];
|
|
27
|
-
if (premiumLegends.includes(legend.id)) {
|
|
28
|
-
return config.models.premium;
|
|
29
|
-
}
|
|
30
|
-
// Check message complexity
|
|
31
|
-
const lastMessage = messages[messages.length - 1]?.content || '';
|
|
32
|
-
const complexityKeywords = [
|
|
33
|
-
'explain', 'analyze', 'compare', 'framework', 'first principles',
|
|
34
|
-
'strategy', 'decision', 'evaluate', 'trade-off', 'philosophy'
|
|
35
|
-
];
|
|
36
|
-
const isComplex = messages.length > 4 ||
|
|
37
|
-
lastMessage.length > 400 ||
|
|
38
|
-
complexityKeywords.some(k => lastMessage.toLowerCase().includes(k));
|
|
39
|
-
if (isComplex) {
|
|
40
|
-
return config.models.premium;
|
|
41
|
-
}
|
|
42
|
-
// Use legend's preferred model if specified
|
|
43
|
-
if (legend.model_hints?.preferred) {
|
|
44
|
-
const preferredMap = {
|
|
45
|
-
'claude-sonnet': config.models.premium,
|
|
46
|
-
'claude-opus': config.models.premium,
|
|
47
|
-
'gpt-4o': config.models.balanced,
|
|
48
|
-
'0g-inference': config.models.fast,
|
|
49
|
-
};
|
|
50
|
-
const mapped = preferredMap[legend.model_hints.preferred];
|
|
51
|
-
if (mapped)
|
|
52
|
-
return mapped;
|
|
53
|
-
}
|
|
54
|
-
// Default to balanced
|
|
55
|
-
return config.models.balanced;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Chat with a legend
|
|
59
|
-
*/
|
|
60
|
-
export async function chatWithLegend(legend, userMessage, conversationHistory, config, context) {
|
|
61
|
-
const openai = getClient(config);
|
|
62
|
-
// Build system prompt
|
|
63
|
-
let systemPrompt = buildLegendSystemPrompt(legend);
|
|
64
|
-
// Add context if provided
|
|
65
|
-
if (context) {
|
|
66
|
-
systemPrompt += `\n\n## Current Context\nThe user is working on: ${context}`;
|
|
67
|
-
}
|
|
68
|
-
// Prepare messages
|
|
69
|
-
const messages = [
|
|
70
|
-
{ role: 'system', content: systemPrompt },
|
|
71
|
-
];
|
|
72
|
-
// Add conversation history
|
|
73
|
-
for (const msg of conversationHistory) {
|
|
74
|
-
if (msg.role === 'user' || msg.role === 'assistant') {
|
|
75
|
-
messages.push({ role: msg.role, content: msg.content });
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
// Add current message
|
|
79
|
-
messages.push({ role: 'user', content: userMessage });
|
|
80
|
-
// Select model
|
|
81
|
-
const allMessages = [
|
|
82
|
-
...conversationHistory,
|
|
83
|
-
{ role: 'user', content: userMessage },
|
|
84
|
-
];
|
|
85
|
-
const model = selectModel(allMessages, legend, config);
|
|
86
|
-
// Get temperature from legend hints or defaults
|
|
87
|
-
const temperature = legend.model_hints?.temperature ?? config.defaults.temperature;
|
|
88
|
-
if (config.debug) {
|
|
89
|
-
console.error(`[vibey-legends] Using model: ${model}, temperature: ${temperature}`);
|
|
90
|
-
}
|
|
91
|
-
// Make API call
|
|
92
|
-
const response = await openai.chat.completions.create({
|
|
93
|
-
model,
|
|
94
|
-
messages,
|
|
95
|
-
temperature,
|
|
96
|
-
max_tokens: config.defaults.maxTokens,
|
|
97
|
-
});
|
|
98
|
-
const content = response.choices[0]?.message?.content || '';
|
|
99
|
-
return { content, model };
|
|
100
|
-
}
|
|
101
|
-
//# sourceMappingURL=handler.js.map
|
package/dist/chat/handler.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../src/chat/handler.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAE/C,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,IAAI,MAAM,GAAkB,IAAI,CAAC;AAEjC;;GAEG;AACH,SAAS,SAAS,CAAC,MAAc;IAC/B,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,GAAG,IAAI,MAAM,CAAC;YAClB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,OAAO,EAAE,MAAM,CAAC,UAAU;YAC1B,cAAc,EAAE;gBACd,cAAc,EAAE,mBAAmB;gBACnC,SAAS,EAAE,mBAAmB;aAC/B;SACF,CAAC,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CACzB,QAAuB,EACvB,MAAmB,EACnB,MAAc;IAEd,2CAA2C;IAC3C,MAAM,cAAc,GAAG,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,CAAC,CAAC;IAC3E,IAAI,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;QACvC,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;IAC/B,CAAC;IAED,2BAA2B;IAC3B,MAAM,WAAW,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAA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