@ai-solutions.ru/mikrotik-mcp-server
Allows management of MikroTik RouterOS devices, including system information, interfaces, IP addresses, firewall rules, DHCP, DNS, routing, VPN (WireGuard and IPsec), configuration backup/export, and dynamic API discovery for exploring the full RouterOS API tree.
Allows management of WireGuard VPN peers on MikroTik routers, including listing peers with traffic statistics and adding new peers.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
@ai-solutions.ru/mikrotik-mcp-server
High-performance TypeScript MCP (Model Context Protocol) server for MikroTik RouterOS management. Connect Claude, GPT-4, or any MCP-compatible AI to your MikroTik router and manage it through natural language.
npx @ai-solutions.ru/mikrotik-mcp-serverð Why This Server?
Feature | This server | jeff-nasseri/mikrotik-mcp | kevinpez (nested fork) |
Language | TypeScript / Node.js | Python | Python |
Dynamic API Discovery | â Browse full RouterOS API tree | â | â |
Structured JSON output ( | â Every tool | â | â |
Zod output schemas | â Typed & validated | â | â |
MCP safety annotations | â
| â | â |
WireGuard VPN management | â list + add peers | â | â |
IPsec peer management | â | â | â |
Configuration backup & export | â binary + script export | â | â |
Raw command execution (escape hatch) | â
| â | â |
Pagination on all list tools | â limit/offset | partial | partial |
Smart output truncation | â auto-hint for large results | â | â |
In-memory caching | â discovery cache | â | â |
MCP SDK version | 1.16+ (latest) | old | old |
Install via npx | â zero config | â pip install | â pip install |
Related MCP server: vyos-mcp
âš Unique Features
1. Dynamic API Discovery (unique in ecosystem)
Browse the entire RouterOS API tree without needing to know command paths in advance. The AI can explore unknown router configurations autonomously.
â mikrotik_discover_endpoints(path: "/ip")
Returns: address, arp, dhcp-client, dhcp-server, dns, firewall, hotspot, ipsec, ...
â mikrotik_get_endpoint_schema(path: "/ip/firewall/filter")
Returns: available commands (print, add, remove, set, enable, disable) and parametersThis means Claude can discover and interact with any RouterOS subsystem â including packages you've installed, containers, advanced routing, hardware-specific features â without the server needing hardcoded knowledge of them.
2. Structured Content + Zod Output Schemas
Every tool returns both human-readable Markdown and machine-readable JSON via structuredContent. The JSON is validated against Zod schemas, giving you typed, predictable data structures that work with MCP clients that support structured output.
// Example: mikrotik_list_ip_addresses returns
{
content: [{ type: "text", text: "# IP Addresses\n..." }], // â Markdown for AI
structuredContent: { // â Typed JSON for clients
total: 5,
addresses: [{ id: "*1", address: "192.168.1.1/24", interface: "bridge", ... }]
}
}3. MCP Safety Annotations
Tools are annotated with MCP 2025 safety hints so AI clients can present appropriate warnings:
readOnlyHint: trueâ safe to call without side effects (list/print operations)destructiveHint: trueâ modifies router state (add/remove/reboot)idempotentHint: trueâ safe to retryopenWorldHint: trueâ queries live state from router
The reboot tool additionally requires confirm: true parameter as an extra safety gate.
4. VPN Management (WireGuard + IPsec)
First MikroTik MCP server with WireGuard peer management:
List all WireGuard peers with traffic stats
Add new WireGuard peers with endpoint and allowed addresses
List IPsec peers with profiles
Graceful handling when WireGuard package isn't installed
5. Raw Command Execution
mikrotik_execute_command provides a full escape hatch to the RouterOS API â execute any RouterOS command with any parameters. This enables AI to handle edge cases, new RouterOS features, or complex operations not covered by specialized tools.
6. Configuration Backup & Export
mikrotik_create_backupâ binary RouterOS backup (survives factory reset)mikrotik_export_configâ human-readable script export with statistics (line count, command count, size)
ð Full Tool Reference
ð¥ System (2 tools)
Tool | Description | Annotations |
| CPU, RAM, storage, uptime, version, board info | readOnly |
| Reboot device (requires | destructive |
ð Interfaces (3 tools)
Tool | Description |
| List all interfaces with type filter + pagination |
| Get detailed info for specific interface |
| Enable/disable, set MTU, comment |
ð IP Addresses (3 tools)
Tool | Description |
| List all IP addresses with interface filter + pagination |
| Add IP address to interface |
| Remove IP address by ID |
ð¥ Firewall (3 tools)
Tool | Description |
| List filter rules with chain filter + pagination |
| Add filter rule with full parameter support |
| Remove rule by ID |
ð¡ DHCP (3 tools)
Tool | Description |
| List leases with status filter + pagination |
| Assign static IP to MAC address |
| List configured DHCP servers |
ð DNS (2 tools)
Tool | Description |
| List static DNS records with pagination |
| Add A/AAAA/CNAME static DNS record |
ðº Routing (3 tools)
Tool | Description |
| List all routes with pagination |
| Add static route with distance and routing table |
| List NAT rules with chain filter + pagination |
ð VPN (3 tools)
Tool | Description |
| List WireGuard peers with traffic stats |
| Add WireGuard peer with endpoint |
| List IPsec peers with profiles |
ðŸ Backup (2 tools)
Tool | Description |
| Create binary system backup |
| Export config as text script with statistics |
â¡ Execute (1 tool)
Tool | Description |
| Execute any RouterOS API command (destructive) |
ð Discovery (2 tools)
Tool | Description |
| Browse RouterOS API tree at any path |
| Get available commands & params for endpoint |
Total: 27 tools + 4 MCP resources
ðŠ MCP Resources
Resource URI | Description |
| Live system info snapshot |
| All interface states |
| Full firewall ruleset |
| All routing table entries |
ð§ Installation & Setup
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"mikrotik": {
"command": "npx",
"args": ["-y", "@ai-solutions.ru/mikrotik-mcp-server"],
"env": {
"MIKROTIK_HOST": "192.168.88.1",
"MIKROTIK_USER": "admin",
"MIKROTIK_PASSWORD": "yourpassword",
"MIKROTIK_PORT": "8728",
"MIKROTIK_SECURE": "false"
}
}
}
}Environment Variables
Variable | Default | Description |
|
| Router IP or hostname |
|
| API username |
| (required) | API password |
|
| RouterOS API port (8729 for TLS) |
|
| Use TLS (requires port 8729) |
|
| Connection timeout in ms |
|
| Discovery cache TTL in seconds |
Enable RouterOS API
In RouterOS WebFig or terminal:
/ip service enable apiFor TLS: /ip service enable api-ssl
ð¬ Example Conversations
"What's the current state of my router?"
Calls
mikrotik_system_infoâ Returns device name, RouterOS version, CPU load, RAM usage, uptime
"Show me all firewall rules that drop traffic"
Calls
mikrotik_list_firewall_rules(chain="forward")â Filters by action=drop
"Add a static DNS record for myserver.local pointing to 10.0.0.50"
Calls
mikrotik_add_dns_record(name="myserver.local", address="10.0.0.50")
"List all WireGuard peers and their traffic stats"
Calls
mikrotik_list_wireguard_peers()â Returns peers with RX/TX bytes
"What API endpoints are available under /container?"
Calls
mikrotik_discover_endpoints(path="/container")â Browses RouterOS container API
"Export the full router config as a backup script"
Calls
mikrotik_export_config()â Returns full RouterOS export with stats
ð Architecture
src/
âââ index.ts # Entry point, env config
âââ server.ts # MCP server + tool/resource registration
âââ constants.ts # Configuration constants
âââ routeros/
â âââ client.ts # RouterOS API client (node-routeros)
âââ cache/
â âââ memory.ts # LRU in-memory cache
âââ discovery/
â âââ service.ts # Dynamic API discovery service
âââ tools/
â âââ system.ts # System info & reboot
â âââ interfaces.ts # Interface management
â âââ ip-address.ts # IP address CRUD
â âââ firewall.ts # Firewall rules
â âââ dhcp.ts # DHCP leases & servers
â âââ dns.ts # Static DNS records
â âââ routing.ts # Routes & NAT
â âââ vpn.ts # WireGuard & IPsec
â âââ backup.ts # Backup & export
â âââ execute.ts # Raw command execution
â âââ discovery.ts # API discovery tools
âââ resources/
â âââ system-info.ts # System resource
â âââ interfaces.ts # Interfaces resource
â âââ firewall.ts # Firewall resource
â âââ routing.ts # Routing resource
âââ utils/
âââ format.ts # Formatting, truncation, pagination
âââ errors.ts # RouterOS error handling
âââ logger.ts # Structured loggingð Security Notes
All write operations carry
destructiveHint: trueannotationReboot requires explicit
confirm: trueparameterCredentials are passed via environment variables (never in code)
TLS support via
MIKROTIK_SECURE=true+ port 8729Consider using a read-only RouterOS API user for monitoring-only setups
ð License
MIT © AI Solutions
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogâŠ
This server cannot be deployed
Maintenance
Related MCP Connectors
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
A TypeScript MCP server for Home Assistant, enabling programmatic management of entities, automatiâŠ
Cloudflare Workers MCP server: ai-model-router
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Related MCP Servers
- AlicenseAqualityAmaintenanceProduction-grade MCP server for MikroTik RouterOS with secure AI-native network automation.133278 npm106MIT
- AlicenseAqualityDmaintenanceMCP server for managing VyOS routers via the VyOS HTTP API, allowing AI assistants to read config, set interfaces, firewall rules, VPNs, and more.172MIT
- AlicenseBqualityCmaintenanceMCP server that enables Claude Code to access, monitor, and manage MikroTik RouterOS devices via its REST API, with 92 tools for read-only and optional write operations.92Apache 2.0
- AlicenseNot gradedqualityDmaintenanceMCP server for VyOS routers via VyManager, enabling AI agents to read and manage router configurations with RBAC, audit, and commit-confirm safety.12GPL 3.0