mikrotik-rest-mcp

v0.1.2
io.github.Sogl/mikrotik-rest-mcp Checked 1 day ago Published 2 months ago

MikroTik RouterOS 7 REST MCP: filtered reads, guarded writes, timed rollback

Values you need

VariableWhat it is
MIKROTIK_BASErequired RouterOS base URL, e.g. https://192.168.88.1
MIKROTIK_USERNAMErequired RouterOS username
MIKROTIK_PASSWORDoptional secret RouterOS password (or use MIKROTIK_PASSWORD_FILE)
MIKROTIK_PASSWORD_FILEoptional Path to file containing the password
MIKROTIK_MODEoptional readonly | careful (default) | yolo

PyPI (uvx) discovery passed

Requires uv (https://docs.astral.sh/uv/)

Run in a terminal
claude mcp add mikrotik-rest-mcp -e 'MIKROTIK_BASE=<MIKROTIK_BASE>' -e 'MIKROTIK_USERNAME=<MIKROTIK_USERNAME>' -- uvx mikrotik-rest-mcp-server==0.1.2
Add to claude_desktop_config.json
{
  "mcpServers": {
    "mikrotik-rest-mcp": {
      "args": [
        "mikrotik-rest-mcp-server==0.1.2"
      ],
      "command": "uvx",
      "env": {
        "MIKROTIK_BASE": "<MIKROTIK_BASE>",
        "MIKROTIK_USERNAME": "<MIKROTIK_USERNAME>"
      }
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "mikrotik-rest-mcp": {
      "args": [
        "mikrotik-rest-mcp-server==0.1.2"
      ],
      "command": "uvx",
      "env": {
        "MIKROTIK_BASE": "<MIKROTIK_BASE>",
        "MIKROTIK_USERNAME": "<MIKROTIK_USERNAME>"
      }
    }
  }
}
Add to .vscode/mcp.json
{
  "inputs": [
    {
      "description": "MIKROTIK_BASE",
      "id": "mikrotik-base",
      "password": true,
      "type": "promptString"
    },
    {
      "description": "MIKROTIK_USERNAME",
      "id": "mikrotik-username",
      "password": true,
      "type": "promptString"
    }
  ],
  "servers": {
    "mikrotik-rest-mcp": {
      "args": [
        "mikrotik-rest-mcp-server==0.1.2"
      ],
      "command": "uvx",
      "env": {
        "MIKROTIK_BASE": "${input:mikrotik-base}",
        "MIKROTIK_USERNAME": "${input:mikrotik-username}"
      },
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.mikrotik-rest-mcp]
command = "uvx"
args = ["mikrotik-rest-mcp-server==0.1.2"]
env = { "MIKROTIK_BASE" = "<MIKROTIK_BASE>", "MIKROTIK_USERNAME" = "<MIKROTIK_USERNAME>" }

For AI agents

  1. Ask the user for: MIKROTIK_BASE, MIKROTIK_USERNAME. Never invent or guess these values; secrets go into the client config, not into chat logs.
  2. Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
  3. Restart or reload the client so it starts the server.
  4. Verify: the server should expose these tools: get_containers, get_dhcp_leases, get_dhcp_servers, get_files, get_firewall_connections, get_filter_rules, get_nat_rules, get_mangle_rules, ….
  5. If it fails, check that the required runtime is installed (uv (https://docs.astral.sh/uv/)) and that the values above are set.

Machine-readable: install.md · manifest.json