Skip to content

Commit

Permalink
read package version from package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
g0t4 committed Dec 11, 2024
1 parent 00cc9f1 commit 163e66b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ import { ObjectEncodingOptions } from "node:fs";
import { promisify } from "node:util";
import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
import { execFileWithInput, ExecResult } from "./exec-utils.js";
//import os from "os";

import { createRequire } from "module";
const require = createRequire(import.meta.url);
const pkg = require("../package.json");

// TODO use .promises? in node api
const execAsync = promisify(exec);
Expand All @@ -28,8 +31,8 @@ if (process.argv.includes("--verbose")) {

const server = new Server(
{
name: "mcp-server-commands",
version: "0.4.0",
name: pkg.name,
version: pkg.version,
//description: "Run commands on this " + os.platform() + " machine",
},
{
Expand Down

0 comments on commit 163e66b

Please sign in to comment.