fix: add mcpName and read version dynamically from package.json

This commit is contained in:
Giancarlo Erra
2026-03-04 18:06:36 +00:00
parent 766b13a9c0
commit 88c0e8fee3
4 changed files with 13 additions and 3 deletions
+1
View File
@@ -1,5 +1,6 @@
{
"name": "socraticode",
"mcpName": "io.github.giancarloerra/socraticode",
"version": "1.0.0",
"description": "SocratiCode — MCP server for local codebase indexing, semantic search, and code dependency graphs. All private, all local via Docker.",
"type": "module",
+8
View File
@@ -1,5 +1,13 @@
// SPDX-License-Identifier: AGPL-3.0-only
// Copyright (C) 2026 Giancarlo Erra - Altaire Limited
import { createRequire } from "node:module";
// ── Package metadata ─────────────────────────────────────────────────────
const esmRequire = createRequire(import.meta.url);
const pkg = esmRequire("../package.json") as { version: string };
export const SOCRATICODE_VERSION: string = pkg.version;
// ── Embedding configuration ──────────────────────────────────────────────
// Embedding model and dimensions are now configured via environment variables.
// See src/services/embedding-config.ts for OLLAMA_MODE, OLLAMA_URL,
+2 -1
View File
@@ -5,6 +5,7 @@
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
import { SOCRATICODE_VERSION } from "./constants.js";
import { logger, setMcpLogSender } from "./services/logger.js";
import { autoResumeIndexedProjects, gracefulShutdown } from "./services/startup.js";
import { handleContextTool } from "./tools/context-tools.js";
@@ -16,7 +17,7 @@ import { handleQueryTool } from "./tools/query-tools.js";
const server = new McpServer(
{
name: "socraticode",
version: "1.0.0",
version: SOCRATICODE_VERSION,
},
{
capabilities: {
+2 -2
View File
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: AGPL-3.0-only
// Copyright (C) 2026 Giancarlo Erra - Altaire Limited
import { QDRANT_HOST, QDRANT_MODE, QDRANT_PORT, QDRANT_URL } from "../constants.js";
import { QDRANT_HOST, QDRANT_MODE, QDRANT_PORT, QDRANT_URL, SOCRATICODE_VERSION } from "../constants.js";
import { getArtifactStatusSummary } from "../services/context-artifacts.js";
import { isDockerAvailable, isQdrantImagePresent, isQdrantRunning } from "../services/docker.js";
import { getEmbeddingConfig } from "../services/embedding-config.js";
@@ -235,7 +235,7 @@ export async function handleManageTool(
"3. codebase_graph_query to explore dependencies.",
"4. codebase_context_search for schemas, API specs, configs.",
"",
"v1.0.0 · © 2026 Giancarlo Erra — Altaire Limited · AGPL-3.0",
`v${SOCRATICODE_VERSION} · © 2026 Giancarlo Erra — Altaire Limited · AGPL-3.0`,
"https://github.com/giancarloerra/socraticode",
].join("\n");
}