@uniquedomains/mcp-server 0.1.2 → 0.1.3

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.
@@ -6,7 +6,7 @@ import {
6
6
  createMcpServer,
7
7
  prepareServer,
8
8
  readConfig
9
- } from "./chunk-V2BPY65Q.js";
9
+ } from "./chunk-DKI5HXRQ.js";
10
10
 
11
11
  // src/httpApp.ts
12
12
  import { createServer as createHttpServer } from "http";
@@ -35,9 +35,11 @@ var readWellKnownFiles = (env) => {
35
35
  }
36
36
  return files;
37
37
  };
38
+ var HSTS_HEADER = "max-age=31536000";
38
39
  var CORS_HEADERS = {
39
40
  "Access-Control-Allow-Origin": "*",
40
- "Access-Control-Allow-Methods": "POST, GET, DELETE, OPTIONS",
41
+ // GET and DELETE answer 405 on this stateless server, so the preflight does not offer them (fix round P-9).
42
+ "Access-Control-Allow-Methods": "POST, OPTIONS",
41
43
  "Access-Control-Allow-Headers": "Content-Type, Accept, Mcp-Protocol-Version, Mcp-Session-Id, Last-Event-ID",
42
44
  "Access-Control-Expose-Headers": "Mcp-Session-Id, Mcp-Protocol-Version",
43
45
  "Access-Control-Max-Age": "86400"
@@ -95,9 +97,11 @@ var handleMcpPost = async (prepared, req, res) => {
95
97
  await transport.handleRequest(req, res, parsed);
96
98
  };
97
99
  var createRequestHandler = (prepared, options) => async (req, res) => {
98
- const url = new URL(req.url ?? "/", "http://localhost");
99
- const path = url.pathname.replace(/\/+$/u, "") || "/";
100
+ res.setHeader("Strict-Transport-Security", HSTS_HEADER);
100
101
  try {
102
+ if (!URL.canParse(req.url ?? "/", "http://localhost")) return send(res, 400, "Bad request.\n", "text/plain; charset=utf-8");
103
+ const url = new URL(req.url ?? "/", "http://localhost");
104
+ const path = url.pathname.replace(/\/+$/u, "") || "/";
101
105
  if (path === "/mcp") {
102
106
  if (req.method === "OPTIONS") return send(res, 204, "", "text/plain", CORS_HEADERS);
103
107
  if (req.method === "POST") return await handleMcpPost(prepared, req, res);
@@ -151,6 +155,7 @@ var startHttpServer = async (env = process.env) => {
151
155
 
152
156
  export {
153
157
  readWellKnownFiles,
158
+ HSTS_HEADER,
154
159
  createRequestHandler,
155
160
  assertServable,
156
161
  startHttpServer
package/dist/http.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  startHttpServer
4
- } from "./chunk-2UU2IMAD.js";
4
+ } from "./chunk-KUJEFQYK.js";
5
5
  import {
6
6
  ConfigError
7
- } from "./chunk-V2BPY65Q.js";
7
+ } from "./chunk-DKI5HXRQ.js";
8
8
 
9
9
  // src/transports/http.ts
10
10
  startHttpServer().catch((error) => {
package/dist/index.js CHANGED
@@ -1,15 +1,21 @@
1
1
  import {
2
+ HSTS_HEADER,
2
3
  assertServable,
3
4
  createRequestHandler,
4
5
  readWellKnownFiles,
5
6
  startHttpServer
6
- } from "./chunk-2UU2IMAD.js";
7
+ } from "./chunk-KUJEFQYK.js";
7
8
  import {
8
9
  ConfigError,
9
10
  DETAILS_RULES,
10
11
  DETAILS_SAMPLES,
12
+ HOSTED_DROPPED_STAMPS,
13
+ HOSTED_INTERNAL_ID_PATHS,
14
+ HOSTED_KEPT_TIMES,
15
+ HOSTED_PUBLIC_ID_PATHS,
11
16
  INSTRUCTIONS,
12
17
  InputError,
18
+ KEYLESS_LIMIT_MAX,
13
19
  PLAN_TALK,
14
20
  SERVER_NAME,
15
21
  SERVER_VERSION,
@@ -20,6 +26,9 @@ import {
20
26
  createApiClient,
21
27
  createMcpServer,
22
28
  detailsFor,
29
+ inputSchemaFor,
30
+ instructionsFor,
31
+ isInternalId,
23
32
  isObject,
24
33
  outputSchemaFor,
25
34
  prepareServer,
@@ -34,14 +43,21 @@ import {
34
43
  shapeAnswer,
35
44
  splitInput,
36
45
  textLine,
37
- toListedTool
38
- } from "./chunk-V2BPY65Q.js";
46
+ toListedTool,
47
+ trimHosted
48
+ } from "./chunk-DKI5HXRQ.js";
39
49
  export {
40
50
  ConfigError,
41
51
  DETAILS_RULES,
42
52
  DETAILS_SAMPLES,
53
+ HOSTED_DROPPED_STAMPS,
54
+ HOSTED_INTERNAL_ID_PATHS,
55
+ HOSTED_KEPT_TIMES,
56
+ HOSTED_PUBLIC_ID_PATHS,
57
+ HSTS_HEADER,
43
58
  INSTRUCTIONS,
44
59
  InputError,
60
+ KEYLESS_LIMIT_MAX,
45
61
  PLAN_TALK,
46
62
  SERVER_NAME,
47
63
  SERVER_VERSION,
@@ -54,6 +70,9 @@ export {
54
70
  createMcpServer,
55
71
  createRequestHandler,
56
72
  detailsFor,
73
+ inputSchemaFor,
74
+ instructionsFor,
75
+ isInternalId,
57
76
  isObject,
58
77
  outputSchemaFor,
59
78
  prepareServer,
@@ -70,5 +89,6 @@ export {
70
89
  splitInput,
71
90
  startHttpServer,
72
91
  textLine,
73
- toListedTool
92
+ toListedTool,
93
+ trimHosted
74
94
  };
package/dist/stdio.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  createMcpServer,
6
6
  prepareServer,
7
7
  readConfig
8
- } from "./chunk-V2BPY65Q.js";
8
+ } from "./chunk-DKI5HXRQ.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.2",
3
+ "version": "0.1.3",
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)",