dero-mcp-server 0.4.3 → 0.4.5
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 +8 -8
- package/SKILL.md +4 -2
- package/data/docs-index.json +125 -125
- package/dist/citations.d.ts.map +1 -1
- package/dist/citations.js +48 -0
- package/dist/citations.js.map +1 -1
- package/dist/composites/_shared.d.ts +27 -2
- package/dist/composites/_shared.d.ts.map +1 -1
- package/dist/composites/_shared.js +50 -6
- package/dist/composites/_shared.js.map +1 -1
- package/dist/composites/explain-smart-contract.d.ts +6 -2
- package/dist/composites/explain-smart-contract.d.ts.map +1 -1
- package/dist/composites/explain-smart-contract.js +26 -2
- package/dist/composites/explain-smart-contract.js.map +1 -1
- package/dist/composites/recommend-docs-path.d.ts.map +1 -1
- package/dist/composites/recommend-docs-path.js +70 -8
- package/dist/composites/recommend-docs-path.js.map +1 -1
- package/dist/composites/tela-get-doc-content.d.ts +51 -0
- package/dist/composites/tela-get-doc-content.d.ts.map +1 -0
- package/dist/composites/tela-get-doc-content.js +82 -0
- package/dist/composites/tela-get-doc-content.js.map +1 -0
- package/dist/composites/tela-inspect.d.ts +27 -0
- package/dist/composites/tela-inspect.d.ts.map +1 -0
- package/dist/composites/tela-inspect.js +126 -0
- package/dist/composites/tela-inspect.js.map +1 -0
- package/dist/docs-parse.d.ts +18 -0
- package/dist/docs-parse.d.ts.map +1 -1
- package/dist/docs-parse.js +79 -1
- package/dist/docs-parse.js.map +1 -1
- package/dist/docs.d.ts +10 -0
- package/dist/docs.d.ts.map +1 -1
- package/dist/docs.js +223 -36
- package/dist/docs.js.map +1 -1
- package/dist/http-server.d.ts.map +1 -1
- package/dist/http-server.js +5 -1
- package/dist/http-server.js.map +1 -1
- package/dist/server.d.ts +2 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +79 -18
- package/dist/server.js.map +1 -1
- package/dist/tela-parse.d.ts +114 -0
- package/dist/tela-parse.d.ts.map +1 -0
- package/dist/tela-parse.js +242 -0
- package/dist/tela-parse.js.map +1 -0
- package/dist/tool-descriptions.d.ts +3 -1
- package/dist/tool-descriptions.d.ts.map +1 -1
- package/dist/tool-descriptions.js +21 -2
- package/dist/tool-descriptions.js.map +1 -1
- package/package.json +6 -3
package/dist/docs.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { promises as fs } from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import { DERO_DOC_PRODUCTS, indexDocsFromRoot, normalizeSlug, pathExists, } from './docs-parse.js';
|
|
4
|
+
import { DERO_DOC_PRODUCTS, indexDocsFromRoot, normalizeSlug, pathExists, tokenizeForSearch, } from './docs-parse.js';
|
|
5
5
|
export { DERO_DOC_PRODUCTS, resolveDeroDocsRoot } from './docs-parse.js';
|
|
6
6
|
const CACHE_TTL_MS = 15000;
|
|
7
7
|
let pageCache = null;
|
|
8
|
+
// Search model is keyed to the same cache window as the pages; rebuilt lazily
|
|
9
|
+
// on first search after a (re)load so non-search callers don't pay for it.
|
|
10
|
+
let searchModelCache = null;
|
|
8
11
|
function bundledIndexPath() {
|
|
9
12
|
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
10
13
|
// dist/docs.js -> ../data/docs-index.json
|
|
@@ -63,24 +66,187 @@ function sourceMeta(source) {
|
|
|
63
66
|
}
|
|
64
67
|
return { docs_source: 'filesystem', docs_root: source.root };
|
|
65
68
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
// ---------------- BM25F search model ----------------
|
|
70
|
+
//
|
|
71
|
+
// Field-weighted BM25 over the shared tokenizer (tokenizeForSearch). Replaces
|
|
72
|
+
// the old binary-substring scorePage. The model (per-page field token maps,
|
|
73
|
+
// per-field average lengths, corpus document frequencies) is derived in-process
|
|
74
|
+
// from the existing index fields — NO index-format change — and cached
|
|
75
|
+
// alongside the pages so the ~80ms build cost is paid once per cache window.
|
|
76
|
+
//
|
|
77
|
+
// Parameters are tuned by empirical sweep against the bundled 147-page corpus
|
|
78
|
+
// and the 6 confirmed failure cases, then frozen. They are CI-guarded by
|
|
79
|
+
// scripts/check-docs-ranking.ts — do NOT tune any constant here without
|
|
80
|
+
// re-running `npm run check:docs-ranking`.
|
|
81
|
+
const SEARCH_FIELDS = ['title', 'slug', 'headings', 'description', 'body'];
|
|
82
|
+
// Field boosts: title/slug/headings/description are short, high-signal;
|
|
83
|
+
// description was previously unscored dead weight and is now a first-class field.
|
|
84
|
+
const FIELD_BOOST = {
|
|
85
|
+
title: 10,
|
|
86
|
+
slug: 5,
|
|
87
|
+
headings: 4,
|
|
88
|
+
description: 3,
|
|
89
|
+
body: 1,
|
|
90
|
+
};
|
|
91
|
+
// Per-field length-normalization strength. b_body=0.7 crushes the 75k-char
|
|
92
|
+
// Captain archive's substring advantage; short fields barely vary so they get
|
|
93
|
+
// light normalization (heavy norm there only adds noise).
|
|
94
|
+
const FIELD_B = {
|
|
95
|
+
title: 0.2,
|
|
96
|
+
slug: 0.2,
|
|
97
|
+
headings: 0.2,
|
|
98
|
+
description: 0.2,
|
|
99
|
+
body: 0.7,
|
|
100
|
+
};
|
|
101
|
+
const BM25_K1 = 1.2;
|
|
102
|
+
// IDF gate + weights for the field-presence floor (restores the must-not-
|
|
103
|
+
// regress query: rewards an on-topic title/heading match for a discriminating
|
|
104
|
+
// term, which pure tf-saturation under-weights). Only fires for terms rarer
|
|
105
|
+
// than the gate, so corpus-ubiquitous terms like `dero` add no floor.
|
|
106
|
+
const PRESENCE_IDF_GATE = 0.25;
|
|
107
|
+
const PRESENCE_WEIGHT = {
|
|
108
|
+
title: 3.0,
|
|
109
|
+
headings: 1.5,
|
|
110
|
+
slug: 1.8,
|
|
111
|
+
};
|
|
112
|
+
function tokenizeField(field, page) {
|
|
113
|
+
switch (field) {
|
|
114
|
+
case 'title':
|
|
115
|
+
return tokenizeForSearch(page.title);
|
|
116
|
+
case 'slug':
|
|
117
|
+
return tokenizeForSearch(page.slug.replace(/\//g, ' '));
|
|
118
|
+
case 'headings':
|
|
119
|
+
return tokenizeForSearch(page.headings.join(' '));
|
|
120
|
+
case 'description':
|
|
121
|
+
return tokenizeForSearch(page.description ?? '');
|
|
122
|
+
case 'body':
|
|
123
|
+
return tokenizeForSearch(page.plainText);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function buildSearchModel(pages) {
|
|
127
|
+
const n = pages.length;
|
|
128
|
+
const totalLen = { title: 0, slug: 0, headings: 0, description: 0, body: 0 };
|
|
129
|
+
const df = new Map();
|
|
130
|
+
const pageModels = [];
|
|
131
|
+
for (const page of pages) {
|
|
132
|
+
const fields = {};
|
|
133
|
+
const len = {};
|
|
134
|
+
const pageTerms = new Set();
|
|
135
|
+
for (const field of SEARCH_FIELDS) {
|
|
136
|
+
const toks = tokenizeField(field, page);
|
|
137
|
+
const tf = new Map();
|
|
138
|
+
for (const t of toks) {
|
|
139
|
+
tf.set(t, (tf.get(t) ?? 0) + 1);
|
|
140
|
+
pageTerms.add(t);
|
|
141
|
+
}
|
|
142
|
+
fields[field] = tf;
|
|
143
|
+
len[field] = toks.length;
|
|
144
|
+
totalLen[field] += toks.length;
|
|
145
|
+
}
|
|
146
|
+
for (const t of pageTerms)
|
|
147
|
+
df.set(t, (df.get(t) ?? 0) + 1);
|
|
148
|
+
pageModels.push({ page, fields, len });
|
|
149
|
+
}
|
|
150
|
+
const avgLen = {};
|
|
151
|
+
for (const field of SEARCH_FIELDS)
|
|
152
|
+
avgLen[field] = n > 0 ? totalLen[field] / n : 0;
|
|
153
|
+
const idf = new Map();
|
|
154
|
+
for (const [term, dfreq] of df) {
|
|
155
|
+
// BM25 probabilistic IDF, uncapped (capping regressed the rare
|
|
156
|
+
// discriminator `monero` in the "dero vs monero" case).
|
|
157
|
+
idf.set(term, Math.log(1 + (n - dfreq + 0.5) / (dfreq + 0.5)));
|
|
158
|
+
}
|
|
159
|
+
return { pages: pageModels, avgLen, idf, n };
|
|
160
|
+
}
|
|
161
|
+
function scorePageModel(pm, queryTerms, model) {
|
|
71
162
|
let score = 0;
|
|
72
|
-
for (const term of
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
163
|
+
for (const term of queryTerms) {
|
|
164
|
+
const idf = model.idf.get(term);
|
|
165
|
+
if (idf === undefined || idf <= 0)
|
|
166
|
+
continue;
|
|
167
|
+
// Accumulate weighted, per-field length-normalized term frequency.
|
|
168
|
+
let acc = 0;
|
|
169
|
+
for (const field of SEARCH_FIELDS) {
|
|
170
|
+
const tf = pm.fields[field].get(term);
|
|
171
|
+
if (!tf)
|
|
172
|
+
continue;
|
|
173
|
+
const b = FIELD_B[field];
|
|
174
|
+
const avg = model.avgLen[field] || 1;
|
|
175
|
+
const norm = 1 - b + b * (pm.len[field] / avg);
|
|
176
|
+
acc += (FIELD_BOOST[field] * tf) / norm;
|
|
177
|
+
}
|
|
178
|
+
if (acc <= 0)
|
|
179
|
+
continue;
|
|
180
|
+
// BM25 saturation on the accumulated field tf.
|
|
181
|
+
score += idf * ((acc * (BM25_K1 + 1)) / (acc + BM25_K1));
|
|
182
|
+
// IDF-gated field-presence floor for discriminating terms.
|
|
183
|
+
if (idf > PRESENCE_IDF_GATE) {
|
|
184
|
+
let bonus = 0;
|
|
185
|
+
for (const field of SEARCH_FIELDS) {
|
|
186
|
+
const w = PRESENCE_WEIGHT[field];
|
|
187
|
+
if (w && pm.fields[field].has(term))
|
|
188
|
+
bonus += w;
|
|
189
|
+
}
|
|
190
|
+
if (bonus > 0)
|
|
191
|
+
score += bonus * Math.sqrt(idf);
|
|
192
|
+
}
|
|
81
193
|
}
|
|
82
194
|
return score;
|
|
83
195
|
}
|
|
196
|
+
/**
|
|
197
|
+
* Tokenize a raw query into deduped search terms. Falls back to a
|
|
198
|
+
* stopword-keeping tokenization when the query is all stopwords (e.g.
|
|
199
|
+
* "how to") so the call stays deterministic and non-empty.
|
|
200
|
+
*/
|
|
201
|
+
function queryTerms(query) {
|
|
202
|
+
let terms = tokenizeForSearch(query);
|
|
203
|
+
if (terms.length === 0)
|
|
204
|
+
terms = tokenizeForSearch(query, true);
|
|
205
|
+
return [...new Set(terms)];
|
|
206
|
+
}
|
|
207
|
+
// Pull a query-centered excerpt: a window around the first matching token, so
|
|
208
|
+
// the snippet shows why the page matched instead of always the page head.
|
|
209
|
+
function buildExcerpt(plainText, terms) {
|
|
210
|
+
const WINDOW = 420;
|
|
211
|
+
if (!plainText)
|
|
212
|
+
return '';
|
|
213
|
+
const lower = plainText.toLowerCase();
|
|
214
|
+
let hit = -1;
|
|
215
|
+
for (const t of terms) {
|
|
216
|
+
const i = lower.indexOf(t);
|
|
217
|
+
if (i >= 0 && (hit < 0 || i < hit))
|
|
218
|
+
hit = i;
|
|
219
|
+
}
|
|
220
|
+
if (hit < 0)
|
|
221
|
+
return plainText.slice(0, WINDOW);
|
|
222
|
+
const start = Math.max(0, hit - 120);
|
|
223
|
+
const end = Math.min(plainText.length, start + WINDOW);
|
|
224
|
+
const prefix = start > 0 ? '…' : '';
|
|
225
|
+
const suffix = end < plainText.length ? '…' : '';
|
|
226
|
+
return prefix + plainText.slice(start, end) + suffix;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Lightweight docs-index freshness metadata for /health and dero_docs_list,
|
|
230
|
+
* so an operator can see at a glance whether the live server is serving a
|
|
231
|
+
* current bundle. Reads the bundled index header only; returns nulls when
|
|
232
|
+
* docs come from a filesystem override or the index is unreadable.
|
|
233
|
+
*/
|
|
234
|
+
export async function docsIndexMeta() {
|
|
235
|
+
try {
|
|
236
|
+
const source = await resolveDocsSource();
|
|
237
|
+
if (source?.kind !== 'bundled')
|
|
238
|
+
return { docs_generated_at: null, docs_page_count: null };
|
|
239
|
+
const raw = await fs.readFile(source.indexPath, 'utf8');
|
|
240
|
+
const parsed = JSON.parse(raw);
|
|
241
|
+
return {
|
|
242
|
+
docs_generated_at: parsed.generated_at ?? null,
|
|
243
|
+
docs_page_count: parsed.page_count ?? parsed.pages?.length ?? null,
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
catch {
|
|
247
|
+
return { docs_generated_at: null, docs_page_count: null };
|
|
248
|
+
}
|
|
249
|
+
}
|
|
84
250
|
export async function listDeroDocs(product) {
|
|
85
251
|
const { source, pages } = await loadPages();
|
|
86
252
|
const filtered = product ? pages.filter((page) => page.product === product) : pages;
|
|
@@ -97,31 +263,52 @@ export async function listDeroDocs(product) {
|
|
|
97
263
|
})),
|
|
98
264
|
};
|
|
99
265
|
}
|
|
266
|
+
/**
|
|
267
|
+
* Build-or-return the BM25F model for the currently-cached page set. Keyed to
|
|
268
|
+
* the page cache's load timestamp so it rebuilds exactly when the pages do
|
|
269
|
+
* (same 15s TTL window). IDF needs the FULL corpus, so the model always spans
|
|
270
|
+
* every page; product/section filtering happens at score time.
|
|
271
|
+
*/
|
|
272
|
+
function getSearchModel(pages) {
|
|
273
|
+
const key = pageCache?.key ?? 'unkeyed';
|
|
274
|
+
const loadedAt = pageCache?.loadedAt ?? 0;
|
|
275
|
+
if (searchModelCache && searchModelCache.key === key && searchModelCache.loadedAt === loadedAt) {
|
|
276
|
+
return searchModelCache.model;
|
|
277
|
+
}
|
|
278
|
+
const model = buildSearchModel(pages);
|
|
279
|
+
searchModelCache = { key, loadedAt, model };
|
|
280
|
+
return model;
|
|
281
|
+
}
|
|
100
282
|
export async function searchDeroDocs(args) {
|
|
101
283
|
const query = args.query.trim();
|
|
102
284
|
if (!query)
|
|
103
285
|
throw new Error('DERO docs search requires a non-empty query');
|
|
104
286
|
const { source, pages } = await loadPages();
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
.map((
|
|
120
|
-
.filter(Boolean);
|
|
121
|
-
const scored = filtered
|
|
122
|
-
.map((page) => ({ page, score: scorePage(page, terms) }))
|
|
287
|
+
const model = getSearchModel(pages);
|
|
288
|
+
const terms = queryTerms(query);
|
|
289
|
+
const normalizedSection = args.section ? normalizeSlug(args.section).toLowerCase() : null;
|
|
290
|
+
const scored = model.pages
|
|
291
|
+
.filter((pm) => {
|
|
292
|
+
if (args.product && pm.page.product !== args.product)
|
|
293
|
+
return false;
|
|
294
|
+
if (normalizedSection) {
|
|
295
|
+
const slug = pm.page.slug.toLowerCase();
|
|
296
|
+
if (slug !== normalizedSection && !slug.startsWith(`${normalizedSection}/`))
|
|
297
|
+
return false;
|
|
298
|
+
}
|
|
299
|
+
return true;
|
|
300
|
+
})
|
|
301
|
+
.map((pm) => ({ page: pm.page, score: scorePageModel(pm, terms, model) }))
|
|
123
302
|
.filter((entry) => entry.score > 0)
|
|
124
|
-
|
|
303
|
+
// Tie-break lexicographically on product/slug for deterministic, CI-stable
|
|
304
|
+
// ordering when scores are equal.
|
|
305
|
+
.sort((a, b) => {
|
|
306
|
+
if (b.score !== a.score)
|
|
307
|
+
return b.score - a.score;
|
|
308
|
+
const ak = `${a.page.product}/${a.page.slug}`;
|
|
309
|
+
const bk = `${b.page.product}/${b.page.slug}`;
|
|
310
|
+
return ak < bk ? -1 : ak > bk ? 1 : 0;
|
|
311
|
+
});
|
|
125
312
|
const limit = Math.max(1, Math.min(args.limit ?? 8, 25));
|
|
126
313
|
const results = scored.slice(0, limit).map(({ page, score }) => ({
|
|
127
314
|
product: page.product,
|
|
@@ -130,8 +317,8 @@ export async function searchDeroDocs(args) {
|
|
|
130
317
|
description: page.description,
|
|
131
318
|
canonical_url: page.canonicalUrl,
|
|
132
319
|
headings: page.headings.slice(0, 5),
|
|
133
|
-
excerpt: page.plainText
|
|
134
|
-
score,
|
|
320
|
+
excerpt: buildExcerpt(page.plainText, terms),
|
|
321
|
+
score: Math.round(score * 100) / 100,
|
|
135
322
|
}));
|
|
136
323
|
return {
|
|
137
324
|
...sourceMeta(source),
|
package/dist/docs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.js","sourceRoot":"","sources":["../src/docs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EACL,iBAAiB,EAIjB,iBAAiB,EACjB,aAAa,EACb,UAAU,GAEX,MAAM,iBAAiB,CAAA;AAExB,OAAO,EAAE,iBAAiB,EAAuB,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAE7F,MAAM,YAAY,GAAG,KAAK,CAAA;AAW1B,IAAI,SAAS,GAA+D,IAAI,CAAA;AAEhF,SAAS,gBAAgB;IACvB,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;IACzD,0CAA0C;IAC1C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,yBAAyB,CAAC,CAAA;AACtD,CAAC;AAED,KAAK,UAAU,gBAAgB,CAAC,SAAiB;IAC/C,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC;QAAE,OAAO,IAAI,CAAA;IAC/C,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA;IAChD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAkB,CAAA;IAC/C,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM;QAAE,OAAO,IAAI,CAAA;IACvC,OAAO,MAAM,CAAC,KAAK,CAAA;AACrB,CAAC;AAED,KAAK,UAAU,iBAAiB;IAC9B,MAAM,YAA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AS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI;QACnC,WAAW,EAAE,MAAM,CAAC,UAAU;KAC/B,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-server.d.ts","sourceRoot":"","sources":["../src/http-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;
|
|
1
|
+
{"version":3,"file":"http-server.d.ts","sourceRoot":"","sources":["../src/http-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAuCH,wBAAsB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAuFrD"}
|
package/dist/http-server.js
CHANGED
|
@@ -39,7 +39,8 @@ import { timingSafeEqual } from 'node:crypto';
|
|
|
39
39
|
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
40
40
|
import { createDeroMcpServer } from './server.js';
|
|
41
41
|
import { resolveDaemonBase, describeDaemonResolution } from './daemon-base.js';
|
|
42
|
-
|
|
42
|
+
import { docsIndexMeta } from './docs.js';
|
|
43
|
+
const PACKAGE_VERSION = '0.4.5';
|
|
43
44
|
function readEnv() {
|
|
44
45
|
const port = Number.parseInt(process.env.DERO_MCP_HTTP_PORT ?? '8787', 10);
|
|
45
46
|
const host = process.env.DERO_MCP_HTTP_HOST ?? '127.0.0.1';
|
|
@@ -74,6 +75,7 @@ export async function startHttpServer() {
|
|
|
74
75
|
const httpServer = http.createServer(async (req, res) => {
|
|
75
76
|
const url = new URL(req.url ?? '/', `http://${req.headers.host ?? 'localhost'}`);
|
|
76
77
|
if (url.pathname === '/health' && req.method === 'GET') {
|
|
78
|
+
const docsMeta = await docsIndexMeta();
|
|
77
79
|
send(res, 200, JSON.stringify({
|
|
78
80
|
status: 'ok',
|
|
79
81
|
name: 'dero-daemon-mcp',
|
|
@@ -81,6 +83,8 @@ export async function startHttpServer() {
|
|
|
81
83
|
transport: 'streamable-http',
|
|
82
84
|
daemon_url: daemonUrl,
|
|
83
85
|
daemon_source: resolution.source,
|
|
86
|
+
docs_generated_at: docsMeta.docs_generated_at,
|
|
87
|
+
docs_page_count: docsMeta.docs_page_count,
|
|
84
88
|
}));
|
|
85
89
|
return;
|
|
86
90
|
}
|
package/dist/http-server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-server.js","sourceRoot":"","sources":["../src/http-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAA;AAClG,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"http-server.js","sourceRoot":"","sources":["../src/http-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAA;AAClG,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAEzC,MAAM,eAAe,GAAG,OAAO,CAAA;AAE/B,SAAS,OAA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1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
export declare const DERO_RESOURCE_URIS: readonly ["dero://mcp/server-info", "dero://mcp/safety-boundary", "dero://mcp/example-flows", "dero://mcp/composites"];
|
|
3
|
+
export declare const DERO_PROMPT_NAMES: readonly ["network_health_check", "inspect_smart_contract", "trace_transaction", "find_dero_docs_for_intent", "estimate_deploy_for_contract"];
|
|
2
4
|
export declare function createDeroMcpServer(daemonBaseUrl: string): McpServer;
|
|
3
5
|
//# sourceMappingURL=server.d.ts.map
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AA+DnE,eAAO,MAAM,kBAAkB,wHAKrB,CAAA;AAEV,eAAO,MAAM,iBAAiB,+IAMpB,CAAA;AA4OV,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,CA26BpE"}
|
package/dist/server.js
CHANGED
|
@@ -12,6 +12,9 @@ import { explainSmartContract, explainSmartContractInputSchema, } from './compos
|
|
|
12
12
|
import { recommendDocsPath, recommendDocsPathInputSchema, } from './composites/recommend-docs-path.js';
|
|
13
13
|
import { estimateDeployCost, estimateDeployCostInputSchema, } from './composites/estimate-deploy-cost.js';
|
|
14
14
|
import { traceTransactionWithContext, traceTransactionWithContextInputSchema, } from './composites/trace-transaction-with-context.js';
|
|
15
|
+
import { capRawScVariables } from './composites/_shared.js';
|
|
16
|
+
import { telaInspect, telaInspectInputSchema } from './composites/tela-inspect.js';
|
|
17
|
+
import { telaGetDocContent, telaGetDocContentInputSchema, } from './composites/tela-get-doc-content.js';
|
|
15
18
|
const scRpcArgSchema = z.object({
|
|
16
19
|
name: z.string(),
|
|
17
20
|
datatype: z.enum(['S', 'U', 'H']),
|
|
@@ -24,13 +27,13 @@ const deroAddressSchema = z
|
|
|
24
27
|
.string()
|
|
25
28
|
.regex(/^(dero1|deto1)[0-9a-z]+$/i, 'Expected DERO address starting with dero1 or deto1');
|
|
26
29
|
const NAME_REGISTRY_SCID = '0000000000000000000000000000000000000000000000000000000000000001';
|
|
27
|
-
const DERO_RESOURCE_URIS = [
|
|
30
|
+
export const DERO_RESOURCE_URIS = [
|
|
28
31
|
'dero://mcp/server-info',
|
|
29
32
|
'dero://mcp/safety-boundary',
|
|
30
33
|
'dero://mcp/example-flows',
|
|
31
34
|
'dero://mcp/composites',
|
|
32
35
|
];
|
|
33
|
-
const DERO_PROMPT_NAMES = [
|
|
36
|
+
export const DERO_PROMPT_NAMES = [
|
|
34
37
|
'network_health_check',
|
|
35
38
|
'inspect_smart_contract',
|
|
36
39
|
'trace_transaction',
|
|
@@ -175,16 +178,23 @@ function classifyToolError(error) {
|
|
|
175
178
|
function toolError(tool, error) {
|
|
176
179
|
const structured = classifyToolError(error);
|
|
177
180
|
const raw = error instanceof Error ? error.message : String(error);
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
181
|
+
// `isError: true` flags the failure at the protocol level so MCP hosts and
|
|
182
|
+
// agent frameworks that branch on the flag (before parsing content) see the
|
|
183
|
+
// call as failed. The ok:false/_meta.error JSON body is unchanged and
|
|
184
|
+
// remains the source of the structured error code/hint.
|
|
185
|
+
return {
|
|
186
|
+
...toolText({
|
|
187
|
+
ok: false,
|
|
188
|
+
tool,
|
|
189
|
+
_meta: {
|
|
190
|
+
error: {
|
|
191
|
+
...structured,
|
|
192
|
+
raw,
|
|
193
|
+
},
|
|
185
194
|
},
|
|
186
|
-
},
|
|
187
|
-
|
|
195
|
+
}),
|
|
196
|
+
isError: true,
|
|
197
|
+
};
|
|
188
198
|
}
|
|
189
199
|
function withStructuredErrors(tool, handler) {
|
|
190
200
|
return async (args) => {
|
|
@@ -230,7 +240,7 @@ export function createDeroMcpServer(daemonBaseUrl) {
|
|
|
230
240
|
const rpc = async (method, params) => deroJsonRpc(endpoint, method, params);
|
|
231
241
|
const server = new McpServer({
|
|
232
242
|
name: 'dero-daemon-mcp',
|
|
233
|
-
version: '0.4.
|
|
243
|
+
version: '0.4.5',
|
|
234
244
|
});
|
|
235
245
|
server.registerTool('dero_daemon_ping', readOnly({
|
|
236
246
|
description: TOOL_DESCRIPTIONS.dero_daemon_ping,
|
|
@@ -382,6 +392,11 @@ export function createDeroMcpServer(daemonBaseUrl) {
|
|
|
382
392
|
if (topoheight !== undefined)
|
|
383
393
|
params.topoheight = topoheight;
|
|
384
394
|
const result = (await rpc('DERO.GetSC', params)) ?? {};
|
|
395
|
+
// Large registries (e.g. the name service's 22k+ stringkeys) would
|
|
396
|
+
// overflow host token limits if returned verbatim; cap the raw maps and
|
|
397
|
+
// mark what was elided. See capRawScVariables / SURFACE_KEY_CAP.
|
|
398
|
+
capRawScVariables(result, 'stringkeys');
|
|
399
|
+
capRawScVariables(result, 'uint64keys');
|
|
385
400
|
const related_docs = relatedDocsFor('dero_get_sc');
|
|
386
401
|
return { ...result, ...(related_docs ? { related_docs } : {}) };
|
|
387
402
|
}));
|
|
@@ -560,6 +575,14 @@ export function createDeroMcpServer(daemonBaseUrl) {
|
|
|
560
575
|
description: TOOL_DESCRIPTIONS.explain_smart_contract,
|
|
561
576
|
inputSchema: explainSmartContractInputSchema,
|
|
562
577
|
}), withStructuredErrors('explain_smart_contract', async (args) => explainSmartContract(rpc, args)));
|
|
578
|
+
server.registerTool('tela_inspect', readOnly({
|
|
579
|
+
description: TOOL_DESCRIPTIONS.tela_inspect,
|
|
580
|
+
inputSchema: telaInspectInputSchema,
|
|
581
|
+
}), withStructuredErrors('tela_inspect', async (args) => telaInspect(rpc, args)));
|
|
582
|
+
server.registerTool('tela_get_doc_content', readOnly({
|
|
583
|
+
description: TOOL_DESCRIPTIONS.tela_get_doc_content,
|
|
584
|
+
inputSchema: telaGetDocContentInputSchema,
|
|
585
|
+
}), withStructuredErrors('tela_get_doc_content', async (args) => telaGetDocContent(rpc, args)));
|
|
563
586
|
server.registerTool('recommend_docs_path', readOnly({
|
|
564
587
|
description: TOOL_DESCRIPTIONS.recommend_docs_path,
|
|
565
588
|
inputSchema: recommendDocsPathInputSchema,
|
|
@@ -590,7 +613,7 @@ export function createDeroMcpServer(daemonBaseUrl) {
|
|
|
590
613
|
mimeType: 'application/json',
|
|
591
614
|
text: JSON.stringify({
|
|
592
615
|
name: 'dero-daemon-mcp',
|
|
593
|
-
version: '0.4.
|
|
616
|
+
version: '0.4.5',
|
|
594
617
|
mode: 'read-only',
|
|
595
618
|
endpoint: endpoint,
|
|
596
619
|
docs_products: DERO_DOC_PRODUCTS,
|
|
@@ -671,7 +694,7 @@ export function createDeroMcpServer(daemonBaseUrl) {
|
|
|
671
694
|
],
|
|
672
695
|
}));
|
|
673
696
|
server.registerResource('dero_mcp_composites', 'dero://mcp/composites', {
|
|
674
|
-
description: 'Catalog of the
|
|
697
|
+
description: 'Catalog of the 9 composite tools — what each replaces, when to call it, what it returns, and which structured _meta.error codes it can emit. Read this when picking between a composite and a primitive.',
|
|
675
698
|
mimeType: 'application/json',
|
|
676
699
|
}, async (uri) => ({
|
|
677
700
|
contents: [
|
|
@@ -695,7 +718,7 @@ export function createDeroMcpServer(daemonBaseUrl) {
|
|
|
695
718
|
replaces: ['dero_get_sc + manual parsing + dero_docs_search'],
|
|
696
719
|
when_to_call: 'User wants to UNDERSTAND a contract (functions, state shape, what DVM concept to read about). NOT for raw variable inspection — use dero_get_sc for that.',
|
|
697
720
|
inputs: { scid: '64-char hex SCID', topoheight: 'optional number' },
|
|
698
|
-
output_highlights: ['kind (token | registry | minimal | generic)', 'surface (functions, stringkeys, uint64keys, balances)', 'narrative', '1-4 curated
|
|
721
|
+
output_highlights: ['kind (tela_index | tela_doc | token | registry | minimal | generic)', 'surface (functions, stringkeys, uint64keys, balances)', 'narrative', '1-4 curated docs citations re-ranked for the contract pattern (TELA contracts cite the TELA spec)'],
|
|
699
722
|
error_codes: ['RPC_UNREACHABLE', 'RPC_INVALID_PARAMS'],
|
|
700
723
|
},
|
|
701
724
|
{
|
|
@@ -723,6 +746,39 @@ export function createDeroMcpServer(daemonBaseUrl) {
|
|
|
723
746
|
scope_note: 'SC invocation arg decoding is NOT performed (would require the binary tx codec). SC INSTALL surface extraction IS performed inline because the source is embedded in the tx record.',
|
|
724
747
|
error_codes: ['TX_NOT_FOUND (retryable=true; daemon returns empty record on unknown hashes)', 'RPC_UNREACHABLE'],
|
|
725
748
|
},
|
|
749
|
+
{
|
|
750
|
+
name: 'audit_chain_artifact_claim',
|
|
751
|
+
replaces: ['dero_get_info / dero_get_last_block_header / dero_decode_proof_string + manual claim verification'],
|
|
752
|
+
when_to_call: 'User asks to verify a chain-related claim end-to-end (e.g. the 2022 inflation claim) with cited daemon state and docs.',
|
|
753
|
+
inputs: { claim: 'claim text', include_forge_demo: 'optional boolean' },
|
|
754
|
+
output_highlights: ['verdict', 'cited daemon state', 'optional forged demo proof', 'related_docs'],
|
|
755
|
+
error_codes: ['INVALID_INPUT', 'RPC_UNREACHABLE'],
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
name: 'dero_forge_demo_proof',
|
|
759
|
+
replaces: ['manual bn254 + CBOR + bech32 proof-string construction'],
|
|
760
|
+
when_to_call: 'Generate a demo (display-layer) deroproof string for testing/teaching; never broadcasts or touches a wallet.',
|
|
761
|
+
inputs: { target_amount: 'optional', tx_hex: 'optional (max 100k)' },
|
|
762
|
+
output_highlights: ['forged_proof_string', 'self_check (verified)', 'context_note', 'related_docs'],
|
|
763
|
+
error_codes: ['INVALID_INPUT'],
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
name: 'tela_inspect',
|
|
767
|
+
replaces: ['dero_get_sc + manual TELA-INDEX-1/DOC-1 schema parsing'],
|
|
768
|
+
when_to_call: 'User references a TELA SCID or .tela app: "what is this TELA contract/app", "what files does it have", "is it an INDEX or DOC". Auto-detects the standard; reads RAW stringkeys so all DOCn enumerate (bypasses the 50-key surface cap).',
|
|
769
|
+
inputs: { scid: '64-char hex SCID', topoheight: 'optional number' },
|
|
770
|
+
output_highlights: ['kind (tela_index | tela_doc | not_tela)', 'index { name, durl, mods[], docs[], commit, version_history[] } | doc { filename, doc_type, signature, content_embedded }', 'narrative', 'related_docs'],
|
|
771
|
+
scope_note: 'Updateability/ringsize is NOT in DERO.GetSC, so it is honestly reported as unknown. not_tela is a SUCCESS (not an error) for non-TELA SCIDs.',
|
|
772
|
+
error_codes: ['RPC_UNREACHABLE', 'RPC_INVALID_PARAMS'],
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
name: 'tela_get_doc_content',
|
|
776
|
+
replaces: ['dero_get_sc + manual comment-block extraction from the contract code'],
|
|
777
|
+
when_to_call: 'User wants the actual file content (HTML/CSS/JS) a TELA-DOC-1 stores. Get DOC SCIDs from tela_inspect on an INDEX first.',
|
|
778
|
+
inputs: { scid: '64-char hex DOC SCID', offset: 'optional number (paginate large files)', topoheight: 'optional number' },
|
|
779
|
+
output_highlights: ['content (60k-char chunk; paginate via next_offset)', 'filename, doc_type, sub_dir', 'compressed (.gz flag)', 'signature (presence only, not verified)', 'related_docs'],
|
|
780
|
+
error_codes: ['INVALID_INPUT (SCID is not a TELA-DOC-1; hint points to tela_inspect)', 'RPC_UNREACHABLE'],
|
|
781
|
+
},
|
|
726
782
|
],
|
|
727
783
|
}, null, 2),
|
|
728
784
|
},
|
|
@@ -731,7 +787,10 @@ export function createDeroMcpServer(daemonBaseUrl) {
|
|
|
731
787
|
server.registerPrompt('network_health_check', {
|
|
732
788
|
description: 'Guide the model through a DERO daemon sync and health check using the diagnose_chain_health composite.',
|
|
733
789
|
argsSchema: {
|
|
734
|
-
|
|
790
|
+
// MCP prompt arguments arrive as strings (the SDK validates raw
|
|
791
|
+
// string values against this schema with no coercion), so a plain
|
|
792
|
+
// z.number() can never validate. Coerce the string to a number here.
|
|
793
|
+
reference_topoheight: z.coerce
|
|
735
794
|
.number()
|
|
736
795
|
.int()
|
|
737
796
|
.positive()
|
|
@@ -845,7 +904,9 @@ export function createDeroMcpServer(daemonBaseUrl) {
|
|
|
845
904
|
description: 'Run gas pre-flight for a DVM-BASIC contract source via the estimate_deploy_cost composite (numeric estimate + plain-text breakdown + parsed surface).',
|
|
846
905
|
argsSchema: {
|
|
847
906
|
sc_source: z.string().min(20, 'Provide DVM-BASIC contract source (at minimum: a Function/End Function block)'),
|
|
848
|
-
|
|
907
|
+
// Prompt arguments are always strings, so a z.boolean() can never
|
|
908
|
+
// validate. Accept the string 'true' | 'false' and interpret below.
|
|
909
|
+
include_breakdown: z.enum(['true', 'false']).optional(),
|
|
849
910
|
},
|
|
850
911
|
}, async ({ sc_source, include_breakdown }) => ({
|
|
851
912
|
description: 'Prompt for DVM deploy pre-flight (composite-first).',
|
|
@@ -857,7 +918,7 @@ export function createDeroMcpServer(daemonBaseUrl) {
|
|
|
857
918
|
text: [
|
|
858
919
|
'Run a deploy pre-flight (gas estimate) for the DVM-BASIC source the user supplied. This is read-only; nothing is submitted to chain.',
|
|
859
920
|
'',
|
|
860
|
-
`1) Call estimate_deploy_cost with the contract source as sc${include_breakdown === false ? ' and include_breakdown=false (caller does NOT want the plain-text gas notes)' : ' (include_breakdown defaults to true)'}.`,
|
|
921
|
+
`1) Call estimate_deploy_cost with the contract source as sc${include_breakdown === 'false' ? ' and include_breakdown=false (caller does NOT want the plain-text gas notes)' : ' (include_breakdown defaults to true)'}.`,
|
|
861
922
|
'2) Quote estimate.gascompute, estimate.gasstorage, estimate.total, and the daemon\'s status string.',
|
|
862
923
|
'3) If include_breakdown is true, read the breakdown.compute_note and breakdown.storage_note as plain-language explanations.',
|
|
863
924
|
'4) Quote the parsed function surface (functions[].name) so the user can sanity-check the contract.',
|