@helm-protocol/ttt-mcp 0.4.3 → 0.4.4

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 (2) hide show
  1. package/dist/index.js +4 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -105,7 +105,7 @@ function toolSuccess(result) {
105
105
  return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
106
106
  }
107
107
  function buildMcpServer() {
108
- const s = new import_mcp.McpServer({ name: "ttt-mcp", version: "0.4.3" });
108
+ const s = new import_mcp.McpServer({ name: "ttt-mcp", version: "0.4.4" });
109
109
  const registerTool = s.tool.bind(s);
110
110
  registerTool(
111
111
  "pot_generate",
@@ -304,12 +304,13 @@ async function main() {
304
304
  const requestHandler = async (req, res) => {
305
305
  if (req.method === "GET" && (req.url === "/health" || req.url === "/ping")) {
306
306
  res.writeHead(200, { "Content-Type": "application/json" });
307
- res.end(JSON.stringify({ status: "ok", server: "ttt-mcp", version: "0.4.3" }));
307
+ res.end(JSON.stringify({ status: "ok", server: "ttt-mcp", version: "0.4.4" }));
308
308
  return;
309
309
  }
310
310
  if (req.method === "POST") {
311
311
  const apiKey = (0, import_auth.resolveApiKey)(req.headers["x-api-key"]);
312
- const clientIp = req.headers["x-forwarded-for"]?.split(",")[0].trim() || req.socket.remoteAddress || "unknown";
312
+ const trustProxy = process.env.TTTPS_TRUST_PROXY === "1";
313
+ const clientIp = (trustProxy ? req.headers["x-forwarded-for"]?.split(",")[0].trim() : "") || req.socket.remoteAddress || "unknown";
313
314
  const rl = (0, import_auth.checkRateLimit)(apiKey, clientIp);
314
315
  if (!rl.allowed) {
315
316
  res.writeHead(429, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helm-protocol/ttt-mcp",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "Proof-of-Time attestation — Ed25519-signed timestamps with multi-source corroboration and explicit error bounds. IETF draft-helmprotocol-tttps",
5
5
  "main": "dist/index.js",
6
6
  "bin": {