From 600fc1d1e2394be68c2a61cb7c31c41e59869bb3 Mon Sep 17 00:00:00 2001 From: dhedhialy Date: Mon, 20 Jul 2026 20:22:40 -0400 Subject: [PATCH] fix: read MCP server version from package.json instead of hardcoding 0.1.0 (#535) --- ponytail-mcp/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ponytail-mcp/index.js b/ponytail-mcp/index.js index 49783981..e7217572 100644 --- a/ponytail-mcp/index.js +++ b/ponytail-mcp/index.js @@ -3,13 +3,15 @@ // prompt (user-invoked) and a tool (for hosts that pull context via tools). // It does NOT replace the always-on adapters; it's the clean option for hosts // whose only injection point is the prompt menu (see #70). +import { readFileSync } from "node:fs"; import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { z } from "zod"; import { MODES, buildInstructions, resolveMode } from "./instructions.js"; -const server = new McpServer({ name: "ponytail", version: "0.1.0" }); +const { version } = JSON.parse(readFileSync(new URL("./package.json", import.meta.url), "utf8")); +const server = new McpServer({ name: "ponytail", version }); const modeArg = z .enum(MODES)