it-tools-mcp 3.0.4 → 3.0.5

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/build/index.js +12 -2
  2. package/package.json +1 -1
package/build/index.js CHANGED
@@ -2,6 +2,8 @@
2
2
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
3
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
4
  import { getResourceUsage } from "./security.js";
5
+ import fs from 'fs';
6
+ import path from 'path';
5
7
  // Import tool modules
6
8
  import { registerEncodingTools } from "./tools/encoding.js";
7
9
  import { registerCryptoTools } from "./tools/crypto.js";
@@ -13,10 +15,18 @@ import { registerMathTools } from "./tools/math.js";
13
15
  import { registerUtilityTools } from "./tools/utility.js";
14
16
  import { registerDevelopmentTools } from "./tools/development.js";
15
17
  import { registerColorTools } from "./tools/color.js";
18
+ // Helper to read version from package.json at runtime (ESM compatible)
19
+ function getPackageVersion() {
20
+ // Use import.meta.url to get the directory in ESM
21
+ const __dirname = path.dirname(new URL(import.meta.url).pathname);
22
+ const pkgPath = path.resolve(__dirname, '../package.json');
23
+ const pkgRaw = fs.readFileSync(pkgPath, 'utf-8');
24
+ return JSON.parse(pkgRaw).version;
25
+ }
16
26
  // Create server instance
17
27
  const server = new McpServer({
18
28
  name: "it-tools-mcp",
19
- version: "3.0.0",
29
+ version: getPackageVersion(),
20
30
  capabilities: {
21
31
  resources: {},
22
32
  tools: {},
@@ -42,7 +52,7 @@ server.tool("system-info", "Get system resource usage and server information", {
42
52
  type: "text",
43
53
  text: JSON.stringify({
44
54
  server: "IT Tools MCP Server",
45
- version: "3.0.0",
55
+ version: getPackageVersion(),
46
56
  uptime: `${Math.floor(usage.uptimeSeconds)} seconds`,
47
57
  memory: usage.memory,
48
58
  timestamp: new Date().toISOString(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "it-tools-mcp",
3
- "version": "3.0.4",
3
+ "version": "3.0.5",
4
4
  "description": "MCP server providing access to various IT tools and utilities for developers",
5
5
  "type": "module",
6
6
  "main": "./build/index.js",