mikromcp 1.0.4 → 1.0.6

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 (3) hide show
  1. package/README.md +1 -1
  2. package/dist/main.js +29 -24
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
  [![CI](https://github.com/AliKarami/MikroMCP/actions/workflows/ci.yml/badge.svg)](https://github.com/AliKarami/MikroMCP/actions/workflows/ci.yml)
14
14
  [![Release](https://github.com/AliKarami/MikroMCP/actions/workflows/release.yml/badge.svg)](https://github.com/AliKarami/MikroMCP/actions/workflows/release.yml)
15
- [![Version](https://img.shields.io/badge/version-v1.0.4-EA580C)](package.json)
15
+ [![Version](https://img.shields.io/badge/version-v1.0.6-EA580C)](package.json)
16
16
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
17
17
  [![Node.js >= 22](https://img.shields.io/badge/node-%3E%3D22-339933)](package.json)
18
18
  [![RouterOS 7.x](https://img.shields.io/badge/RouterOS-7.x-293239)](https://help.mikrotik.com/docs/display/ROS/REST+API)
package/dist/main.js CHANGED
@@ -7,6 +7,7 @@ import { homedir as homedir5 } from "os";
7
7
 
8
8
  // src/cli/index.ts
9
9
  import { Command } from "commander";
10
+ import { spawnSync } from "child_process";
10
11
 
11
12
  // src/config/app-config.ts
12
13
  import { join } from "path";
@@ -8613,7 +8614,7 @@ function createServerFactory(config, identityRegistry) {
8613
8614
  const makeServer = () => {
8614
8615
  const server = new McpServer({
8615
8616
  name: "mikromcp",
8616
- version: "1.0.4"
8617
+ version: "1.0.6"
8617
8618
  });
8618
8619
  registerAllTools(server, registry, pool, circuitBreakers, config, identityRegistry);
8619
8620
  return server;
@@ -8936,7 +8937,7 @@ import { existsSync as existsSync3, readFileSync as readFileSync6 } from "fs";
8936
8937
  import { homedir as homedir3 } from "os";
8937
8938
  import * as net from "net";
8938
8939
  import chalk from "chalk";
8939
- var localVersion = "1.0.4";
8940
+ var localVersion = "1.0.6";
8940
8941
  var results = [];
8941
8942
  function ok(msg) {
8942
8943
  console.log(chalk.green("\u2705 ") + msg);
@@ -9463,14 +9464,8 @@ function writeDotEnv(data) {
9463
9464
  "# \u2500\u2500 RBAC (optional, for stdio with identity enforcement) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500",
9464
9465
  "# MIKROMCP_STDIO_IDENTITY="
9465
9466
  ];
9466
- const content = lines.join("\n") + "\n";
9467
9467
  mkdirSync3(data.configDir, { recursive: true });
9468
- if (existsSync4(data.envPath)) {
9469
- const existing = readFileSync7(data.envPath, "utf-8");
9470
- writeFileSync2(data.envPath, existing.endsWith("\n") ? existing + "\n" + content : existing + "\n\n" + content);
9471
- } else {
9472
- writeFileSync2(data.envPath, content);
9473
- }
9468
+ writeFileSync2(data.envPath, lines.join("\n") + "\n");
9474
9469
  }
9475
9470
  function registerClaudeDesktop() {
9476
9471
  const configPath = findClaudeDesktopConfig();
@@ -9504,21 +9499,28 @@ function registerClaudeDesktop() {
9504
9499
  }
9505
9500
  async function runInit() {
9506
9501
  console.log(chalk2.bold.cyan("\n\u{1F527} MikroMCP \u2014 Interactive Setup Wizard\n"));
9507
- const routerInfo = await collectRouterInfo();
9508
- const identityInfo = await collectIdentityInfo();
9509
9502
  const configDir = mikromcpDir2();
9510
9503
  const envPath = join4(configDir, ".env");
9511
- const transport2 = await collectTransport();
9512
- const writeEnv = await collectEnvPreference();
9513
- let writeRouters = true;
9514
- const routersYamlPath = join4(configDir, "routers.yaml");
9515
- if (existsSync4(routersYamlPath)) {
9516
- console.log(chalk2.bold("\n\u2500\u2500 Config files \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
9517
- writeRouters = await confirm({
9518
- message: "routers.yaml already exists. Add this router to it?",
9504
+ const existingFiles = [".env", "routers.yaml", "identities.yaml"].filter(
9505
+ (f) => existsSync4(join4(configDir, f))
9506
+ );
9507
+ if (existingFiles.length > 0) {
9508
+ console.log(chalk2.yellow(` \u26A0 Found existing files in ${configDir}:`));
9509
+ for (const f of existingFiles) console.log(chalk2.yellow(` ${f}`));
9510
+ console.log();
9511
+ const proceed = await confirm({
9512
+ message: "Continue? (existing files will be overwritten or merged)",
9519
9513
  default: true
9520
9514
  });
9515
+ if (!proceed) {
9516
+ console.log(chalk2.dim(" Aborted."));
9517
+ return;
9518
+ }
9521
9519
  }
9520
+ const routerInfo = await collectRouterInfo();
9521
+ const identityInfo = await collectIdentityInfo();
9522
+ const transport2 = await collectTransport();
9523
+ const writeEnv = await collectEnvPreference();
9522
9524
  const registerDesktop = await collectClaudeDesktopPreference();
9523
9525
  const data = {
9524
9526
  ...routerInfo,
@@ -9527,7 +9529,7 @@ async function runInit() {
9527
9529
  envPath,
9528
9530
  configDir,
9529
9531
  writeEnv,
9530
- writeRoutersYaml: writeRouters,
9532
+ writeRoutersYaml: true,
9531
9533
  writeIdentitiesYaml: identityInfo.createIdentity,
9532
9534
  registerClaudeDesktop: registerDesktop
9533
9535
  };
@@ -9567,17 +9569,20 @@ async function runInit() {
9567
9569
  );
9568
9570
  }
9569
9571
  console.log(chalk2.bold("\nNext steps:"));
9570
- console.log(chalk2.dim(` 1. Fill in router credentials in ${data.envPath}`));
9571
- console.log(chalk2.dim(" 2. Run: mikromcp doctor"));
9572
- console.log(chalk2.dim(" 3. Restart Claude Desktop to load the MCP server"));
9572
+ console.log(chalk2.dim(" 1. Run: mikromcp doctor"));
9573
+ console.log(chalk2.dim(" 2. Restart Claude Desktop to load the MCP server"));
9573
9574
  console.log();
9574
9575
  }
9575
9576
 
9576
9577
  // src/cli/index.ts
9577
- var program = new Command().name("mikromcp").description("MikroTik RouterOS MCP server").version("1.0.4");
9578
+ var program = new Command().name("mikromcp").description("MikroTik RouterOS MCP server").version("1.0.6");
9578
9579
  program.command("serve", { isDefault: true }).description("Start the MCP server (default)").action(runServe);
9579
9580
  program.command("doctor").description("Check config, connectivity, and permissions").action(runDoctor);
9580
9581
  program.command("init").description("Interactive setup wizard").action(runInit);
9582
+ program.command("update").description("Update mikromcp to the latest version via npm").action(() => {
9583
+ const result = spawnSync("npm", ["update", "-g", "mikromcp"], { stdio: "inherit" });
9584
+ if (result.status !== 0) process.exit(result.status ?? 1);
9585
+ });
9581
9586
 
9582
9587
  // src/main.ts
9583
9588
  loadDotenv({ path: join5(homedir5(), ".mikromcp", ".env"), override: false });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mikromcp",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Production-grade MCP server for MikroTik RouterOS",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",