MikroTik MCP / Docs / Integrations

Integrations

Four first-class ways to talk to the server: an AI desktop client (Claude Desktop), the Claude Code command line, an interactive testing harness (MCP Inspector), and a REST shim (MCPO) for anything that doesn't speak MCP natively.

Claude Desktop

Native MCP support. Drop a JSON snippet into the config file, restart, and the tools appear in the conversation.

● readystdio · uvx

Claude Code

One claude mcp add command registers the server for the CLI, with credentials from flags, environment variables or an SSH key.

● readystdio · uvx

MCP Inspector

Browser-based tool catalog and ad-hoc invoker. Best way to learn the API without a model in the loop.

● readynpx · UI

MCPO (REST shim)

Exposes every tool as a REST endpoint with OpenAPI docs. Use for ChatGPT actions, n8n, curl scripts.

● readyHTTP · OpenAPI

Claude Desktop

Claude Desktop reads its MCP server list from claude_desktop_config.json — ~/Library/Application Support/Claude/ on macOS, and %APPDATA%\Claude\ on Windows. Add the server, restart, and Claude will discover the tools on its next session.

claude_desktop_config.json
{
  "mcpServers": {
    "mikrotik": {
      "command": "uvx",
      "args": [
        "mcp-server-mikrotik",
        "--host",     "<HOST>",
        "--username", "<USERNAME>",
        "--password", "<PASSWORD>",
        "--port",     "22"
      ]
    }
  }
}
SECURITY
The model never sees your password — only the tool catalog and parameter schemas. That said, the password lives in the config file in plain text. Use a dedicated, scoped RouterOS user rather than admin for day-to-day operation.

Verifying the connection

After restarting Claude Desktop, look for the connector indicator in the prompt box. A first easy test:

Claude Code

Claude Code registers MCP servers with claude mcp add. The server runs over stdio, launched on demand through uvx, so there is nothing to install first beyond uv.

Quick setup

# credentials on the command line
$ claude mcp add --transport stdio mikrotik \
    -- uvx mcp-server-mikrotik \
    --host <HOST> --username <USERNAME> --password <PASSWORD>

Setup with environment variables (recommended)

Keeps credentials out of the command line:

# credentials as environment variables
$ claude mcp add --transport stdio mikrotik \
    --env MIKROTIK_HOST=192.168.88.1 \
    --env MIKROTIK_USERNAME=admin \
    --env MIKROTIK_PASSWORD=your_password \
    -- uvx mcp-server-mikrotik

Setup with an SSH key

Generate a dedicated key, register its public half on the router, then point the server at the private key.

1 · Generate a dedicated key
$ ssh-keygen -t ed25519 -f ~/.ssh/mcp-server-mikrotik -N "" -C "mcp-server-mikrotik"
2 · Copy the public key to the router
# Upload the key file
$ scp ~/.ssh/mcp-server-mikrotik.pub [email protected]:/

# Import it on the router
$ ssh [email protected] "/user ssh-keys import public-key-file=mcp-server-mikrotik.pub user=admin"
3 · Add the server to Claude Code
$ claude mcp add --transport stdio mikrotik \
    -- uvx mcp-server-mikrotik \
    --host 192.168.88.1 --username admin --key-filename ~/.ssh/mcp-server-mikrotik

Verify and manage

Inside Claude Code, run /mcp to check that the server is connected and all tools are listed. The registered server is managed with the usual subcommands:

# manage the server
$ claude mcp list             # list all configured servers
$ claude mcp get mikrotik     # show server details
$ claude mcp remove mikrotik  # remove the server

MCP Inspector

The Inspector is the official debugging tool for MCP servers. It launches a server, connects to it, and gives you a browser UI to browse the tool catalog and invoke them by hand. No LLM involved — pure introspection.

Quick one-liner

# Inspector + server in one shot
$ npx @modelcontextprotocol/inspector \
    uvx mcp-server-mikrotik \
    --host <HOST> \
    --username <USERNAME> \
    --password <PASSWORD> \
    --port 22

Against an mcp-config.json

If you've already prepared a config file (recommended for MCPO too), install the inspector globally and point it at the file:

# Persistent config
$ npm install -g @modelcontextprotocol/inspector
$ cp mcp-config.json.example mcp-config.json
$ nano mcp-config.json   # edit credentials
$ mcp-inspector --config mcp-config.json --server mikrotik-mcp-server

Open the URL it prints. The left pane lists every tool; clicking one opens a form for its arguments and a "Call" button. The response JSON appears beneath. Excellent for learning the schema before you wire a real client.

MCPO — REST API

MCPO ("MCP-to-OpenAPI") wraps any MCP server in a FastAPI shell. Each tool becomes a POST endpoint, and you get auto-generated OpenAPI docs at /docs. Use this for:

PREREQ
Python 3.10+, a MikroTik MCP server already set up, and the uv package manager (recommended) or pip.

Install

# pick one
# Using uvx (no installation needed)
$ uvx mcpo --help

# Or using pip
$ pip install mcpo
$ mcpo --help

Config file

Create mcp-config.json in your project directory. Adjust the connection parameters (host, username, password, port) to match your setup:

mcp-config.json
{
  "mcpServers": {
    "mikrotik-mcp-server": {
      "command": "uvx",
      "args": [
        "mcp-server-mikrotik",
        "--password", "admin",
        "--host",     "192.168.88.1",
        "--port",     "22",
        "--username", "admin"
      ],
      "env": {}
    }
  }
}

Installed mcp-server-mikrotik with pip instead of uv? Launch it as a module in the config:

mcp-config.json — pip / python variant
{
  "mcpServers": {
    "mikrotik-mcp-server": {
      "command": "python",
      "args": [
        "-m", "mcp_mikrotik",
        "--password", "admin",
        "--host",     "192.168.88.1",
        "--port",     "22",
        "--username", "admin"
      ],
      "env": {}
    }
  }
}

Run the server

# With API-key auth (recommended)
# With API key authentication
$ uvx mcpo --port 8000 \
    --api-key "your-secret-key" \
    --config ./mcp-config.json

# Or without auth (not recommended for production)
$ uvx mcpo --port 8000 --config ./mcp-config.json

# Using pip-installed mcpo
$ mcpo --port 8000 \
    --api-key "your-secret-key" \
    --config ./mcp-config.json

You'll see two URLs in the startup log:

SERVE http://0.0.0.0:8000
DOCS http://localhost:8000/docs

Calling a tool

Each tool is exposed at /<server-name>/<tool-name>. POST a JSON body containing the tool's arguments.

# curl — list IP addresses
$ curl -X POST http://localhost:8000/mikrotik-mcp-server/mikrotik_list_ip_addresses \
    -H "Authorization: Bearer your-secret-key" \
    -H "Content-Type: application/json" \
    -d '{}'
POST /mikrotik-mcp-server/mikrotik_list_ip_addresses
POST /mikrotik-mcp-server/mikrotik_create_filter_rule
POST /mikrotik-mcp-server/mikrotik_create_vlan_interface
TIP
The Swagger UI at /docs auto-generates a "Try it out" form for every tool — much faster than handcrafting curl commands when you're exploring.