MM

mikrotik-mcp/mikrotik-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

30 stars 7 forks 质量 77 趋势 20MIT

一个Bun原生MCP服务器,将一台或多台MikroTik路由器变成你的AI能驱动的+950工具。防火墙·路由·DHCP/DNS ·无线 ·QoS ·以及完整的VPN套件——通过SSH支持,......

概览

用通俗易懂的语言驱动一台或多台MikroTik路由器——950个带风险注释的工具,你的AI可以通过SSH调用。防火墙·路由·DHCP/DNS ·无线 ·QoS ·完整的VPN套件 ·事务式安全模式 ·实时攻击检测 ·以及一个监控每一次通话的可观察性仪表盘。 @usex/mikrotik-mcp 可以变成任何 MCP 客户端(Claude Desktop、Claude Code、Cursor 等)通过与路由器通信来读取和配置它。它通过 RouterOS 访问设备——没有代理,也无需在 RouterOS 上安装包——运行在 ,并对每个调用进行与模式对照验证。 “给我看防火墙输入链,然后在安全模式下阻止WAN的SSH传输。”“建立一个IKEv2站点隧道到203.0.113.5,连接192.168.20.0/24。”“为什么VLAN 50无法访问互联网?” - lookup_ip_intelligence和诊断 → IP 智能比较完整的 ipquery/ipkit 响应:ASN/组织、位置、风险及所有附加字段,包含可搜索细节和 JSON 导出。

概述(AI 翻译)

用简单语言驱动一个或多个MikroTik路由器——950个风险注释工具,你的AI可以通过SSH调用。 防火墙 ·路由 ·DHCP/DNS ·无线 ·QoS ·完整的VPN套件 ·事务式安全模式 ·实时攻击检测 ·以及监控每一次通话的可观测性仪表盘。


@usex/mikrotik-mcp 将 MikroTik RouterOS 转换为 924 模型上下文协议 工具 任何 MCP 客户端(Claude Desktop、Claude Code、Cursor 等)都可以调用读取和 通过与路由器通信来配置。它通过普通SSH到达设备——不行 agent,没有RouterOS上的可安装包——运行在Bun上,且 验证每一次调用对应模式。

把它对准路由器,然后做:

那就直接问:

“给我看防火墙输入链,然后在安全模式下阻止WAN的SSH。” “构建一个IKEv2站点间隧道到203.0.113.5,地址为192.168.20.0/24。” “为什么VLAN 50无法访问互联网?”

仪表盘

https://github.com/user-attachments/assets/f6dba72e-60f8-47ef-9045-2e871d92c8f0

浏览器观看下载MP4 ·60秒 ·1080p ·无音频

图解了八个仪表盘区域,从监控和路由到VPN会话,

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

MikroTik MCP connects Claude, Codex and other MCP clients to one or more MikroTik routers. Inspect the network, investigate a connection, preview changes and verify the result. The server runs on Bun and uses SSH by default; no agent is required on the router.

Documentation website → · Getting started · AI installation prompt · Tool reference

Get connected

Install Bun (the project pins its tested version in package.json), then:

bun add -g @usex/mikrotik-mcp
mikrotik-mcp --help

Add this server to a local MCP client, replacing the example host, username and key path:

{
  "mcpServers": {
    "mikrotik": {
      "command": "mikrotik-mcp",
      "args": ["serve"],
      "env": {
        "MIKROTIK_HOST": "192.168.88.1",
        "MIKROTIK_USERNAME": "automation",
        "MIKROTIK_KEY_FILENAME": "/absolute/path/to/private-key"
      }
    }
  }
}

Import the matching public key into the intended RouterOS user, then verify connectivity with auth-check before making changes. The setup guide covers passwords, key creation and troubleshooting. Prefer one shared process? Follow service deployment and client configuration. Docker is optional.

Explore the dashboard

mikrotik-mcp serve --config /absolute/path/devices.json \
  --dashboard --dashboard-host 127.0.0.1 --dashboard-port 9090

Open http://127.0.0.1:9090. The dashboard brings together:

  • Network operations: device setup, address failover, routing, Wi-Fi, VPN sessions and user accounting.
  • Investigation: client paths, packet and flow evidence, service checks, site activity and incident timelines.
  • Controlled changes: plans, Safe Mode, access scope, transactions, rollouts, snapshots and recovery workflows.
  • MCP workspace: tool-call tracing, configuration, memory, prompts and module controls.

See every dashboard page, with full-page previews and instructions for its controls and limitations.

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "mikrotik": { "command": "mikrotik-mcp", "args": ["serve"], "env": { "MIKROTIK_HOST": "192.168.88.1", "MIKROTIK_USERNAME": "automation", "MIKROTIK_KEY_FILENAME": "/absolute/path/to/private-key" } } } }