A Read-Only MCP server implementation for interacting with MikroTik routers using the RouterOS API.
1.8K
A Read-Only MCP server implementation for interacting with MikroTik routers using the RouterOS API.
This server exposes MikroTik entities as MCP resources for direct inspection:
mikrotik://interface/{name}
mikrotik://interface/ether1mikrotik://bridge/{name}
mikrotik://bridge/bridge1mikrotik://bridge/{bridge_name}/{interface_name}
mikrotik://bridge/bridge1/ether2mikrotik://route/{id}
mikrotik://route/400AF317 (Note: internal IDs are used for routing entries)mk-connect: Connects to a router.
host: IP address of the router.user: Username.password: Password.secure: (Optional) Use SSL/TLS. Default is false.Example: mk-connect 192.168.88.1 admin mypassword
mk-report: Generates a comprehensive system report.
monitor-traffic once).mk-get: Returns a JSON array with the result of a MikroTik API /print command.
sentence: The API path (e.g., /ip/route, /interface, /log)./ and ends with /print.mk-awr: Generates an Automatic Workload Repository (AWR) style report for MikroTik.
The server provides several pre-defined prompts for common tasks:
The MikroTik server can use environment variables or the mk-connect tool for secure credential management:
MK_USER: MikroTik username (required if providing host at startup)MK_PASSWORD: MikroTik password (required if providing host at startup)You can optionally provide the host and security setting as command-line arguments:
host: (Optional) IP address of the router.secure: (Optional) Use SSL/TLS. Default is false.If these are provided, the server will attempt to connect automatically on startup using MK_USER and MK_PASSWORD.
cd src/mikrotik
npm install
npm run build
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"mikrotik": {
"command": "npx",
"args": [
"-y",
"@marcelo-ochoa/server-mikrotik",
"192.168.88.1"
],
"env": {
"MK_USER": "ai_agent",
"MK_PASSWORD": "ai_password"
}
}
}
}
Sample using Docker:
{
"mcpServers": {
"mikrotik": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"MK_USER=admin",
"-e",
"MK_PASSWORD=password",
"mochoa/mcp-mikrotik",
"192.168.88.1",
"false"
]
}
}
Note: Arguments and environment variables are optional. You can connect later using mk-connect.
Using the information of mk-get:
See Demos for usage examples with Claude Desktop, Gemini CLI, and Antigravity Code Editor.
See MikroTik AWR in action for an example of an Automatic Workload Repository (AWR) style report generated by the mk-awr tool for a MikroTik router, highlighting performance metrics and security risks.
Building the container:
docker build -t mochoa/mcp-mikrotik -f src/mikrotik/Dockerfile .
Running the container:
docker run -i --rm -e MK_USER=admin -e MK_PASSWORD=mypassword mochoa/mcp-mikrotik 192.168.88.1
See Change Log for the history of changes.
As usual, the code of this extension is at GitHub, feel free to suggest changes and make contributions.
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
Content type
Image
Digest
sha256:20c3a1058…
Size
89.5 MB
Last updated
about 1 month ago
docker pull mochoa/mcp-mikrotik