@uniquedomains/mcp-server 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -103,7 +103,7 @@ The hosted connector serves the free tools only and takes no key. Three free too
103
103
 
104
104
  <!-- tools:start (generated by scripts/generate.mjs) -->
105
105
 
106
- 57 tools answer without a key (54 on the hosted connector); a member key adds 25 more, the Investor ones for an Investor key only.
106
+ 56 tools answer without a key (53 on the hosted connector); a member key adds 25 more, the Investor ones for an Investor key only.
107
107
 
108
108
  | Tool | What it reads | Needs |
109
109
  |---|---|---|
@@ -142,9 +142,8 @@ The hosted connector serves the free tools only and takes no key. Three free too
142
142
  | `ud_list_domain_changes` | Catalog's change feed, newest first | Investor key |
143
143
  | `ud_get_catalog_stats` | Catalog headline totals for the latest day | free |
144
144
  | `ud_list_tlds` | Every root TLD with its registry facts and launch phases | free |
145
- | `ud_get_meta_tlds` | V1 TLD list path, redirected to /tlds for one release | free |
146
145
  | `ud_get_tld` | One TLD in full | free |
147
- | `ud_get_tld_stats` | Ending's latest market rollup | free |
146
+ | `ud_get_tld_stats` | Ending's latest market figures | free |
148
147
  | `ud_list_tld_phases` | Every dated launch phase of the ending, chronological | free |
149
148
  | `ud_list_tld_changes` | Ending's public registry changes, newest first | free |
150
149
  | `ud_list_tld_keywords` | Keywords the catalog attaches to the ending, by type | free |
@@ -171,7 +170,7 @@ The hosted connector serves the free tools only and takes no key. Three free too
171
170
  | `ud_list_market_sales_movers` | Up to ten words whose sales moved over the last 30 days | free |
172
171
  | `ud_get_market_sales_word` | One word's sales market over 12 months | free, npm only |
173
172
  | `ud_get_market_auctions` | Today's domain auctions by venue | free |
174
- | `ud_list_market_auctions_sample` | Day's frozen sample of up to 20 single-word names at auction | free |
173
+ | `ud_list_market_auctions_sample` | Day's fixed sample of up to 20 single-word names at auction | free |
175
174
  | `ud_list_market_auction_venues` | Seven auction venues with their verified rules and today's counts | free |
176
175
  | `ud_list_market_auction_outcomes` | Confirmed auction outcomes by venue | Investor key |
177
176
  | `ud_list_trends` | Every published trend with its latest edition figures and its first and last edition day | free |
@@ -6,7 +6,7 @@ import {
6
6
  createMcpServer,
7
7
  prepareServer,
8
8
  readConfig
9
- } from "./chunk-7RVJJYFN.js";
9
+ } from "./chunk-V2BPY65Q.js";
10
10
 
11
11
  // src/httpApp.ts
12
12
  import { createServer as createHttpServer } from "http";
@@ -103,7 +103,7 @@ var createRequestHandler = (prepared, options) => async (req, res) => {
103
103
  if (req.method === "POST") return await handleMcpPost(prepared, req, res);
104
104
  return sendJsonRpcError(res, 405, -32e3, "This server is stateless: send JSON-RPC requests with POST.", { Allow: "POST, OPTIONS" });
105
105
  }
106
- if (req.method !== "GET" && req.method !== "HEAD") return send(res, 405, "Method not allowed.\n", "text/plain; charset=utf-8", { Allow: "GET" });
106
+ if (req.method !== "GET" && req.method !== "HEAD") return send(res, 405, "Method not allowed.\n", "text/plain; charset=utf-8", { Allow: "GET, HEAD" });
107
107
  if (path === "/healthz") {
108
108
  return send(res, 200, JSON.stringify({ ok: true, version: SERVER_VERSION, tools: prepared.tools.length }), "application/json");
109
109
  }
@@ -123,8 +123,14 @@ var createRequestHandler = (prepared, options) => async (req, res) => {
123
123
  else res.end();
124
124
  }
125
125
  };
126
+ var assertServable = (config) => {
127
+ if (config.profile === "local" && config.apiKey !== null) {
128
+ throw new ConfigError("The HTTP server answers anyone, so it does not serve UD_API_KEY: set UD_MCP_PROFILE=hosted, or run the npm server over stdio for a member key.");
129
+ }
130
+ };
126
131
  var startHttpServer = async (env = process.env) => {
127
132
  const config = readConfig(env);
133
+ assertServable(config);
128
134
  const wellKnown = readWellKnownFiles(env);
129
135
  const prepared = await prepareServer(config);
130
136
  const port = Number(env.PORT ?? 8080);
@@ -146,5 +152,6 @@ var startHttpServer = async (env = process.env) => {
146
152
  export {
147
153
  readWellKnownFiles,
148
154
  createRequestHandler,
155
+ assertServable,
149
156
  startHttpServer
150
157
  };
@@ -20,6 +20,9 @@ var readConfig = (env) => {
20
20
  return { profile, apiKey: nonBlank(env.UD_API_KEY), apiBase, connectorSecret: null };
21
21
  };
22
22
 
23
+ // src/json.ts
24
+ var isObject = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
25
+
23
26
  // src/details.ts
24
27
  var WEBSITE = "https://unique.domains";
25
28
  var segment = (value) => typeof value === "string" && value.trim() !== "" ? encodeURIComponent(value.trim().toLowerCase()) : null;
@@ -35,13 +38,12 @@ var registrarPage = (input) => {
35
38
  };
36
39
  var tldPage = (input, data) => {
37
40
  const raw = typeof input.tld === "string" ? input.tld.trim().replace(/^\./u, "") : "";
38
- const publicSet = isRecord(data) && typeof data.quality === "string" && data.quality !== "";
41
+ const publicSet = isObject(data) && typeof data.quality === "string" && data.quality !== "";
39
42
  const tld = segment(raw);
40
43
  return publicSet && tld !== null ? `${WEBSITE}/tld/${tld}` : `${WEBSITE}/tld`;
41
44
  };
42
- var isRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
43
45
  var domainPage = (input, data) => {
44
- const fromData = isRecord(data) ? segment(data.name) : null;
46
+ const fromData = isObject(data) ? segment(data.name) : null;
45
47
  const name = fromData ?? (typeof input.nameOrId === "string" && input.nameOrId.includes(".") ? segment(input.nameOrId) : null);
46
48
  return name === null ? `${WEBSITE}/domains` : `${WEBSITE}/availability/${name}`;
47
49
  };
@@ -74,7 +76,6 @@ var DETAILS_RULES = {
74
76
  get_catalog_stats: page("/domains"),
75
77
  // Endings.
76
78
  list_tlds: page("/tld"),
77
- get_meta_tlds: page("/tld"),
78
79
  get_tld: tldPage,
79
80
  get_tld_stats: page("/tld"),
80
81
  list_tld_phases: page("/tld"),
@@ -127,8 +128,8 @@ var detailsFor = (operationId, input, data, fromApi) => {
127
128
  return rule === void 0 ? null : rule(input, data);
128
129
  };
129
130
  var DETAILS_SAMPLES = [
130
- { operationId: "get_name", input: { name: "harbor.io" } },
131
- { operationId: "get_name_registry", input: { name: "harbor.io" } },
131
+ { operationId: "get_name", input: { name: "get.plumbing" } },
132
+ { operationId: "get_name_registry", input: { name: "get.plumbing" } },
132
133
  { operationId: "list_domains", input: {} },
133
134
  // A public-set ending (its answer carries the band) and one outside the set, which points at the hub.
134
135
  { operationId: "get_tld", input: { tld: "ai" }, data: { quality: "prime" } },
@@ -155,11 +156,10 @@ var selectTools = (tools, profile, plan) => {
155
156
  return tool.plan !== "investor" || plan === "investor";
156
157
  });
157
158
  };
158
- var isObject = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
159
159
  var STRIPPED_LINKS = ["register", "product"];
160
160
  var isKeyless = (profile, plan) => profile === "hosted" || plan === "none";
161
161
  var KEYLESS_LIMIT_DESCRIPTION = "Page size, 20 at most.";
162
- var INPUT_PLAN_TALK = /\bpaid\b|\bsubscriptions?\b|\bkeyed\b|\bfree (?:tier|grade)\b|\bmember key\b/iu;
162
+ var PLAN_TALK = /\bpaid\b|\bsubscriptions?\b|\bkeyed\b|\bfree (?:tier|grade)\b|\bmember key\b|\b(?:founder|investor) (?:plan|key)\b/iu;
163
163
  var inputSchemaFor = (tool, profile, plan) => {
164
164
  if (!isKeyless(profile, plan)) return tool.inputSchema;
165
165
  const properties = tool.inputSchema.properties;
@@ -169,7 +169,7 @@ var inputSchemaFor = (tool, profile, plan) => {
169
169
  if (schema === void 0 || tool.keyedParameters.includes(name)) continue;
170
170
  if (name === "limit" && isObject(schema)) {
171
171
  kept[name] = { ...schema, description: KEYLESS_LIMIT_DESCRIPTION };
172
- } else if (profile === "hosted" && isObject(schema) && typeof schema.description === "string" && INPUT_PLAN_TALK.test(schema.description)) {
172
+ } else if (profile === "hosted" && isObject(schema) && typeof schema.description === "string" && PLAN_TALK.test(schema.description)) {
173
173
  const { description: _dropped, ...rest } = schema;
174
174
  kept[name] = rest;
175
175
  } else {
@@ -211,7 +211,8 @@ var shapeAnswer = (profile, operationId, input, envelope) => {
211
211
  const links = {};
212
212
  for (const [name, link] of Object.entries(envelope.links)) if (!STRIPPED_LINKS.includes(name) && link !== void 0) links[name] = link;
213
213
  links.details = detailsFor(operationId, input, envelope.data, envelope.links.details);
214
- return { data, meta: envelope.meta, links };
214
+ const meta = stripLinks(envelope.meta);
215
+ return { data, meta: isObject(meta) ? meta : {}, links };
215
216
  };
216
217
  var LABEL_KEYS = ["name", "domain", "word", "tld", "ending", "string", "phrase", "title", "label", "slug", "registrar", "venue"];
217
218
  var FACT_KEYS = ["status", "state", "lifecycle", "band", "verdict", "plan", "kind"];
@@ -228,7 +229,7 @@ var labelOf = (row) => {
228
229
  var factOf = (row) => {
229
230
  for (const key of FACT_KEYS) {
230
231
  const value = row[key];
231
- if (typeof value === "string" && value !== "" && value.length <= 40) return `${key} ${value}`;
232
+ if (typeof value === "string" && value !== "" && value.length <= 40) return `${key} ${value.replace(/_/gu, " ")}`;
232
233
  if (typeof value === "boolean") return `${key} ${value ? "yes" : "no"}`;
233
234
  }
234
235
  return null;
@@ -288,10 +289,10 @@ var readScalar = (name, parameter, raw) => {
288
289
  else return refuse();
289
290
  break;
290
291
  default:
291
- if (typeof raw === "string") value = raw;
292
+ if (typeof raw === "string") value = raw.trim();
292
293
  else if (typeof raw === "number") value = String(raw);
293
294
  else return refuse();
294
- if (value.trim() === "") return refuse();
295
+ if (value === "") return refuse();
295
296
  }
296
297
  if (parameter.enum && !parameter.enum.some((allowed) => allowed === value)) return refuse();
297
298
  return value;
@@ -303,6 +304,7 @@ var readBodyProperty = (property, raw) => {
303
304
  const itemType = property.items ?? { type: "string" };
304
305
  return items.map((item) => readScalar(`${property.name}[]`, { type: itemType.type, enum: itemType.enum }, item));
305
306
  };
307
+ var joinCommaList = (parameter, raw) => Array.isArray(raw) && parameter.type === "string" && /^comma/iu.test(parameter.description) && raw.every((item) => typeof item === "string" || typeof item === "number") ? raw.join(",") : raw;
306
308
  var splitInput = (operation, args) => {
307
309
  const given = args ?? {};
308
310
  const known = /* @__PURE__ */ new Set([...operation.parameters.map((parameter) => parameter.name), ...operation.body?.properties.map((property) => property.name) ?? []]);
@@ -316,7 +318,7 @@ var splitInput = (operation, args) => {
316
318
  const path = {};
317
319
  const query = {};
318
320
  for (const parameter of operation.parameters) {
319
- const raw = given[parameter.name];
321
+ const raw = joinCommaList(parameter, given[parameter.name]);
320
322
  if (raw === void 0 || raw === null) {
321
323
  if (parameter.required) throw new InputError(`\`${parameter.name}\` is required: ${parameter.description}`);
322
324
  continue;
@@ -371,6 +373,7 @@ var sentence = (text) => {
371
373
  const trimmed = text.trim();
372
374
  return trimmed === "" || /[.?!]$/u.test(trimmed) ? trimmed : `${trimmed}.`;
373
375
  };
376
+ var HOSTED_FREE_ONLY = "This connector serves the free answers only, and that input or page is not one of them. Call the tool again without it.";
374
377
  var refusalText = (error, profile, now) => {
375
378
  const detail = sentence(error.detail || error.title || `The API refused the call (${error.code}).`);
376
379
  const problem = error.problem;
@@ -379,6 +382,7 @@ var refusalText = (error, profile, now) => {
379
382
  case "cursor_invalid":
380
383
  case "unsupported_field": {
381
384
  const suggestion = typeof problem.suggestion === "string" ? problem.suggestion.trim() : "";
385
+ if (profile === "hosted" && PLAN_TALK.test(`${detail} ${suggestion}`)) return HOSTED_FREE_ONLY;
382
386
  return suggestion === "" ? detail : `${detail} Try: ${sentence(suggestion)}`;
383
387
  }
384
388
  case "plan_required":
@@ -386,7 +390,7 @@ var refusalText = (error, profile, now) => {
386
390
  if (!error.product) return `${detail} This tool comes with the Investor plan.`;
387
391
  return `${detail} This tool comes with the Investor plan; move to Investor at ${error.product}.`;
388
392
  case "keyed_only":
389
- if (profile === "hosted") return "This connector serves the free answers only, and that input or page is not one of them. Call the tool again without it.";
393
+ if (profile === "hosted") return HOSTED_FREE_ONLY;
390
394
  return `${detail} This tool needs a member key or a RapidAPI plan.`;
391
395
  case "quota_spent": {
392
396
  const resetsAt = error.quota?.resetsAt ?? (error.retryAfter !== null ? new Date(now.getTime() + error.retryAfter * 1e3) : null);
@@ -410,7 +414,7 @@ var refusalText = (error, profile, now) => {
410
414
  case "internal":
411
415
  return `${detail} Try again in a minute.`;
412
416
  default:
413
- if (error.status === 503 || error.status >= 500) return `${detail} Try again in a minute.`;
417
+ if (error.status >= 500) return `${detail} Try again in a minute.`;
414
418
  return detail;
415
419
  }
416
420
  };
@@ -427,7 +431,6 @@ var acceptedLine = (operationId, wait, data) => {
427
431
  var isNetworkFailure = (error) => error instanceof TypeError && (error.message === "fetch failed" || error.cause !== void 0);
428
432
  var isTimeout = (error) => error instanceof Error && error.name === "TimeoutError";
429
433
  var callOnce = (context, operationId, input) => {
430
- if (!isOperationId(operationId)) throw new Error(`Unknown operation ${operationId}`);
431
434
  const hasPath = Object.keys(input.path).length > 0;
432
435
  const hasQuery = Object.keys(input.query).length > 0;
433
436
  return context.client.requestOperation(operationId, {
@@ -439,12 +442,14 @@ var callOnce = (context, operationId, input) => {
439
442
  };
440
443
  var runTool = async (context, tool, args) => {
441
444
  const now = context.now ?? (() => /* @__PURE__ */ new Date());
442
- const operation = isOperationId(tool.operationId) ? OPERATIONS[tool.operationId] : void 0;
443
- if (operation === void 0) return errorResult(`The tool ${tool.name} has no operation in this version of the server.`);
445
+ const operationId = tool.operationId;
446
+ if (!isOperationId(operationId)) return errorResult(`The tool ${tool.name} has no operation in this version of the server.`);
447
+ const operation = OPERATIONS[operationId];
444
448
  const keyedSent = context.keyless ? tool.keyedParameters.filter((name) => args?.[name] !== void 0 && args[name] !== null) : [];
445
449
  if (keyedSent.length > 0) {
446
450
  const names = keyedSent.map((name) => `\`${name}\``).join(", ");
447
451
  if (context.profile === "hosted") return errorResult(`This connector does not take ${names}. Call the tool again without it.`);
452
+ if (context.keyWithoutPlan === true) return errorResult(`${names} needs a member key on a paid plan, and UD_API_KEY opens none (or its plan could not be read when the server started). Call the tool again without it.`);
448
453
  return errorResult(`${names} needs a member key: set UD_API_KEY (Settings, Account, API in Unique Domains), or call the tool again without it.`);
449
454
  }
450
455
  let input;
@@ -457,12 +462,12 @@ var runTool = async (context, tool, args) => {
457
462
  let answer;
458
463
  try {
459
464
  try {
460
- answer = await callOnce(context, tool.operationId, input);
465
+ answer = await callOnce(context, operationId, input);
461
466
  } catch (error) {
462
467
  if (!(error instanceof ApiProblemError) || error.status !== 429 || error.code !== "rate_limited") throw error;
463
468
  if (error.retryAfter === null || error.retryAfter <= 1 || error.retryAfter > RETRY_AFTER_MAX_SECONDS) throw error;
464
469
  await (context.sleep ?? sleepFor)(Math.max(1, error.retryAfter) * 1e3);
465
- answer = await callOnce(context, tool.operationId, input);
470
+ answer = await callOnce(context, operationId, input);
466
471
  }
467
472
  } catch (error) {
468
473
  if (error instanceof ApiProblemError) return errorResult(refusalText(error, context.profile, now()));
@@ -492,13 +497,13 @@ var runTool = async (context, tool, args) => {
492
497
 
493
498
  // src/generated/tools.ts
494
499
  var TOOLS_DOCUMENT_VERSION = "1.0.0";
495
- var TOOLS_SDK_VERSION = "0.1.0";
500
+ var TOOLS_SDK_VERSION = "0.2.0";
496
501
  var TOOLS = [
497
502
  {
498
503
  "name": "ud_get_name",
499
504
  "operationId": "get_name",
500
505
  "title": "Stored answer for one domain name",
501
- "description": "The stored answer for one domain name: status, drop day, price today, registry facts, word facts and similar sales. Pass `name` (such as lantern.io).",
506
+ "description": "The stored answer for one domain name: status, drop day, price today, registry facts, word facts and similar sales. Pass `name` (such as get.plumbing).",
502
507
  "tier": "free",
503
508
  "plan": null,
504
509
  "metered": null,
@@ -1541,7 +1546,7 @@ var TOOLS = [
1541
1546
  "name": "ud_check_name",
1542
1547
  "operationId": "check_name",
1543
1548
  "title": "Reads one name live from its registry and a registrar",
1544
- "description": "Reads one name live from its registry and a registrar, stores the answer and returns the keyed name resource. Pass `name` (such as lantern.io).",
1549
+ "description": "Reads one name live from its registry and a registrar, stores the answer and returns the keyed name resource. Pass `name` (such as get.plumbing).",
1545
1550
  "tier": "keyed",
1546
1551
  "plan": null,
1547
1552
  "metered": "Live",
@@ -2107,7 +2112,7 @@ var TOOLS = [
2107
2112
  "name": "ud_get_name_prices",
2108
2113
  "operationId": "get_name_prices",
2109
2114
  "title": "Every stored registrar quote for one name",
2110
- "description": "Every stored registrar quote for one name, and the renewal-trap flag. Pass `name` (such as lantern.io).",
2115
+ "description": "Every stored registrar quote for one name, and the renewal-trap flag. Pass `name` (such as get.plumbing).",
2111
2116
  "tier": "keyed",
2112
2117
  "plan": null,
2113
2118
  "metered": null,
@@ -2342,7 +2347,7 @@ var TOOLS = [
2342
2347
  "name": "ud_get_name_registry",
2343
2348
  "operationId": "get_name_registry",
2344
2349
  "title": "Latest stored registry record of one name",
2345
- "description": "The latest stored registry record of one name: dates, registrar, status codes, nameservers, DNSSEC and holder. Pass `name` (such as lantern.io).",
2350
+ "description": "The latest stored registry record of one name: dates, registrar, status codes, nameservers, DNSSEC and holder. Pass `name` (such as get.plumbing).",
2346
2351
  "tier": "free",
2347
2352
  "plan": null,
2348
2353
  "metered": null,
@@ -2656,7 +2661,7 @@ var TOOLS = [
2656
2661
  "name": "ud_get_name_registry_history",
2657
2662
  "operationId": "get_name_registry_history",
2658
2663
  "title": "Stored registry record versions of one name and what moved between them",
2659
- "description": "The stored registry record versions of one name and what moved between them. Pass `name` (such as lantern.io).",
2664
+ "description": "The stored registry record versions of one name and what moved between them. Pass `name` (such as get.plumbing).",
2660
2665
  "tier": "keyed",
2661
2666
  "plan": "investor",
2662
2667
  "metered": null,
@@ -2900,7 +2905,7 @@ var TOOLS = [
2900
2905
  "name": "ud_get_name_dns",
2901
2906
  "operationId": "get_name_dns",
2902
2907
  "title": "Latest stored DNS reading of one name",
2903
- "description": "The latest stored DNS reading of one name, with its parking venue. Pass `name` (such as lantern.io).",
2908
+ "description": "The latest stored DNS reading of one name, with its parking venue. Pass `name` (such as get.plumbing).",
2904
2909
  "tier": "free",
2905
2910
  "plan": null,
2906
2911
  "metered": null,
@@ -3112,7 +3117,7 @@ var TOOLS = [
3112
3117
  "name": "ud_list_name_changes",
3113
3118
  "operationId": "list_name_changes",
3114
3119
  "title": "Change events of one name, newest first",
3115
- "description": "The change events of one name, newest first. Pass `name` (such as lantern.io); the other inputs are optional.",
3120
+ "description": "The change events of one name, newest first. Pass `name` (such as get.plumbing); the other inputs are optional.",
3116
3121
  "tier": "keyed",
3117
3122
  "plan": "investor",
3118
3123
  "metered": null,
@@ -3338,7 +3343,7 @@ var TOOLS = [
3338
3343
  "name": "ud_get_name_history",
3339
3344
  "operationId": "get_name_history",
3340
3345
  "title": "Web history of one name as our bands",
3341
- "description": "The web history of one name as our bands: archive captures, authority band and language. Pass `name` (such as lantern.io).",
3346
+ "description": "The web history of one name as our bands: archive captures, authority band and language. Pass `name` (such as get.plumbing).",
3342
3347
  "tier": "keyed",
3343
3348
  "plan": "investor",
3344
3349
  "metered": null,
@@ -3549,7 +3554,7 @@ var TOOLS = [
3549
3554
  "name": "ud_get_name_value",
3550
3555
  "operationId": "get_name_value",
3551
3556
  "title": "Stored value estimate of one name and its last 20 estimates",
3552
- "description": "The stored value estimate of one name and its last 20 estimates. Pass `name` (such as lantern.io).",
3557
+ "description": "The stored value estimate of one name and its last 20 estimates. Pass `name` (such as get.plumbing).",
3553
3558
  "tier": "keyed",
3554
3559
  "plan": null,
3555
3560
  "metered": null,
@@ -3732,7 +3737,7 @@ var TOOLS = [
3732
3737
  "name": "ud_appraise_name",
3733
3738
  "operationId": "appraise_name",
3734
3739
  "title": "Runs the appraisal of one stored name when its estimate is missing",
3735
- "description": "Runs the appraisal of one stored name when its estimate is missing, and returns the value resource. Pass `name` (such as lantern.io).",
3740
+ "description": "Runs the appraisal of one stored name when its estimate is missing, and returns the value resource. Pass `name` (such as get.plumbing).",
3736
3741
  "tier": "keyed",
3737
3742
  "plan": "investor",
3738
3743
  "metered": "Appraisal",
@@ -3915,7 +3920,7 @@ var TOOLS = [
3915
3920
  "name": "ud_get_name_comps",
3916
3921
  "operationId": "get_name_comps",
3917
3922
  "title": "Similar-sales aggregate of one name and the endings its word sold on",
3918
- "description": "The similar-sales aggregate of one name and the endings its word sold on. Pass `name` (such as lantern.io).",
3923
+ "description": "The similar-sales aggregate of one name and the endings its word sold on. Pass `name` (such as get.plumbing).",
3919
3924
  "tier": "free",
3920
3925
  "plan": null,
3921
3926
  "metered": null,
@@ -4093,7 +4098,7 @@ var TOOLS = [
4093
4098
  "name": "ud_get_name_auction",
4094
4099
  "operationId": "get_name_auction",
4095
4100
  "title": "Open auction of one name, if any",
4096
- "description": "The open auction of one name, if any: venue, deadline, bid and the first-year cost. Pass `name` (such as lantern.io).",
4101
+ "description": "The open auction of one name, if any: venue, deadline, bid and the first-year cost. Pass `name` (such as get.plumbing).",
4097
4102
  "tier": "free",
4098
4103
  "plan": null,
4099
4104
  "metered": null,
@@ -4850,7 +4855,7 @@ var TOOLS = [
4850
4855
  }
4851
4856
  },
4852
4857
  "denyClass": {
4853
- "description": "Why the word stays off public lists (ADR-0111); null when none.",
4858
+ "description": "Why the word stays off public lists; null when none.",
4854
4859
  "anyOf": [
4855
4860
  {
4856
4861
  "type": "string"
@@ -5691,7 +5696,7 @@ var TOOLS = [
5691
5696
  }
5692
5697
  },
5693
5698
  "denyClass": {
5694
- "description": "Why the word stays off public lists (ADR-0111); null when none.",
5699
+ "description": "Why the word stays off public lists; null when none.",
5695
5700
  "anyOf": [
5696
5701
  {
5697
5702
  "type": "string"
@@ -8282,7 +8287,7 @@ var TOOLS = [
8282
8287
  "name": "ud_get_domain",
8283
8288
  "operationId": "get_domain",
8284
8289
  "title": "One catalog name, by name or id",
8285
- "description": "One catalog name, by name or id. Pass `nameOrId` (such as lantern.io).",
8290
+ "description": "One catalog name, by name or id. Pass `nameOrId` (such as get.plumbing).",
8286
8291
  "tier": "free",
8287
8292
  "plan": null,
8288
8293
  "metered": null,
@@ -10156,7 +10161,7 @@ var TOOLS = [
10156
10161
  "properties": {
10157
10162
  "computedAt": {
10158
10163
  "type": "string",
10159
- "description": "Timestamp of the rollup."
10164
+ "description": "When these figures were computed."
10160
10165
  },
10161
10166
  "availableOneWord": {
10162
10167
  "type": "integer",
@@ -10357,153 +10362,6 @@ var TOOLS = [
10357
10362
  "destructive": "Not destructive: it writes and deletes nothing."
10358
10363
  }
10359
10364
  },
10360
- {
10361
- "name": "ud_get_meta_tlds",
10362
- "operationId": "get_meta_tlds",
10363
- "title": "V1 TLD list path, redirected to /tlds for one release",
10364
- "description": "The v1 TLD list path, redirected to /tlds for one release. Every input is optional.",
10365
- "tier": "free",
10366
- "plan": null,
10367
- "metered": null,
10368
- "hosted": true,
10369
- "inputSchema": {
10370
- "type": "object",
10371
- "properties": {
10372
- "listing": {
10373
- "type": "string",
10374
- "enum": [
10375
- "all",
10376
- "public"
10377
- ],
10378
- "description": "v1's switch: `public` becomes `publicSet=true`."
10379
- }
10380
- },
10381
- "additionalProperties": false
10382
- },
10383
- "keyedParameters": [],
10384
- "outputSchema": {
10385
- "type": "object",
10386
- "properties": {
10387
- "data": {
10388
- "type": "null",
10389
- "description": "No body: a `308` with `Location`."
10390
- },
10391
- "meta": {
10392
- "type": "object",
10393
- "properties": {
10394
- "asOf": {
10395
- "anyOf": [
10396
- {
10397
- "type": "string"
10398
- },
10399
- {
10400
- "type": "null"
10401
- }
10402
- ]
10403
- },
10404
- "cursor": {
10405
- "anyOf": [
10406
- {
10407
- "type": "string"
10408
- },
10409
- {
10410
- "type": "null"
10411
- }
10412
- ]
10413
- },
10414
- "limit": {
10415
- "anyOf": [
10416
- {
10417
- "type": "integer"
10418
- },
10419
- {
10420
- "type": "null"
10421
- }
10422
- ]
10423
- }
10424
- },
10425
- "additionalProperties": true,
10426
- "description": "The day of the answer, and the page cursor of a list."
10427
- },
10428
- "links": {
10429
- "type": "object",
10430
- "description": "Links of the answer.",
10431
- "properties": {
10432
- "self": {
10433
- "type": "string",
10434
- "description": "This answer on the API."
10435
- },
10436
- "next": {
10437
- "description": "The next page on the API, when there is one.",
10438
- "anyOf": [
10439
- {
10440
- "type": "string"
10441
- },
10442
- {
10443
- "type": "null"
10444
- }
10445
- ]
10446
- },
10447
- "register": {
10448
- "description": "Where to register the name, when it can be registered.",
10449
- "anyOf": [
10450
- {
10451
- "type": "string"
10452
- },
10453
- {
10454
- "type": "null"
10455
- }
10456
- ]
10457
- },
10458
- "product": {
10459
- "description": "The Unique Domains page that opens what a refusal named.",
10460
- "anyOf": [
10461
- {
10462
- "type": "string"
10463
- },
10464
- {
10465
- "type": "null"
10466
- }
10467
- ]
10468
- },
10469
- "dataset": {
10470
- "description": "The GitHub dataset holding the same rows.",
10471
- "anyOf": [
10472
- {
10473
- "type": "string"
10474
- },
10475
- {
10476
- "type": "null"
10477
- }
10478
- ]
10479
- },
10480
- "details": {
10481
- "description": "The public Unique Domains page about the subject.",
10482
- "anyOf": [
10483
- {
10484
- "type": "string"
10485
- },
10486
- {
10487
- "type": "null"
10488
- }
10489
- ]
10490
- }
10491
- }
10492
- }
10493
- }
10494
- },
10495
- "annotations": {
10496
- "readOnlyHint": true,
10497
- "destructiveHint": false,
10498
- "idempotentHint": true,
10499
- "openWorldHint": false
10500
- },
10501
- "justification": {
10502
- "readOnly": "Read-only: it reads stored Unique Domains data and changes nothing.",
10503
- "openWorld": "Closed world: it reads the Unique Domains catalog only, never the open web.",
10504
- "destructive": "Not destructive: it writes and deletes nothing."
10505
- }
10506
- },
10507
10365
  {
10508
10366
  "name": "ud_get_tld",
10509
10367
  "operationId": "get_tld",
@@ -10674,7 +10532,7 @@ var TOOLS = [
10674
10532
  "properties": {
10675
10533
  "computedAt": {
10676
10534
  "type": "string",
10677
- "description": "Timestamp of the rollup."
10535
+ "description": "When these figures were computed."
10678
10536
  },
10679
10537
  "availableOneWord": {
10680
10538
  "type": "integer",
@@ -10972,8 +10830,8 @@ var TOOLS = [
10972
10830
  {
10973
10831
  "name": "ud_get_tld_stats",
10974
10832
  "operationId": "get_tld_stats",
10975
- "title": "Ending's latest market rollup",
10976
- "description": "The ending's latest market rollup, and with history its last daily rows. Pass `tld` (such as ai); the other inputs are optional.",
10833
+ "title": "Ending's latest market figures",
10834
+ "description": "The ending's latest market figures, and with history its last daily rows. Pass `tld` (such as ai); the other inputs are optional.",
10977
10835
  "tier": "free",
10978
10836
  "plan": null,
10979
10837
  "metered": null,
@@ -11014,7 +10872,7 @@ var TOOLS = [
11014
10872
  },
11015
10873
  "day": {
11016
10874
  "type": "string",
11017
- "description": "The rollup's day."
10875
+ "description": "The day of these figures."
11018
10876
  },
11019
10877
  "computedAt": {
11020
10878
  "anyOf": [
@@ -11186,7 +11044,7 @@ var TOOLS = [
11186
11044
  },
11187
11045
  "day": {
11188
11046
  "type": "string",
11189
- "description": "The rollup's day."
11047
+ "description": "The day of these figures."
11190
11048
  },
11191
11049
  "computedAt": {
11192
11050
  "anyOf": [
@@ -13143,7 +13001,9 @@ var TOOLS = [
13143
13001
  "additionalProperties": false
13144
13002
  },
13145
13003
  "keyedParameters": [
13146
- "delisted"
13004
+ "delisted",
13005
+ "limit",
13006
+ "cursor"
13147
13007
  ],
13148
13008
  "outputSchema": {
13149
13009
  "type": "object",
@@ -13336,7 +13196,7 @@ var TOOLS = [
13336
13196
  "name": "ud_list_registrar_changes",
13337
13197
  "operationId": "list_registrar_changes",
13338
13198
  "title": "A registrar's confirmed list-price changes, newest first",
13339
- "description": "A registrar's confirmed list-price changes, newest first. Pass `registrar` (such as namecheap); the other inputs are optional.",
13199
+ "description": "A registrar's confirmed list-price changes, newest first. Pass `registrar` (such as namecheap).",
13340
13200
  "tier": "free",
13341
13201
  "plan": null,
13342
13202
  "metered": null,
@@ -13380,7 +13240,10 @@ var TOOLS = [
13380
13240
  ],
13381
13241
  "additionalProperties": false
13382
13242
  },
13383
- "keyedParameters": [],
13243
+ "keyedParameters": [
13244
+ "limit",
13245
+ "cursor"
13246
+ ],
13384
13247
  "outputSchema": {
13385
13248
  "type": "object",
13386
13249
  "properties": {
@@ -14225,7 +14088,7 @@ var TOOLS = [
14225
14088
  "name": "ud_list_price_changes",
14226
14089
  "operationId": "list_price_changes",
14227
14090
  "title": "Confirmed registrar price changes across the nine",
14228
- "description": "Confirmed registrar price changes across the nine, newest first. Every input is optional; `limit` sets the page size.",
14091
+ "description": "Confirmed registrar price changes across the nine, newest first. Every input is optional.",
14229
14092
  "tier": "free",
14230
14093
  "plan": null,
14231
14094
  "metered": null,
@@ -14287,7 +14150,9 @@ var TOOLS = [
14287
14150
  "ending",
14288
14151
  "registrar",
14289
14152
  "field",
14290
- "since"
14153
+ "since",
14154
+ "limit",
14155
+ "cursor"
14291
14156
  ],
14292
14157
  "outputSchema": {
14293
14158
  "type": "object",
@@ -14455,7 +14320,7 @@ var TOOLS = [
14455
14320
  "name": "ud_list_price_traps",
14456
14321
  "operationId": "list_price_traps",
14457
14322
  "title": "Endings whose cheapest first year renews at a trap price",
14458
- "description": "Endings whose cheapest first year renews at a trap price, alphabetical. Every input is optional; `limit` sets the page size.",
14323
+ "description": "Endings whose cheapest first year renews at a trap price, alphabetical. Every input is optional.",
14459
14324
  "tier": "free",
14460
14325
  "plan": null,
14461
14326
  "metered": null,
@@ -14481,7 +14346,10 @@ var TOOLS = [
14481
14346
  },
14482
14347
  "additionalProperties": false
14483
14348
  },
14484
- "keyedParameters": [],
14349
+ "keyedParameters": [
14350
+ "limit",
14351
+ "cursor"
14352
+ ],
14485
14353
  "outputSchema": {
14486
14354
  "type": "object",
14487
14355
  "properties": {
@@ -17380,8 +17248,8 @@ var TOOLS = [
17380
17248
  {
17381
17249
  "name": "ud_list_market_auctions_sample",
17382
17250
  "operationId": "list_market_auctions_sample",
17383
- "title": "Day's frozen sample of up to 20 single-word names at auction",
17384
- "description": "The day's frozen sample of up to 20 single-word names at auction, by deadline. Takes no input.",
17251
+ "title": "Day's fixed sample of up to 20 single-word names at auction",
17252
+ "description": "The day's fixed sample of up to 20 single-word names at auction, by deadline. Takes no input.",
17385
17253
  "tier": "free",
17386
17254
  "plan": null,
17387
17255
  "metered": null,
@@ -22239,7 +22107,7 @@ import { ApiProblemError as ApiProblemError2, createClient } from "@uniquedomain
22239
22107
  // package.json
22240
22108
  var package_default = {
22241
22109
  name: "@uniquedomains/mcp-server",
22242
- version: "0.1.0",
22110
+ version: "0.1.2",
22243
22111
  description: "MCP server for the Unique Domains API: domain names, words, TLDs, registrar prices, the domain market, trends and the agenda.",
22244
22112
  license: "MIT",
22245
22113
  author: "Unique Domains (https://unique.domains)",
@@ -22293,7 +22161,7 @@ var package_default = {
22293
22161
  },
22294
22162
  dependencies: {
22295
22163
  "@modelcontextprotocol/sdk": "^1.32.2",
22296
- "@uniquedomains/sdk": "^0.1.0"
22164
+ "@uniquedomains/sdk": "^0.2.0"
22297
22165
  },
22298
22166
  devDependencies: {
22299
22167
  "@types/node": "22.20.5",
@@ -22309,8 +22177,8 @@ var SERVER_NAME = "uniquedomains";
22309
22177
  var SERVER_VERSION = package_default.version;
22310
22178
  var INSTRUCTIONS = [
22311
22179
  "Unique Domains reads its own catalog of domain names, words, TLDs, registrar prices, the domain market, trends and the industry agenda.",
22312
- "Every answer is stored data as of its day; `links.details` points at the public page about the subject when there is one.",
22313
- "Pass a full domain name such as harbor.io to the name tools, and an ending without its dot such as ai to the TLD tools."
22180
+ "Answers are stored data as of their day, unless a tool says it reads live; `links.details` points at the public page about the subject when there is one.",
22181
+ "Pass a full domain name such as get.plumbing to the name tools, and an ending without its dot such as ai to the TLD tools."
22314
22182
  ].join(" ");
22315
22183
  var userAgent = (config) => `uniquedomains-mcp-server/${SERVER_VERSION} (${config.profile})`;
22316
22184
  var createApiClient = (config, fetchImpl) => createClient({
@@ -22341,24 +22209,31 @@ var readKeyPlan = async (client, log) => {
22341
22209
  var prepareServer = async (config, options = {}) => {
22342
22210
  const log = options.log ?? ((line) => process.stderr.write(`${line}
22343
22211
  `));
22344
- const client = createApiClient(config, options.fetch);
22345
- const plan = config.profile === "local" && config.apiKey !== null ? await readKeyPlan(client, log) : "none";
22346
- return { config, client, plan, tools: selectTools(TOOLS, config.profile, plan) };
22212
+ const keyedClient = createApiClient(config, options.fetch);
22213
+ const plan = config.profile === "local" && config.apiKey !== null ? await readKeyPlan(keyedClient, log) : "none";
22214
+ const client = config.apiKey !== null && plan === "none" ? createApiClient({ ...config, apiKey: null }, options.fetch) : keyedClient;
22215
+ const tools = selectTools(TOOLS, config.profile, plan);
22216
+ return { config, client, plan, tools, listed: tools.map((tool) => toListedTool(tool, config.profile, plan)) };
22347
22217
  };
22348
- var toListedTool = (tool, prepared) => ({
22218
+ var toListedTool = (tool, profile, plan) => ({
22349
22219
  name: tool.name,
22350
22220
  title: tool.title,
22351
22221
  description: tool.description,
22352
- inputSchema: inputSchemaFor(tool, prepared.config.profile, prepared.plan),
22353
- outputSchema: outputSchemaFor(tool, prepared.config.profile),
22222
+ inputSchema: inputSchemaFor(tool, profile, plan),
22223
+ outputSchema: outputSchemaFor(tool, profile),
22354
22224
  annotations: { title: tool.title, ...tool.annotations }
22355
22225
  });
22356
22226
  var createMcpServer = (prepared, overrides = {}) => {
22357
22227
  const server = new Server({ name: SERVER_NAME, title: "Unique Domains", version: SERVER_VERSION }, { capabilities: { tools: { listChanged: false } }, instructions: INSTRUCTIONS });
22358
22228
  const byName = new Map(prepared.tools.map((tool) => [tool.name, tool]));
22359
- const listed = prepared.tools.map((tool) => toListedTool(tool, prepared));
22360
- const context = { client: prepared.client, profile: prepared.config.profile, keyless: isKeyless(prepared.config.profile, prepared.plan), ...overrides };
22361
- server.setRequestHandler(ListToolsRequestSchema, () => ({ tools: listed }));
22229
+ const context = {
22230
+ client: prepared.client,
22231
+ profile: prepared.config.profile,
22232
+ keyless: isKeyless(prepared.config.profile, prepared.plan),
22233
+ keyWithoutPlan: prepared.config.apiKey !== null && prepared.plan === "none",
22234
+ ...overrides
22235
+ };
22236
+ server.setRequestHandler(ListToolsRequestSchema, () => ({ tools: [...prepared.listed] }));
22362
22237
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
22363
22238
  const tool = byName.get(request.params.name);
22364
22239
  if (tool === void 0) {
@@ -22375,13 +22250,14 @@ export {
22375
22250
  readConfig,
22376
22251
  HTTP_BODY_LIMIT_BYTES,
22377
22252
  DRAIN_LIMIT_BYTES,
22253
+ isObject,
22378
22254
  WEBSITE,
22379
22255
  registrarSlug,
22380
22256
  DETAILS_RULES,
22381
22257
  detailsFor,
22382
22258
  DETAILS_SAMPLES,
22383
22259
  selectTools,
22384
- isObject,
22260
+ PLAN_TALK,
22385
22261
  outputSchemaFor,
22386
22262
  shapeAnswer,
22387
22263
  textLine,
package/dist/http.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  startHttpServer
4
- } from "./chunk-ZBIZ6H5V.js";
4
+ } from "./chunk-2UU2IMAD.js";
5
5
  import {
6
6
  ConfigError
7
- } from "./chunk-7RVJJYFN.js";
7
+ } from "./chunk-V2BPY65Q.js";
8
8
 
9
9
  // src/transports/http.ts
10
10
  startHttpServer().catch((error) => {
package/dist/index.js CHANGED
@@ -1,14 +1,16 @@
1
1
  import {
2
+ assertServable,
2
3
  createRequestHandler,
3
4
  readWellKnownFiles,
4
5
  startHttpServer
5
- } from "./chunk-ZBIZ6H5V.js";
6
+ } from "./chunk-2UU2IMAD.js";
6
7
  import {
7
8
  ConfigError,
8
9
  DETAILS_RULES,
9
10
  DETAILS_SAMPLES,
10
11
  INSTRUCTIONS,
11
12
  InputError,
13
+ PLAN_TALK,
12
14
  SERVER_NAME,
13
15
  SERVER_VERSION,
14
16
  TOOLS,
@@ -33,19 +35,21 @@ import {
33
35
  splitInput,
34
36
  textLine,
35
37
  toListedTool
36
- } from "./chunk-7RVJJYFN.js";
38
+ } from "./chunk-V2BPY65Q.js";
37
39
  export {
38
40
  ConfigError,
39
41
  DETAILS_RULES,
40
42
  DETAILS_SAMPLES,
41
43
  INSTRUCTIONS,
42
44
  InputError,
45
+ PLAN_TALK,
43
46
  SERVER_NAME,
44
47
  SERVER_VERSION,
45
48
  TOOLS,
46
49
  TOOLS_DOCUMENT_VERSION,
47
50
  TOOLS_SDK_VERSION,
48
51
  WEBSITE,
52
+ assertServable,
49
53
  createApiClient,
50
54
  createMcpServer,
51
55
  createRequestHandler,
package/dist/stdio.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  createMcpServer,
6
6
  prepareServer,
7
7
  readConfig
8
- } from "./chunk-7RVJJYFN.js";
8
+ } from "./chunk-V2BPY65Q.js";
9
9
 
10
10
  // src/transports/stdio.ts
11
11
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniquedomains/mcp-server",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "MCP server for the Unique Domains API: domain names, words, TLDs, registrar prices, the domain market, trends and the agenda.",
5
5
  "license": "MIT",
6
6
  "author": "Unique Domains (https://unique.domains)",
@@ -54,7 +54,7 @@
54
54
  },
55
55
  "dependencies": {
56
56
  "@modelcontextprotocol/sdk": "^1.32.2",
57
- "@uniquedomains/sdk": "^0.1.0"
57
+ "@uniquedomains/sdk": "^0.2.0"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@types/node": "22.20.5",