dero-mcp-server 0.4.4 → 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.
Files changed (45) hide show
  1. package/README.md +8 -8
  2. package/SKILL.md +4 -2
  3. package/dist/citations.d.ts.map +1 -1
  4. package/dist/citations.js +48 -0
  5. package/dist/citations.js.map +1 -1
  6. package/dist/composites/_shared.d.ts +27 -2
  7. package/dist/composites/_shared.d.ts.map +1 -1
  8. package/dist/composites/_shared.js +50 -6
  9. package/dist/composites/_shared.js.map +1 -1
  10. package/dist/composites/explain-smart-contract.d.ts +6 -2
  11. package/dist/composites/explain-smart-contract.d.ts.map +1 -1
  12. package/dist/composites/explain-smart-contract.js +26 -2
  13. package/dist/composites/explain-smart-contract.js.map +1 -1
  14. package/dist/composites/recommend-docs-path.d.ts.map +1 -1
  15. package/dist/composites/recommend-docs-path.js +70 -8
  16. package/dist/composites/recommend-docs-path.js.map +1 -1
  17. package/dist/composites/tela-get-doc-content.d.ts +51 -0
  18. package/dist/composites/tela-get-doc-content.d.ts.map +1 -0
  19. package/dist/composites/tela-get-doc-content.js +82 -0
  20. package/dist/composites/tela-get-doc-content.js.map +1 -0
  21. package/dist/composites/tela-inspect.d.ts +27 -0
  22. package/dist/composites/tela-inspect.d.ts.map +1 -0
  23. package/dist/composites/tela-inspect.js +126 -0
  24. package/dist/composites/tela-inspect.js.map +1 -0
  25. package/dist/docs-parse.d.ts +18 -0
  26. package/dist/docs-parse.d.ts.map +1 -1
  27. package/dist/docs-parse.js +74 -0
  28. package/dist/docs-parse.js.map +1 -1
  29. package/dist/docs.d.ts.map +1 -1
  30. package/dist/docs.js +201 -36
  31. package/dist/docs.js.map +1 -1
  32. package/dist/http-server.js +1 -1
  33. package/dist/server.d.ts +2 -0
  34. package/dist/server.d.ts.map +1 -1
  35. package/dist/server.js +79 -18
  36. package/dist/server.js.map +1 -1
  37. package/dist/tela-parse.d.ts +114 -0
  38. package/dist/tela-parse.d.ts.map +1 -0
  39. package/dist/tela-parse.js +242 -0
  40. package/dist/tela-parse.js.map +1 -0
  41. package/dist/tool-descriptions.d.ts +3 -1
  42. package/dist/tool-descriptions.d.ts.map +1 -1
  43. package/dist/tool-descriptions.js +21 -2
  44. package/dist/tool-descriptions.js.map +1 -1
  45. 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,165 @@ function sourceMeta(source) {
63
66
  }
64
67
  return { docs_source: 'filesystem', docs_root: source.root };
65
68
  }
66
- function scorePage(page, terms) {
67
- const title = page.title.toLowerCase();
68
- const slug = page.slug.toLowerCase();
69
- const headingBlob = page.headings.join(' ').toLowerCase();
70
- const body = page.plainText.toLowerCase();
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 terms) {
73
- if (title.includes(term))
74
- score += 6;
75
- if (slug.includes(term))
76
- score += 4;
77
- if (headingBlob.includes(term))
78
- score += 2;
79
- if (body.includes(term))
80
- score += 1;
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
+ }
84
228
  /**
85
229
  * Lightweight docs-index freshness metadata for /health and dero_docs_list,
86
230
  * so an operator can see at a glance whether the live server is serving a
@@ -119,31 +263,52 @@ export async function listDeroDocs(product) {
119
263
  })),
120
264
  };
121
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
+ }
122
282
  export async function searchDeroDocs(args) {
123
283
  const query = args.query.trim();
124
284
  if (!query)
125
285
  throw new Error('DERO docs search requires a non-empty query');
126
286
  const { source, pages } = await loadPages();
127
- let filtered = pages;
128
- if (args.product) {
129
- filtered = filtered.filter((page) => page.product === args.product);
130
- }
131
- if (args.section) {
132
- const normalizedSection = normalizeSlug(args.section).toLowerCase();
133
- filtered = filtered.filter((page) => {
134
- const slug = page.slug.toLowerCase();
135
- return slug === normalizedSection || slug.startsWith(`${normalizedSection}/`);
136
- });
137
- }
138
- const terms = query
139
- .toLowerCase()
140
- .split(/\s+/)
141
- .map((term) => term.trim())
142
- .filter(Boolean);
143
- const scored = filtered
144
- .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) }))
145
302
  .filter((entry) => entry.score > 0)
146
- .sort((a, b) => b.score - a.score);
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
+ });
147
312
  const limit = Math.max(1, Math.min(args.limit ?? 8, 25));
148
313
  const results = scored.slice(0, limit).map(({ page, score }) => ({
149
314
  product: page.product,
@@ -152,8 +317,8 @@ export async function searchDeroDocs(args) {
152
317
  description: page.description,
153
318
  canonical_url: page.canonicalUrl,
154
319
  headings: page.headings.slice(0, 5),
155
- excerpt: page.plainText.slice(0, 420),
156
- score,
320
+ excerpt: buildExcerpt(page.plainText, terms),
321
+ score: Math.round(score * 100) / 100,
157
322
  }));
158
323
  return {
159
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,CAA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OAAO;YACZ,CAAC,CAAC,kCAAkC,MAAM,CAAC,OAAO,SAAS,IAAI,EAAE;YACjE,CAAC,CAAC,+BAA+B,IAAI,EAAE,CAC1C,CAAA;IACH,CAAC;IAED,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,CAAA;IACrC,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC,CAAA;IAC/D,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,kBAAkB,EAAE,KAAK,CAAC,CAAA;IACxD,MAAM,SAAS,GAAG,GAAG,GAAG,KAAK,CAAA;IAE7B,OAAO;QACL,GAAG,UAAU,CAAC,MAAM,CAAC;QACrB,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,aAAa,EAAE,MAAM,CAAC,YAAY;QAClC,YAAY,EAAE,MAAM,CAAC,WAAW;QAChC,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC;QAC5C,cAAc,EAAE,MAAM;QACtB,cAAc,EAAE,KAAK;QACrB,iBAAiB,EAAE,SAAS;QAC5B,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI;QACnC,WAAW,EAAE,MAAM,CAAC,UAAU;KAC/B,CAAA;AACH,CAAC"}
@@ -40,7 +40,7 @@ import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/
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.4';
43
+ const PACKAGE_VERSION = '0.4.5';
44
44
  function readEnv() {
45
45
  const port = Number.parseInt(process.env.DERO_MCP_HTTP_PORT ?? '8787', 10);
46
46
  const host = process.env.DERO_MCP_HTTP_HOST ?? '127.0.0.1';
package/dist/server.d.ts CHANGED
@@ -1,3 +1,5 @@
1
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
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AA2SnE,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,CA82BpE"}
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
- return toolText({
179
- ok: false,
180
- tool,
181
- _meta: {
182
- error: {
183
- ...structured,
184
- raw,
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.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.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 5 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.',
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 DVM docs citations re-ranked for the contract pattern'],
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
- reference_topoheight: z
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
- include_breakdown: z.boolean().optional(),
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.',