@systemdox/mcp-server 0.1.27 → 0.1.29

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/dist/cli.js CHANGED
@@ -19,13 +19,12 @@ function requireHttpsApiUrl(apiUrl) {
19
19
  `SYSTEMDOX_API_URL is not a valid URL: ${apiUrl}`
20
20
  );
21
21
  }
22
- if (parsed.protocol === "https:") return apiUrl;
23
- if (parsed.protocol === "http:" && LOOPBACK_HOSTS.has(parsed.hostname)) {
24
- return apiUrl;
22
+ if (parsed.protocol !== "https:") {
23
+ throw new Error(
24
+ `SYSTEMDOX_API_URL must use https:// \u2014 refusing to send the API key over ${parsed.protocol}// in cleartext. Got: ${apiUrl}`
25
+ );
25
26
  }
26
- throw new Error(
27
- `SYSTEMDOX_API_URL must use https:// \u2014 refusing to send the API key over ${parsed.protocol}// in cleartext. Got: ${apiUrl}`
28
- );
27
+ return apiUrl;
29
28
  }
30
29
  function loadConfig() {
31
30
  const apiKey = process.env.SYSTEMDOX_API_KEY;
@@ -44,12 +43,11 @@ function loadConfig() {
44
43
  defaultOrg: process.env.SYSTEMDOX_DEFAULT_ORG
45
44
  };
46
45
  }
47
- var API_URL_DEFAULT, LOOPBACK_HOSTS;
46
+ var API_URL_DEFAULT;
48
47
  var init_config = __esm({
49
48
  "src/lib/config.ts"() {
50
49
  "use strict";
51
50
  API_URL_DEFAULT = "https://api.puglieseweb.com/systemdox";
52
- LOOPBACK_HOSTS = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "[::1]", "::1"]);
53
51
  }
54
52
  });
55
53
 
@@ -2002,7 +2000,7 @@ var init_server = __esm({
2002
2000
  init_create_project_rule();
2003
2001
  init_get_prompt_templates();
2004
2002
  init_create_prompt_template();
2005
- SERVER_VERSION = true ? "0.1.27" : "0.0.0-dev";
2003
+ SERVER_VERSION = true ? "0.1.29" : "0.0.0-dev";
2006
2004
  }
2007
2005
  });
2008
2006
 
package/dist/http.js CHANGED
@@ -117,6 +117,25 @@ var SystemDoxApiClient = class {
117
117
  }
118
118
  };
119
119
 
120
+ // src/lib/config.ts
121
+ var API_URL_DEFAULT = "https://api.puglieseweb.com/systemdox";
122
+ function requireHttpsApiUrl(apiUrl) {
123
+ let parsed;
124
+ try {
125
+ parsed = new URL(apiUrl);
126
+ } catch {
127
+ throw new Error(
128
+ `SYSTEMDOX_API_URL is not a valid URL: ${apiUrl}`
129
+ );
130
+ }
131
+ if (parsed.protocol !== "https:") {
132
+ throw new Error(
133
+ `SYSTEMDOX_API_URL must use https:// \u2014 refusing to send the API key over ${parsed.protocol}// in cleartext. Got: ${apiUrl}`
134
+ );
135
+ }
136
+ return apiUrl;
137
+ }
138
+
120
139
  // src/lib/metrics.ts
121
140
  var NAMESPACE = "SystemDox/Mcp";
122
141
  var METRIC_NAME = "McpToolCall";
@@ -1825,7 +1844,7 @@ function registerCreatePromptTemplate(server, apiClient) {
1825
1844
  }
1826
1845
 
1827
1846
  // src/server.ts
1828
- var SERVER_VERSION = true ? "0.1.27" : "0.0.0-dev";
1847
+ var SERVER_VERSION = true ? "0.1.29" : "0.0.0-dev";
1829
1848
  function createServer(apiClient) {
1830
1849
  const server = new McpServer({
1831
1850
  name: "systemdox-mcp-server",
@@ -1896,9 +1915,16 @@ async function handler(event) {
1896
1915
  }
1897
1916
  const rawBody = event.isBase64Encoded ? Buffer.from(event.body ?? "", "base64").toString("utf8") : event.body ?? "";
1898
1917
  emitMcpToolCalls(keyTenant, rawBody);
1918
+ let apiUrl;
1919
+ try {
1920
+ apiUrl = requireHttpsApiUrl(process.env.SYSTEMDOX_API_URL ?? API_URL_DEFAULT);
1921
+ } catch (err) {
1922
+ console.error("Refusing to proxy MCP tool calls:", err);
1923
+ return jsonError(500, "Server misconfigured: API URL must use https://");
1924
+ }
1899
1925
  const apiClient = new SystemDoxApiClient({
1900
1926
  apiKey,
1901
- apiUrl: process.env.SYSTEMDOX_API_URL ?? "https://api.puglieseweb.com/systemdox",
1927
+ apiUrl,
1902
1928
  cacheTtlMs: 0,
1903
1929
  // per-request client; never cache across invocations
1904
1930
  defaultOrg: void 0
package/dist/index.js CHANGED
@@ -5,7 +5,6 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
5
5
 
6
6
  // src/lib/config.ts
7
7
  var API_URL_DEFAULT = "https://api.puglieseweb.com/systemdox";
8
- var LOOPBACK_HOSTS = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "[::1]", "::1"]);
9
8
  function requireHttpsApiUrl(apiUrl) {
10
9
  let parsed;
11
10
  try {
@@ -15,13 +14,12 @@ function requireHttpsApiUrl(apiUrl) {
15
14
  `SYSTEMDOX_API_URL is not a valid URL: ${apiUrl}`
16
15
  );
17
16
  }
18
- if (parsed.protocol === "https:") return apiUrl;
19
- if (parsed.protocol === "http:" && LOOPBACK_HOSTS.has(parsed.hostname)) {
20
- return apiUrl;
17
+ if (parsed.protocol !== "https:") {
18
+ throw new Error(
19
+ `SYSTEMDOX_API_URL must use https:// \u2014 refusing to send the API key over ${parsed.protocol}// in cleartext. Got: ${apiUrl}`
20
+ );
21
21
  }
22
- throw new Error(
23
- `SYSTEMDOX_API_URL must use https:// \u2014 refusing to send the API key over ${parsed.protocol}// in cleartext. Got: ${apiUrl}`
24
- );
22
+ return apiUrl;
25
23
  }
26
24
  function loadConfig() {
27
25
  const apiKey = process.env.SYSTEMDOX_API_KEY;
@@ -1828,7 +1826,7 @@ function registerCreatePromptTemplate(server2, apiClient2) {
1828
1826
  }
1829
1827
 
1830
1828
  // src/server.ts
1831
- var SERVER_VERSION = true ? "0.1.27" : "0.0.0-dev";
1829
+ var SERVER_VERSION = true ? "0.1.29" : "0.0.0-dev";
1832
1830
  function createServer(apiClient2) {
1833
1831
  const server2 = new McpServer({
1834
1832
  name: "systemdox-mcp-server",
@@ -10,9 +10,12 @@ export declare const API_URL_DEFAULT = "https://api.puglieseweb.com/systemdox";
10
10
  * the Authorization header on every request, so an http:// URL would leak it in
11
11
  * cleartext. Reject rather than downgrade. Returns the URL unchanged when valid.
12
12
  *
13
- * http://localhost is allowed: see LOOPBACK_HOSTS. Local development and the
14
- * MCP release gate (scripts/mcp-release-gate.mjs, which boots the published
15
- * server against an http stub on 127.0.0.1) both depend on it.
13
+ * The pin has NO exceptions, loopback included. A carve-out was tried and
14
+ * removed: it existed only because the release gate stood up a plain-http stub,
15
+ * and #1044 gave that stub TLS, so nothing in CI needs it. Local development
16
+ * against a local API should point at an https origin — the gate's per-run
17
+ * self-signed cert is a worked example. An exception in the shipped product to
18
+ * spare a dev a certificate is not a trade worth making.
16
19
  */
17
20
  export declare function requireHttpsApiUrl(apiUrl: string): string;
18
21
  export declare function loadConfig(): ServerConfig;
@@ -2,7 +2,6 @@
2
2
 
3
3
  // src/lib/config.ts
4
4
  var API_URL_DEFAULT = "https://api.puglieseweb.com/systemdox";
5
- var LOOPBACK_HOSTS = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "[::1]", "::1"]);
6
5
  function requireHttpsApiUrl(apiUrl) {
7
6
  let parsed;
8
7
  try {
@@ -12,13 +11,12 @@ function requireHttpsApiUrl(apiUrl) {
12
11
  `SYSTEMDOX_API_URL is not a valid URL: ${apiUrl}`
13
12
  );
14
13
  }
15
- if (parsed.protocol === "https:") return apiUrl;
16
- if (parsed.protocol === "http:" && LOOPBACK_HOSTS.has(parsed.hostname)) {
17
- return apiUrl;
14
+ if (parsed.protocol !== "https:") {
15
+ throw new Error(
16
+ `SYSTEMDOX_API_URL must use https:// \u2014 refusing to send the API key over ${parsed.protocol}// in cleartext. Got: ${apiUrl}`
17
+ );
18
18
  }
19
- throw new Error(
20
- `SYSTEMDOX_API_URL must use https:// \u2014 refusing to send the API key over ${parsed.protocol}// in cleartext. Got: ${apiUrl}`
21
- );
19
+ return apiUrl;
22
20
  }
23
21
  function loadConfig() {
24
22
  const apiKey = process.env.SYSTEMDOX_API_KEY;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@systemdox/mcp-server",
3
- "version": "0.1.27",
3
+ "version": "0.1.29",
4
4
  "mcpName": "io.github.puglieseweb/systemdox",
5
5
  "type": "module",
6
6
  "description": "Give AI coding agents your architecture context over MCP — checks, specs, ADRs, project rules, and docs from SystemDox, delivered at write time",