MikroTik MCP

by vesact

Not rated
GitHub

About

MCP server for MikroTik RouterOS fleet management — REST-first, KeePass-backed credentials, read-only mode

Details

Author
vesact
Categories
Developer Tools

Setup

Install MikroTik MCP in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/vesact/mikrotik-mcp

Follow the installation instructions in the repository README, then restart your MCP client.

AnMCP(Model Context Protocol) server for managing fleets ofMikroTik RouterOSdevices from AI assistants such as Claude.

It exposes65 toolscovering system administration, interfaces, bridging, IP, firewall, DHCP/DNS, PPP, monitoring, and diagnostics — all executed over the RouterOSREST API, with SSH reserved for free-formros-commandexecution. Device credentials are never passed through the model: they are resolved from aKeePass vaultat runtime.

- Fleet-aware by design— every tool accepts atargetof a single device ID, a comma-separated list (R1,R2,R3), orall. Commands fan out in parallel and return per-device results; one unreachable device never fails the batch.
- REST-first transport— structured JSON from the RouterOS REST API (RouterOS v7.1+), no brittle terminal scraping. SSH is used only for theros-commandescape hatch.
- KeePass-backed credentials— devices are enumerated from a.kdbxvault group. The LLM only ever sees device IDs, never passwords.
- Enforced read-only modeREAD_ONLY=truewithholds all 14 write/execution and active-diagnostic tools at the protocol level, exposing only the 51 state-query tools. Ideal for monitoring-only agent access. Approval of individual write calls is left to the MCP client, which is where it can actually be enforced (see
Write operations and approval).
- Two MCP transportsstdiofor local clients (Claude Desktop, Claude Code) and Streamable HTTP (with legacy SSE fallback) for a shared team server.

Create a KeePass vault (e.g.config/vault.kdbx) with one entry per device inside a group (default:mikrotik):

- Title→ device ID (how you'll refer to the device in prompts)
- Username / Password→ RouterOS credentials
- URL→ device hostname or IP

docker run -d -p 8000:8000 \ -v ./config:/config:ro \ -e KEEPASS_PASSWORD='…' \ ghcr.io/vesact/mikrotik-mcp:latest # serves MCP on http://localhost:8000/mcp
cp .env.example .env # set KEEPASS_PASSWORD at minimum docker compose up -d

3. Or run locally over stdio (Claude Desktop / Claude Code)

{ "mcpServers": { "mikrotik": { "command": "node", "args": ["/path/to/mikrotik-mcp/dist/index.js"], "env": { "KEEPASS_PATH": "/path/to/vault.kdbx", "KEEPASS_PASSWORD": "…" } } } }

"What's the RouterOS version across the whole fleet?" "Show DHCP leases on router-01." "Add a firewall filter on R1,R2."

All configuration is via environment variables (see.env.example):

WithREAD_ONLY=true(also accepts1/yes/on), the server exposes only the 51 read-only tools.ros-command,setup-new-device, and all active diagnostics (ping, traceroute, torch, bandwidth test, scans, …) are withheld — they mutate state or generate network traffic. The allow-list is explicit, so tools added in the future are withheld until deliberately classified.

The server does not implement its own confirmation step for writes. Write tools execute on the first call, andros-commandin particular runs whatever it is given, verbatim, on every device matched bytarget.

Approving individual calls is the MCP client's job — it is the layer that can actually enforce a decision and scope it per agent:

- Claude Code— permission modes plusallow/ask/denyrules, e.g."deny": ["mcp__mikrotik__ros-command"]or anaskrule for the whole server, in.claude/settings.json.
- Claude Desktopand other hosts — per-tool approval prompts, kept enabled for this server.

ros-commandcarries MCPannotations(readOnlyHint: false,destructiveHint: true) so clients can classify it without parsing its description.

Two server-side controls remain, because they are enforcement rather than instruction:

- READ_ONLY=true— the tools are never registered, so no client configuration can invoke them.
- The RouterOS credentials in the vault — a device account with restricted permissions bounds what any approved command can do.

- Node.js ≥ 22 (or Docker)
- RouterOS v7.1+ with the REST API enabled (www-sslorwwwservice) on managed devices
- SSH enabled on devices only if you useros-commandorsetup-new-device

npm ci npm run build # TypeScript → dist/ npm test # unit tests (Vitest, no hardware needed) npm run check # lint + format check (Biome) npm run check:fix # apply Biome's fixes and formatting npm run test:integration # integration tests against real hardware (see .env.test.example)

Unit tests run against fixtures, including a committed test vault (tests/fixtures/test-vault.kdbx, passwordtest-password-123— fake credentials only). Integration tests require a reachable RouterOS device and are configured via.env.test.

MCP client (Claude, …) │ stdio / Streamable HTTP ▼ mikrotik-mcp server ──► KeePass vault (device inventory + credentials) │ │ fan-out: target = "R1" | "R1,R2" | "all" (parallel, per-device results) ▼ RouterOS REST API (all tools) / SSH (ros-command only)

The full architecture document lives indocs/architecture.md, and the original product requirements indocs/prd.md.

SeeCONTRIBUTING.md. Security issues: seeSECURITY.md.

Copyright 2026Actemium Schweiz AG— aVINCI Energiescompany.

MikroTik and RouterOS are trademarks of Mikrotīkls SIA. This project is not affiliated with or endorsed by MikroTik.

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

Create crafted UI components inspired by the best 21st.dev design engineers.

Bring agent evaluations, observability, and synthetic test set generation directly into your IDE for free with Galileo's new MCP server

An MCP server to help AI assistants to answer questions and generate AccelByte Extend SDK code more effectively .

MCP server for AI Diagram Maker — generate beautiful software engineering diagrams directly inside Cursor, Claude Desktop, Claude Code, or any MCP-compatible AI agent

ALAPI MCP Tools,Call hundreds of API interfaces via MCP

AI-powered SVG animation generator that transforms static files into animated SVG components using the Allyson platform

MCP server that gives AI assistants on-demand access to 1,500+ amCharts docs, ~300 code examples, and 1000+ class API references.

APIMatic MCP Server is used to validate OpenAPI specifications using APIMatic. The server processes OpenAPI files and returns validation summaries by leveraging APIMatic’s API.

One shared context layer for AI agents and humans — live API specs, DB schemas, and versioned contracts across repos so every agent and teammate works from the same source of truth.

Build and deploy full-stack Next.js apps with 98 tools for React, AWS, and MongoDB

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.