@uniquedomains/mcp-server 0.1.0 → 0.1.1
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 +1 -2
- package/dist/{chunk-ZBIZ6H5V.js → chunk-FDHNAV5B.js} +9 -2
- package/dist/{chunk-7RVJJYFN.js → chunk-LOMVELQR.js} +64 -188
- package/dist/http.js +2 -2
- package/dist/index.js +6 -2
- package/dist/stdio.js +1 -1
- package/package.json +1 -1
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
|
-
|
|
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,7 +142,6 @@ 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
146
|
| `ud_get_tld_stats` | Ending's latest market rollup | free |
|
|
148
147
|
| `ud_list_tld_phases` | Every dated launch phase of the ending, chronological | free |
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
createMcpServer,
|
|
7
7
|
prepareServer,
|
|
8
8
|
readConfig
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-LOMVELQR.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 =
|
|
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 =
|
|
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: "
|
|
131
|
-
{ operationId: "get_name_registry", input: { name: "
|
|
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
|
|
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" &&
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
443
|
-
if (
|
|
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,
|
|
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,
|
|
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()));
|
|
@@ -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",
|
|
@@ -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)
|
|
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
|
|
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
|
|
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": {
|
|
@@ -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.
|
|
22110
|
+
version: "0.1.1",
|
|
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)",
|
|
@@ -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
|
-
"
|
|
22313
|
-
"Pass a full domain name such as
|
|
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
|
|
22345
|
-
const plan = config.profile === "local" && config.apiKey !== null ? await readKeyPlan(
|
|
22346
|
-
|
|
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,
|
|
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,
|
|
22353
|
-
outputSchema: outputSchemaFor(tool,
|
|
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
|
|
22360
|
-
|
|
22361
|
-
|
|
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
|
-
|
|
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-
|
|
4
|
+
} from "./chunk-FDHNAV5B.js";
|
|
5
5
|
import {
|
|
6
6
|
ConfigError
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-LOMVELQR.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-
|
|
6
|
+
} from "./chunk-FDHNAV5B.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-
|
|
38
|
+
} from "./chunk-LOMVELQR.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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniquedomains/mcp-server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
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)",
|