MikroTik RouterOS API
A read-only MCP server implementation for interacting with MikroTik routers using the RouterOS API.Features
- Connection Management: Connect and authenticate with MikroTik routers
- Resource Monitoring: Dynamic access to interfaces, bridges, and routing tables via MCP resources
- Protocol Support: Works with both plain TCP (8728) and secure SSL/TLS (8729)
- Modern & Legacy Login: Supports RouterOS versions prior to and after v6.43
Tools
mk-connect
Connects to a MikroTik router and authenticates.IP address of the MikroTik router
Username for authentication
Password for authentication
Use SSL/TLS connection (port 8729 instead of 8728)
mk-report
Generates a comprehensive system report for the connected router.No parameters required. Must be connected to a router first using
mk-connect.- System resources (CPU, memory, uptime)
- RouterBoard health information
- Interface traffic statistics (using
monitor-trafficonce) - System configuration summary
mk-get
Returns a JSON array with the result of a MikroTik API/print command.
The API path to query (e.g.,
/ip/route, /interface, /log)The server automatically ensures the path starts with
/ and ends with /print./interface- Network interfaces/ip/address- IP addresses/ip/route- Routing table/ip/route/rule- Routing rules/ip/firewall/address-list- Firewall address lists/ip/firewall/filter- Firewall filter rules/ip/firewall/nat- NAT rules/ip/firewall/mangle- Mangle rules/log- System logs
mk-awr
Generates an Automatic Workload Repository (AWR) style report for MikroTik routers.No parameters required. Must be connected to a router first using
mk-connect.- Performance metrics and statistics
- Security audit findings
- Configuration analysis
- Optimization recommendations
- Unused entity detection
Resources
MikroTik entities are exposed as MCP resources for direct inspection:Interfaces
URI Format:mikrotik://interface/{name}
Access detailed information about a specific network interface.
Example:
Bridges
URI Format:mikrotik://bridge/{name}
Access bridge configuration and status.
Example:
Bridge Ports
URI Format:mikrotik://bridge/{bridge_name}/{interface_name}
Access information about an interface that is part of a bridge.
Example:
IP Routes
URI Format:mikrotik://route/{id}
Access routing table entries by their internal ID.
Internal IDs are used for routing entries. Use
mk-get /ip/route to discover route IDs.Configuration
Environment Variables
MikroTik username (required if providing host at startup)
MikroTik password (required if providing host at startup)
Startup Arguments
host(optional): IP address of the routersecure(optional): Use SSL/TLS (default:false)
MK_USER and MK_PASSWORD environment variables.
Usage with Claude Desktop
NPX Installation:Arguments and environment variables are optional. You can connect later using
mk-connect.Use Cases
Security Audit
Usemk-get to retrieve configuration data and analyze it for security risks:
Network Monitoring
Monitor router health and performance:Performance Analysis
Generate an AWR-style report for detailed performance insights:- High CPU/memory usage patterns
- Inefficient firewall rules
- Routing inefficiencies
- Security vulnerabilities
- Unused configuration entities