- Home
- MCP servers
- MikroTik
MikroTik
- python
1
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"tarcisiodier-mcp-mikrotik": {
"command": "mcp-server-mikrotik",
"args": []
}
}
}You can extend your AI assistant with a MikroTik MCP Server that acts as a bridge to RouterOS devices. It lets you manage VLANs, IP addresses, DHCP, NAT, firewall rules, DNS, users, wireless settings, and more through natural requests, automating network provisioning and maintenance. This guide walks you through practical usage, installation, configuration, and example workflows to get you up and running quickly.
How to use
Connect your MCP client to the MikroTik MCP Server you run on your network. Use the available tools to perform common network tasks such as creating VLAN interfaces, configuring IP addresses, setting up DHCP, managing NAT rules, and handling firewall settings. You can script frequent operations, chain multiple steps into a workflow, and monitor changes in real time.
How to install
# Prerequisites
# - Python 3.8+
# - MikroTik RouterOS device with API access enabled
# - Python dependencies (routeros-api or similar)
# Clone the server repository
git clone https://github.com/jeff-nasseri/mikrotik-mcp/tree/master
cd mcp-mikrotik
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
pip install -e .
# Run the server
mcp-server-mikrotik
Configuration and usage notes
You can configure the server integration with your Claude Desktop setup to connect to the MCP Server and expose the MikroTik controls through a REST-like API exposed by the MCP layer. The example configuration shows how to point the Claude-based client to the local MCP server gateway.
{
"mcpServers": {
"mikrotik": {
"command": "uvx",
"args": ["mcp-server-mikrotik", "--host", "<HOST>", "--username", "<USERNAME>", "--password", "<PASSWORD>", "--port", "22"]
}
}
}
Usage Examples with mcp-cli
The following examples demonstrate how to run common tasks via the mcp-cli integration. Each example targets the MikroTik MCP Server named mikrotik and invokes a specific tool with the required arguments.
# VLAN operations
uv run mcp-cli cmd --server mikrotik --tool mikrotik_create_vlan_interface --tool-args '{"name": "vlan100", "vlan_id": 100, "interface": "ether1", "comment": "Production VLAN"}'
```bash
# Add IP address to an interface
uv run mcp-cli cmd --server mikrotik --tool mikrotik_add_ip_address --tool-args '{"address": "192.168.100.1/24", "interface": "vlan100", "comment": "Gateway address"}'
# Create DHCP server and related network
uv run mcp-cli cmd --server mikrotik --tool mikrotik_create_dhcp_pool --tool-args '{"name": "pool-100", "ranges": "192.168.100.10-192.168.100.100"}'
# NAT rule example
uv run mcp-cli cmd --server mikrotik --tool mikrotik_create_nat_rule --tool-args '{"chain": "srcnat", "action": "masquerade", "out_interface": "ether1"}'
# DNS configuration
uv run mcp-cli cmd --server mikrotik --tool mikrotik_set_dns_servers --tool-args '{"servers": ["8.8.8.8", "8.8.4.4"]}'
Inspector and related tooling
The Inspector helps validate and analyze the MCP setup against your MikroTik device, ensuring the commands you issue will have the intended effect and that the configuration remains consistent over time.
Complete examples for network setups
Several complete example workflows are provided to cover basic home, guest, and enterprise network setups, including security profiles, wireless interfaces, access lists, and VLAN-based provisioning. Use these as starting points and adapt to your environment.
Monitoring and troubleshooting
You can monitor wireless interfaces, view logs, scan networks for interference, and perform maintenance operations to ensure your MikroTik-based network stays healthy and secure.
Available tools
mikrotik_create_vlan_interface
Create a VLAN interface on the MikroTik device with options for VLAN ID, parent interface, and optional metadata like comments, MTU, and ARP mode.
mikrotik_list_vlan_interfaces
List VLAN interfaces and filter by name, VLAN ID, parent interface, or disabled status.
mikrotik_get_vlan_interface
Retrieve detailed information for a specific VLAN interface by name.
mikrotik_update_vlan_interface
Update properties of an existing VLAN interface, including name, VLAN ID, parent interface, and other options.
mikrotik_remove_vlan_interface
Remove a VLAN interface from the MikroTik device.
mikrotik_add_ip_address
Add an IP address to a specified interface with optional network, broadcast, and comment.
mikrotik_list_ip_addresses
List IP addresses configured on the device with various filters.
mikrotik_get_ip_address
Get details for a specific IP address entry.
mikrotik_remove_ip_address
Remove an IP address from the device.
mikrotik_create_dhcp_server
Create a DHCP server bound to a specific interface with lease time, pool, and options.
mikrotik_list_dhcp_servers
List existing DHCP servers with optional filters.
mikrotik_get_dhcp_server
Get details about a specific DHCP server.
mikrotik_create_dhcp_network
Create a DHCP network configuration including DNS, domain, and gateway settings.
mikrotik_create_dhcp_pool
Create an IP pool with ranges and optional next pool.
mikrotik_remove_dhcp_server
Remove a DHCP server from the device.
mikrotik_create_nat_rule
Create NAT rules for source or destination NAT with detailed conditions.
mikrotik_list_nat_rules
List NAT rules and filter by chain, action, addresses, protocol, and more.
mikrotik_get_nat_rule
Get details for a specific NAT rule by ID.
mikrotik_update_nat_rule
Update an existing NAT rule with new parameters.
mikrotik_remove_nat_rule
Remove a NAT rule.
mikrotik_move_nat_rule
Move a NAT rule to a new position.
mikrotik_enable_nat_rule
Enable a NAT rule.
mikrotik_disable_nat_rule
Disable a NAT rule.
mikrotik_create_ip_pool
Create an IP pool with ranges and optional next pool.
mikrotik_list_ip_pools
List IP pools with filters and usage options.
mikrotik_get_ip_pool
Get details for a specific IP pool.
mikrotik_update_ip_pool
Update an existing IP pool.
mikrotik_remove_ip_pool
Remove an IP pool.
mikrotik_list_ip_pool_used
List used addresses within an IP pool.
mikrotik_expand_ip_pool
Expand an IP pool by adding more ranges.
mikrotik_create_backup
Create a system backup on the MikroTik device.
mikrotik_list_backups
List backup files on the device.
mikrotik_create_export
Create a configuration export in various formats.
mikrotik_export_section
Export a specific configuration section.
mikrotik_download_file
Download a file from the device.
mikrotik_upload_file
Upload a file to the device.
mikrotik_restore_backup
Restore a system backup.
mikrotik_import_configuration
Import a configuration script.
mikrotik_remove_file
Remove a file from the device.
mikrotik_backup_info
Get information about a backup file.
mikrotik_get_logs
Retrieve device logs with filtering options.
mikrotik_get_logs_by_severity
Get logs filtered by severity level.
mikrotik_get_logs_by_topic
Get logs for a specific topic.
mikrotik_search_logs
Search logs for a term.
mikrotik_get_system_events
Get system-related log events.
mikrotik_get_security_logs
Get security-related logs.
mikrotik_clear_logs
Clear all logs on the device.
mikrotik_get_log_statistics
Get statistics about log entries.
mikrotik_export_logs
Export logs to a file on the device.
mikrotik_monitor_logs
Monitor logs in real time for a duration.
mikrotik_create_filter_rule
Create a firewall filter rule with detailed matching options.
mikrotik_list_filter_rules
List firewall rules with various filters.
mikrotik_get_filter_rule
Get details for a specific firewall rule by ID.
mikrotik_update_filter_rule
Update a firewall rule with new parameters.
mikrotik_remove_filter_rule
Remove a firewall filter rule.
mikrotik_move_filter_rule
Move a firewall rule to a new position.
mikrotik_enable_filter_rule
Enable a firewall rule.
mikrotik_disable_filter_rule
Disable a firewall rule.
mikrotik_create_basic_firewall_setup
Create a basic firewall setup with common security rules.
mikrotik_add_route
Add a static route to the routing table.
mikrotik_list_routes
List routes with filters for destination, gateway, and status.
mikrotik_get_route
Get details for a specific route.
mikrotik_update_route
Update routing entries.
mikrotik_remove_route
Remove a route from the routing table.
mikrotik_enable_route
Enable a route.
mikrotik_disable_route
Disable a route.
mikrotik_get_routing_table
Get a specific routing table with optional filters.
mikrotik_check_route_path
Check the route path to a destination.
mikrotik_get_route_cache
Get the route cache.
mikrotik_flush_route_cache
Flush the route cache.
mikrotik_add_default_route
Add a default route (0.0.0.0/0) to the routing table.
mikrotik_add_blackhole_route
Add a blackhole route.
mikrotik_get_route_statistics
Get routing table statistics.
mikrotik_set_dns_servers
Set DNS server configuration on MikroTik device.
mikrotik_get_dns_settings
Get current DNS configuration.
mikrotik_add_dns_static
Add a static DNS entry.
mikrotik_list_dns_static
List static DNS entries.
mikrotik_get_dns_static
Get details of a static DNS entry.
mikrotik_update_dns_static
Update an existing static DNS entry.
mikrotik_remove_dns_static
Remove a static DNS entry.
mikrotik_enable_dns_static
Enable a static DNS entry.
mikrotik_disable_dns_static
Disable a static DNS entry.
mikrotik_get_dns_cache
Get the current DNS cache.
mikrotik_flush_dns_cache
Flush the DNS cache.
mikrotik_get_dns_cache_statistics
Get DNS cache statistics.
mikrotik_add_dns_regexp
Add a DNS regexp entry for pattern matching.
mikrotik_test_dns_query
Test a DNS query.
mikrotik_export_dns_config
Export DNS configuration to a file.
mikrotik_add_user
Add a new MikroTik user.
mikrotik_list_users
List users on the device.
mikrotik_get_user
Get details for a specific user.
mikrotik_update_user
Update a user's information.
mikrotik_remove_user
Remove a user.
mikrotik_disable_user
Disable a user account.
mikrotik_enable_user
Enable a user account.
mikrotik_add_user_group
Add a new user group with policies.
mikrotik_list_user_groups
List user groups.
mikrotik_get_user_group
Get details for a specific user group.
mikrotik_update_user_group
Update an existing user group.
mikrotik_remove_user_group
Remove a user group.
mikrotik_get_active_users
Get currently active users.
mikrotik_disconnect_user
Disconnect an active user session.
mikrotik_export_user_config
Export user configuration to a file.
mikrotik_set_user_ssh_keys
Set SSH keys for a user.
mikrotik_list_user_ssh_keys
List SSH keys for a user.
mikrotik_remove_user_ssh_key
Remove an SSH key.
mikrotik_create_wireless_interface
Create a wireless interface with specified mode, SSID, and band.
mikrotik_list_wireless_interfaces
List wireless interfaces and filter by mode or status.
mikrotik_get_wireless_interface
Get details of a specific wireless interface.
mikrotik_update_wireless_interface
Update wireless interface properties such as SSID and comments.
mikrotik_disable_wireless_interface
Disable a wireless interface.
mikrotik_enable_wireless_interface
Enable a wireless interface.
mikrotik_remove_wireless_interface
Remove a wireless wireless interface.