
Mikrotik
io.github.marcelo-ochoa由 GitHub 账号 marcelo-ochoa 发布v1.0.6更新于 Oct 24, 2026
MCP server for MikroTik RouterOS API
概览
只读的 MCP 服务器,通过 RouterOS API 连接 MikroTik 路由器,让助手查看接口、网桥、路由、日志和系统状态。
- 可以做什么
- 通过明文 TCP 或 SSL/TLS 连接并认证路由器,兼容新旧登录方式
- 以 MCP 资源形式读取接口、网桥、网桥端口和 IP 路由
- 对任意 RouterOS API 路径执行只读 print 查询,如接口、路由、地址、防火墙列表或日志
- 生成系统报告,汇总资源、健康状态、RouterBOARD 信息和接口流量
- 生成 AWR 风格的性能与安全审计报告并给出建议
- 提供连接、列出接口、查看路由与日志、执行审计等预置提示词
- 适用场景
- 适合让助手检查 MikroTik 路由器的配置与健康状况、查看路由、防火墙或接口状态,或快速获得性能与安全审计,而无需手动登录路由器。
- 运行要求
- 以本地 npm 包(npx)或 Docker 容器运行。需要能访问路由器 API 端口:明文 TCP 为 8728,SSL/TLS 为 8729。凭据通过 MK_USER 和 MK_PASSWORD 环境变量或 mk-connect 工具提供;主机地址和 secure 标志可作为启动参数传入。
安装
在 SourceWeft 中
- 打开 控制台中的 Mikrotik,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
MikroTik RouterOS API MCP Server
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.
Resources
This server exposes MikroTik entities as MCP resources for direct inspection:
- Interfaces:
mikrotik://interface/{name}- Example:
mikrotik://interface/ether1
- Example:
- Bridges:
mikrotik://bridge/{name}- Example:
mikrotik://bridge/bridge1
- Example:
- Bridge Ports:
mikrotik://bridge/{bridge_name}/{interface_name}- Example:
mikrotik://bridge/bridge1/ether2
- Example:
- IP Routes:
mikrotik://route/{id}- Example:
mikrotik://route/400AF317(Note: internal IDs are used for routing entries)
- Example:
Tools
mk-connect: Connects to a router.host: IP address of the router.user: Username.password: Password.secure: (Optional) Use SSL/TLS. Default isfalse.
Example: mk-connect 192.168.88.1 admin mypassword
-
mk-report: Generates a comprehensive system report.- Aggregates system resources, health, routerboard info, and interface traffic statistics (using
monitor-trafficonce).
- Aggregates system resources, health, routerboard info, and interface traffic statistics (using
-
mk-get: Returns a JSON array with the result of a MikroTik API/printcommand.sentence: The API path (e.g.,/ip/route,/interface,/log).- The server automatically ensures the path starts with
/and ends with/print.
-
mk-awr: Generates an Automatic Workload Repository (AWR) style report for MikroTik.- Includes performance metrics, security audit, and recommendations.
- No input required.
Prompts
The server provides several pre-defined prompts for common tasks:
- mk-connect: Connect to MikroTik: Helps you establish a connection to your router.
- mk-report: System Report: Requests a full system status and traffic report.
- mk-get-route: Routing Table: Specifically asks for the current IP routing table.
- mk-get-interface: List Interfaces: Specifically asks for all configured interfaces.
- mk-get-log: View Logs: Requests the latest system log entries.
- mk-awr: Security Audit: Initiates a full performance and security audit of the router.
Configuration
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)
Startup Arguments
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 isfalse.
If these are provided, the server will attempt to connect automatically on startup using MK_USER and MK_PASSWORD.
Local Build
Usage with Claude Desktop
Add this to your claude_desktop_config.json:
Sample using Docker:
Note: Arguments and environment variables are optional. You can connect later using mk-connect.
Demos
Using the information of mk-get:
- interface
- ip/address
- ip/route
- ip/route/rules
- ip/firewall[address-list,filter,nat,mangle] find potential security risk and no-used entities
See Demos for usage examples with Claude Desktop, Gemini CLI, and Antigravity Code Editor.
MikroTik AWR in action
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.
Docker
Building the container:
Running the container:
Change Log
See Change Log for the history of changes.
Sources
As usual, the code of this extension is at GitHub, feel free to suggest changes and make contributions.
📜 License
This project is licensed under the Apache License, Version 2.0 for new contributions, with existing code under MIT - see the LICENSE file for details.
来源:src/mikrotik/README.md,提交 bd2ce8f
工具
0版本历史
1- v1.0.6最新Sep 16, 2026
评分
已满足适用检查项的 40%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
请在仓库或注册中心条目中声明许可证。