@cachly-dev/mcp-server 0.6.1 → 0.7.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/CHANGELOG.md +44 -1
- package/README.md +74 -0
- package/dist/index.js +90 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +124 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cachly-dev/mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"mcpName": "io.github.cachly-dev/mcp-server",
|
|
5
5
|
"description": "AI memory brain for Claude Code, Cursor, Copilot & Windsurf — persistent sessions, lessons learned, semantic search, team brain. 51 MCP tools.",
|
|
6
6
|
"type": "module",
|
package/src/index.ts
CHANGED
|
@@ -55,7 +55,7 @@ import { Redis } from 'ioredis';
|
|
|
55
55
|
const API_URL = process.env.CACHLY_API_URL ?? 'https://api.cachly.dev';
|
|
56
56
|
const JWT = process.env.CACHLY_JWT ?? '';
|
|
57
57
|
const EMBED_MODEL = process.env.CACHLY_EMBED_MODEL ?? '';
|
|
58
|
-
const CURRENT_VERSION = '0.
|
|
58
|
+
const CURRENT_VERSION = '0.7.0';
|
|
59
59
|
/**
|
|
60
60
|
* ┌──────────────────────────────────────────────────────────────────────┐
|
|
61
61
|
* │ EMBEDDING PROVIDER — pluggable, client-side first │
|
|
@@ -3484,6 +3484,47 @@ const TOOLS = [
|
|
|
3484
3484
|
required: ['instance_id'],
|
|
3485
3485
|
},
|
|
3486
3486
|
},
|
|
3487
|
+
// ── v0.7 Knowledge Syndication ────────────────────────────────────────────
|
|
3488
|
+
{
|
|
3489
|
+
name: 'syndicate',
|
|
3490
|
+
description:
|
|
3491
|
+
'Contribute a verified lesson to the GLOBAL Cachly Knowledge Commons — ' +
|
|
3492
|
+
'a privacy-preserving shared brain where every AI instance can learn from the discoveries ' +
|
|
3493
|
+
'of every other. Your contributor identity is a one-way HMAC hash: completely anonymous. ' +
|
|
3494
|
+
'The lesson is immediately searchable by any other AI using syndicate_search. ' +
|
|
3495
|
+
'This is how individual knowledge becomes collective intelligence. ' +
|
|
3496
|
+
'Call this AFTER every learn_from_attempts that is worth sharing universally ' +
|
|
3497
|
+
'(critical bugs, deployment gotchas, architecture discoveries).',
|
|
3498
|
+
inputSchema: {
|
|
3499
|
+
type: 'object',
|
|
3500
|
+
properties: {
|
|
3501
|
+
topic: { type: 'string', description: 'Topic key in category:keyword format (e.g. "fix:clickhouse-ipv6", "deploy:docker-compose")' },
|
|
3502
|
+
outcome: { type: 'string', enum: ['success', 'failure', 'partial'], description: 'Result of the attempt (default: success)' },
|
|
3503
|
+
what_worked: { type: 'string', description: 'Exact approach, command, or fix that worked. File paths are stripped automatically.' },
|
|
3504
|
+
what_failed: { type: 'string', description: 'What failed or was wrong — helps others avoid the same trap.' },
|
|
3505
|
+
severity: { type: 'string', enum: ['critical', 'major', 'minor'], description: 'How severe the issue was (default: minor)' },
|
|
3506
|
+
tags: { type: 'array', items: { type: 'string' }, description: 'Up to 10 keywords for better discoverability' },
|
|
3507
|
+
},
|
|
3508
|
+
required: ['topic', 'what_worked'],
|
|
3509
|
+
},
|
|
3510
|
+
},
|
|
3511
|
+
{
|
|
3512
|
+
name: 'syndicate_search',
|
|
3513
|
+
description:
|
|
3514
|
+
'Search the GLOBAL Cachly Knowledge Commons for solutions contributed by the entire community. ' +
|
|
3515
|
+
'Returns lessons ranked by confirm_count (trust score) then recency. ' +
|
|
3516
|
+
'Use this BEFORE debugging any unknown issue — someone in the global brain likely solved it already. ' +
|
|
3517
|
+
'Example: syndicate_search(q="clickhouse localhost connection refused") → ' +
|
|
3518
|
+
'"fix: use 127.0.0.1 not localhost when IPv6 is disabled · confirmed by 47 instances"',
|
|
3519
|
+
inputSchema: {
|
|
3520
|
+
type: 'object',
|
|
3521
|
+
properties: {
|
|
3522
|
+
q: { type: 'string', description: 'Free-text search query (leave empty for most recent lessons)' },
|
|
3523
|
+
limit: { type: 'number', description: 'Max results to return (default: 20, max: 50)' },
|
|
3524
|
+
},
|
|
3525
|
+
required: [],
|
|
3526
|
+
},
|
|
3527
|
+
},
|
|
3487
3528
|
] as const;
|
|
3488
3529
|
|
|
3489
3530
|
// ── Handlers ──────────────────────────────────────────────────────────────────
|
|
@@ -7551,6 +7592,88 @@ smart_recall(
|
|
|
7551
7592
|
].join('\n');
|
|
7552
7593
|
}
|
|
7553
7594
|
|
|
7595
|
+
// ── v0.7 Knowledge Syndication: syndicate ────────────────────────────────
|
|
7596
|
+
case 'syndicate': {
|
|
7597
|
+
const { topic, outcome = 'success', what_worked, what_failed = '', severity = 'minor', tags = [] } = args as {
|
|
7598
|
+
topic: string; outcome?: string; what_worked: string; what_failed?: string; severity?: string; tags?: string[];
|
|
7599
|
+
};
|
|
7600
|
+
|
|
7601
|
+
if (!topic || !what_worked) {
|
|
7602
|
+
throw new McpError(ErrorCode.InvalidParams, 'topic and what_worked are required');
|
|
7603
|
+
}
|
|
7604
|
+
|
|
7605
|
+
const body = { topic, outcome, what_worked, what_failed, severity, tags };
|
|
7606
|
+
const res = await apiFetch<{ id: string; topic: string; outcome: string; message: string }>(
|
|
7607
|
+
'/api/v1/syndication/contribute',
|
|
7608
|
+
{ method: 'POST', body: JSON.stringify(body) }
|
|
7609
|
+
);
|
|
7610
|
+
|
|
7611
|
+
return [
|
|
7612
|
+
`🌐 **Lesson syndicated to the global Knowledge Commons**`,
|
|
7613
|
+
``,
|
|
7614
|
+
`**ID:** \`${res.id}\``,
|
|
7615
|
+
`**Topic:** \`${res.topic}\` · **Outcome:** ${res.outcome}`,
|
|
7616
|
+
``,
|
|
7617
|
+
`Your lesson is now searchable by every AI brain in the network.`,
|
|
7618
|
+
`When another instance confirms it works, its trust score rises automatically.`,
|
|
7619
|
+
``,
|
|
7620
|
+
`**Tip:** Use \`syndicate_search(q="${topic}")\` to see all community lessons on this topic.`,
|
|
7621
|
+
].join('\n');
|
|
7622
|
+
}
|
|
7623
|
+
|
|
7624
|
+
// ── v0.7 Knowledge Syndication: syndicate_search ─────────────────────────
|
|
7625
|
+
case 'syndicate_search': {
|
|
7626
|
+
const { q = '', limit = 20 } = args as { q?: string; limit?: number };
|
|
7627
|
+
|
|
7628
|
+
const params = new URLSearchParams();
|
|
7629
|
+
if (q) params.set('q', q);
|
|
7630
|
+
params.set('limit', String(Math.min(Math.max(1, limit), 50)));
|
|
7631
|
+
|
|
7632
|
+
const res = await apiFetch<{ results: Array<{
|
|
7633
|
+
id: string; topic: string; category: string; outcome: string;
|
|
7634
|
+
what_worked: string; what_failed: string; severity: string;
|
|
7635
|
+
confirm_count: number; created_at: string;
|
|
7636
|
+
}>; count: number; query: string }>(`/api/v1/syndication/search?${params}`);
|
|
7637
|
+
|
|
7638
|
+
if (!res.results || res.results.length === 0) {
|
|
7639
|
+
return q
|
|
7640
|
+
? `No lessons found for "${q}" in the global Knowledge Commons yet.\n\nBe the first to contribute: \`syndicate(topic="...", what_worked="...")\``
|
|
7641
|
+
: `The global Knowledge Commons is empty. Be the first contributor:\n\`syndicate(topic="deploy:api", what_worked="...")\``;
|
|
7642
|
+
}
|
|
7643
|
+
|
|
7644
|
+
const outcomeIcon = (o: string) => o === 'success' ? '✅' : o === 'failure' ? '❌' : '⚠️';
|
|
7645
|
+
const severityLabel = (s: string) => s === 'critical' ? '🔴' : s === 'major' ? '🟡' : '🟢';
|
|
7646
|
+
const confirmBar = (n: number) => {
|
|
7647
|
+
const filled = Math.min(10, Math.round(n / 5));
|
|
7648
|
+
return '█'.repeat(filled) + '░'.repeat(10 - filled) + ` ×${n}`;
|
|
7649
|
+
};
|
|
7650
|
+
|
|
7651
|
+
const lines: string[] = [
|
|
7652
|
+
`## 🌐 Global Knowledge Commons${q ? ` — "${q}"` : ' — Recent'}`,
|
|
7653
|
+
`*${res.count} lesson${res.count === 1 ? '' : 's'} found*`,
|
|
7654
|
+
``,
|
|
7655
|
+
];
|
|
7656
|
+
|
|
7657
|
+
for (const lesson of res.results) {
|
|
7658
|
+
lines.push(
|
|
7659
|
+
`### ${outcomeIcon(lesson.outcome)} \`${lesson.topic}\` ${severityLabel(lesson.severity)}`,
|
|
7660
|
+
`**Trust:** ${confirmBar(lesson.confirm_count)}`,
|
|
7661
|
+
lesson.what_worked ? `**What worked:** ${lesson.what_worked}` : '',
|
|
7662
|
+
lesson.what_failed ? `**What failed:** ${lesson.what_failed}` : '',
|
|
7663
|
+
`*Contributed ${new Date(lesson.created_at).toLocaleDateString('de-DE')}*`,
|
|
7664
|
+
``,
|
|
7665
|
+
);
|
|
7666
|
+
}
|
|
7667
|
+
|
|
7668
|
+
lines.push(
|
|
7669
|
+
`---`,
|
|
7670
|
+
`**Confirm a lesson** (it helped you): \`syndicate_search\` → note the ID → \`syndicate_confirm(id="...")\``,
|
|
7671
|
+
`**Contribute your own:** \`syndicate(topic="fix:...", what_worked="...")\``,
|
|
7672
|
+
);
|
|
7673
|
+
|
|
7674
|
+
return lines.filter(l => l !== '').join('\n');
|
|
7675
|
+
}
|
|
7676
|
+
|
|
7554
7677
|
default:
|
|
7555
7678
|
return null;
|
|
7556
7679
|
}
|