原型 · 预览版:收录官方注册中心里的全部服务器,每 30 分钟同步一次。使用 Google 登录即可撰写评价。原型 · 每 30 分钟更新
PopNx MCP为使用 AI 的人准备的 MCP 服务器 · 用大白话讲清楚

MikroTik RouterOS

作者:StefanKnol版本 0.3.1i★ 0i在你的电脑上运行
注册名称io.github.StefanKnol/mikrotik-mcp

安装方法

What it does

MikroTik RouterOS over the binary API, addressing rules by real .id not list position.

  • Connects 在你的电脑上运行
  • Account or key Needs MIKROTIK_PASSWORD · 2 settings to fill in (MIKROTIK_HOST, MIKROTIK_USERNAME)
  • Category 其他

安装

选择你使用的 AI 应用,然后复制设置。

通过 3/3 项检查 · 在你的电脑上运行 · ✓ 命令已检查 2026年11月14日

第一步:你用哪个 AI?

选择你用的应用,步骤会显示在下方。

可连接 Claude,但需要先准备

需要 MikroTik RouterOS 的密钥(在开发者网站创建) · 需要填写 2 项设置(MIKROTIK_HOST, MIKROTIK_USERNAME) · 需要先在电脑上安装 Python (uv)(只需一次) · 仅限电脑上的 Claude 应用(Windows 或 Mac),网页和手机不可用

  1. 安装 Python (uv)

    只需一次,所有需要 Python (uv) 的服务器都能用

    打开 Python (uv) 下载页 ↗

  2. 注册并创建 MikroTik RouterOS 的密钥

    打开开发者网站,注册账户并创建 API 密钥,下一步要用。价格和免费方案请看开发者网站。

    获取密钥的方法见下方开发者的 README

  3. 填写 2 项设置

    这些是程序设置,不是密钥,无需注册。按开发者的说明填写。

    • MIKROTIK_HOST IP address or hostname of the router, e.g. 192.168.88.1
    • MIKROTIK_USERNAME RouterOS user. Use a dedicated account rather than admin; its group must carry the `api` policy, and a group without it is rejected with the same error as a wrong password.

    说明仍为英文原文。

  4. 打开电脑版 Claude 应用的设置文件

    SettingsDeveloperEdit Config

  5. 粘贴这些设置并保存文件

    {
      "mcpServers": {
        "mikrotik": {
          "command": "uvx",
          "args": [
            "mikrotik-mcp"
          ],
          "env": {
            "MIKROTIK_HOST": "your-value",
            "MIKROTIK_USERNAME": "your-value",
            "MIKROTIK_PASSWORD": "your-value"
          }
        }
      }
    }

    只把密钥粘贴到应用的输入框里,不要粘贴到聊天中或发给任何人

  6. 退出 Claude 再重新打开

  7. 试一试

    用 MikroTik RouterOS 告诉我你能帮我做什么,然后做一件给我看

    ✓ 如果 Claude 说正在使用 MikroTik RouterOS,或回答中出现 MikroTik RouterOS 的工具名称,就表示连接成功

4 项可选设置(不填也能用)

上面的命令不填这些也能用。想调整时再按开发者的说明添加。

  • MIKROTIK_PORT API port: 8729 for api-ssl (default), 8728 for plaintext.
  • MIKROTIK_TLS Use the TLS API. Defaults to true; turning it off sends the router password over the network in the clear.
  • MIKROTIK_TLS_FINGERPRINT SHA-256 of the router certificate. MikroTik's API-SSL certificate is self-signed, so pinning this is what makes the connection authenticated rather than merely encrypted.
  • MIKROTIK_TIMEOUT Connection timeout in seconds. Defaults to 10.

说明仍为英文原文。

菜单名称已于 2026年11月11日 对照 Anthropic 帮助页面核实 · 你的界面可能因版本略有不同

ChatGPT 暂时无法连接 MikroTik RouterOS

MikroTik RouterOS 需要安装在你的电脑上,而 ChatGPT 只能连接在网上运行的服务器

你可以改用这些方式

A · 使用能连接 MikroTik RouterOS 的应用

  • 需要 MikroTik RouterOS 的密钥(在开发者网站创建) · 需要填写 2 项设置(MIKROTIK_HOST, MIKROTIK_USERNAME) · 需要先在电脑上安装 Python (uv)(只需一次) · 仅限电脑上的 Claude 应用(Windows 或 Mac),网页和手机不可用
  • 需要 MikroTik RouterOS 的密钥(在开发者网站创建) · 需要填写 2 项设置(MIKROTIK_HOST, MIKROTIK_USERNAME) · 需要先在电脑上安装 Python (uv)(只需一次)
  • 需要 MikroTik RouterOS 的密钥(在开发者网站创建) · 需要填写 2 项设置(MIKROTIK_HOST, MIKROTIK_USERNAME) · 需要先在电脑上安装 Python (uv)(只需一次)
  • 需要 MikroTik RouterOS 的密钥(在开发者网站创建) · 需要填写 2 项设置(MIKROTIK_HOST, MIKROTIK_USERNAME) · 需要先在电脑上安装 Python (uv)(只需一次)

B · 其他 类中能连接 ChatGPT 的其他服务器

从同类中使用较多的里挑选,仅限用地址即可连接、无需密钥的

可连接 Claude Code,但需要先准备

需要 MikroTik RouterOS 的密钥(在开发者网站创建) · 需要填写 2 项设置(MIKROTIK_HOST, MIKROTIK_USERNAME) · 需要先在电脑上安装 Python (uv)(只需一次)

  1. 安装 Python (uv)

    只需一次,所有需要 Python (uv) 的服务器都能用

    打开 Python (uv) 下载页 ↗

  2. 注册并创建 MikroTik RouterOS 的密钥

    打开开发者网站,注册账户并创建 API 密钥,下一步要用。价格和免费方案请看开发者网站。

    获取密钥的方法见下方开发者的 README

  3. 填写 2 项设置

    这些是程序设置,不是密钥,无需注册。按开发者的说明填写。

    • MIKROTIK_HOST IP address or hostname of the router, e.g. 192.168.88.1
    • MIKROTIK_USERNAME RouterOS user. Use a dedicated account rather than admin; its group must carry the `api` policy, and a group without it is rejected with the same error as a wrong password.

    说明仍为英文原文。

  4. 打开终端

    Mac:按 Command+空格,输入 Terminal · Windows:打开 PowerShell

  5. 粘贴这条命令并按 Enter

    claude mcp add --scope user mikrotik --env MIKROTIK_HOST=your-value --env MIKROTIK_USERNAME=your-value --env MIKROTIK_PASSWORD=your-value -- uvx mikrotik-mcp

    按 Enter 前,把“your-value”改成你的密钥

    只把密钥粘贴到应用的输入框里,不要粘贴到聊天中或发给任何人

  6. 在 Claude Code 中输入 /mcp

    应能看到 MikroTik RouterOS 在列表中并显示已连接

  7. 试一试

    用 MikroTik RouterOS 告诉我你能帮我做什么,然后做一件给我看

    ✓ 如果 Claude Code 说正在使用 MikroTik RouterOS,或回答中出现 MikroTik RouterOS 的工具名称,就表示连接成功

4 项可选设置(不填也能用)

上面的命令不填这些也能用。想调整时再按开发者的说明添加。

  • MIKROTIK_PORT API port: 8729 for api-ssl (default), 8728 for plaintext.
  • MIKROTIK_TLS Use the TLS API. Defaults to true; turning it off sends the router password over the network in the clear.
  • MIKROTIK_TLS_FINGERPRINT SHA-256 of the router certificate. MikroTik's API-SSL certificate is self-signed, so pinning this is what makes the connection authenticated rather than merely encrypted.
  • MIKROTIK_TIMEOUT Connection timeout in seconds. Defaults to 10.

说明仍为英文原文。

菜单名称已于 2026年11月11日 对照 Anthropic 帮助页面核实 · 你的界面可能因版本略有不同

可连接 Cursor,但需要先准备

需要 MikroTik RouterOS 的密钥(在开发者网站创建) · 需要填写 2 项设置(MIKROTIK_HOST, MIKROTIK_USERNAME) · 需要先在电脑上安装 Python (uv)(只需一次)

  1. 安装 Python (uv)

    只需一次,所有需要 Python (uv) 的服务器都能用

    打开 Python (uv) 下载页 ↗

  2. 注册并创建 MikroTik RouterOS 的密钥

    打开开发者网站,注册账户并创建 API 密钥,下一步要用。价格和免费方案请看开发者网站。

    获取密钥的方法见下方开发者的 README

  3. 填写 2 项设置

    这些是程序设置,不是密钥,无需注册。按开发者的说明填写。

    • MIKROTIK_HOST IP address or hostname of the router, e.g. 192.168.88.1
    • MIKROTIK_USERNAME RouterOS user. Use a dedicated account rather than admin; its group must carry the `api` policy, and a group without it is rejected with the same error as a wrong password.

    说明仍为英文原文。

  4. 点击这个按钮打开 Cursor

    在 Cursor 中打开

    Cursor 会请你确认安装,点击 Install

  5. 填写你的密钥

    在 MikroTik RouterOS 的设置中,MIKROTIK_PASSWORD, MIKROTIK_HOST, MIKROTIK_USERNAME 还是空的,填入你的密钥并保存

    只把密钥粘贴到应用的输入框里,不要粘贴到聊天中或发给任何人

  6. 在 Cursor 中以 Agent 模式打开 AI 聊天

  7. 试一试

    用 MikroTik RouterOS 告诉我你能帮我做什么,然后做一件给我看

    ✓ 如果 Cursor 说正在使用 MikroTik RouterOS,或回答中出现 MikroTik RouterOS 的工具名称,就表示连接成功

4 项可选设置(不填也能用)

上面的命令不填这些也能用。想调整时再按开发者的说明添加。

  • MIKROTIK_PORT API port: 8729 for api-ssl (default), 8728 for plaintext.
  • MIKROTIK_TLS Use the TLS API. Defaults to true; turning it off sends the router password over the network in the clear.
  • MIKROTIK_TLS_FINGERPRINT SHA-256 of the router certificate. MikroTik's API-SSL certificate is self-signed, so pinning this is what makes the connection authenticated rather than merely encrypted.
  • MIKROTIK_TIMEOUT Connection timeout in seconds. Defaults to 10.

说明仍为英文原文。

菜单名称已于 2026年11月11日 对照 Cursor 帮助页面核实 · 你的界面可能因版本略有不同

可连接 VS Code,但需要先准备

需要 MikroTik RouterOS 的密钥(在开发者网站创建) · 需要填写 2 项设置(MIKROTIK_HOST, MIKROTIK_USERNAME) · 需要先在电脑上安装 Python (uv)(只需一次)

  1. 安装 Python (uv)

    只需一次,所有需要 Python (uv) 的服务器都能用

    打开 Python (uv) 下载页 ↗

  2. 注册并创建 MikroTik RouterOS 的密钥

    打开开发者网站,注册账户并创建 API 密钥,下一步要用。价格和免费方案请看开发者网站。

    获取密钥的方法见下方开发者的 README

  3. 填写 2 项设置

    这些是程序设置,不是密钥,无需注册。按开发者的说明填写。

    • MIKROTIK_HOST IP address or hostname of the router, e.g. 192.168.88.1
    • MIKROTIK_USERNAME RouterOS user. Use a dedicated account rather than admin; its group must carry the `api` policy, and a group without it is rejected with the same error as a wrong password.

    说明仍为英文原文。

  4. 点击这个按钮打开 VS Code

    在 VS Code 中打开

    VS Code 会请你确认安装,点击 Install

  5. 填写你的密钥

    在 MikroTik RouterOS 的设置中,MIKROTIK_PASSWORD, MIKROTIK_HOST, MIKROTIK_USERNAME 还是空的,填入你的密钥并保存

    只把密钥粘贴到应用的输入框里,不要粘贴到聊天中或发给任何人

  6. 在 VS Code 中以 Agent 模式打开 AI 聊天

  7. 试一试

    用 MikroTik RouterOS 告诉我你能帮我做什么,然后做一件给我看

    ✓ 如果 VS Code 说正在使用 MikroTik RouterOS,或回答中出现 MikroTik RouterOS 的工具名称,就表示连接成功

4 项可选设置(不填也能用)

上面的命令不填这些也能用。想调整时再按开发者的说明添加。

  • MIKROTIK_PORT API port: 8729 for api-ssl (default), 8728 for plaintext.
  • MIKROTIK_TLS Use the TLS API. Defaults to true; turning it off sends the router password over the network in the clear.
  • MIKROTIK_TLS_FINGERPRINT SHA-256 of the router certificate. MikroTik's API-SSL certificate is self-signed, so pinning this is what makes the connection authenticated rather than merely encrypted.
  • MIKROTIK_TIMEOUT Connection timeout in seconds. Defaults to 10.

说明仍为英文原文。

菜单名称已于 2026年11月11日 对照 VS Code 帮助页面核实 · 你的界面可能因版本略有不同

其他支持 MCP 的应用(如 Windsurf、Zed、Gemini CLI)添加方式各不相同,请在应用列表中查看

查看所有支持 MCP 的应用 →

JSON 设置在下方“开发者专用”中

卡住了?问问正在用 MikroTik RouterOS 的人💬 讨论 →
开发者专用:终端命令和 JSON 设置

安装在电脑上

Claude Code

claude mcp add --scope user mikrotik --env MIKROTIK_HOST=your-value --env MIKROTIK_USERNAME=your-value --env MIKROTIK_PASSWORD=your-value -- uvx mikrotik-mcp

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "mikrotik": {
      "command": "uvx",
      "args": [
        "mikrotik-mcp"
      ],
      "env": {
        "MIKROTIK_HOST": "your-value",
        "MIKROTIK_USERNAME": "your-value",
        "MIKROTIK_PASSWORD": "your-value"
      }
    }
  }
}

Cursor (~/.cursor/mcp.json)

{
  "mcpServers": {
    "mikrotik": {
      "command": "uvx",
      "args": [
        "mikrotik-mcp"
      ],
      "env": {
        "MIKROTIK_HOST": "your-value",
        "MIKROTIK_USERNAME": "your-value",
        "MIKROTIK_PASSWORD": "your-value"
      }
    }
  }
}

VS Code (mcp.json)

{
  "servers": {
    "mikrotik": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mikrotik-mcp"
      ],
      "env": {
        "MIKROTIK_HOST": "your-value",
        "MIKROTIK_USERNAME": "your-value",
        "MIKROTIK_PASSWORD": "your-value"
      }
    }
  }
}

需要你填写的值

  • MIKROTIK_HOST 必填 env
    IP address or hostname of the router, e.g. 192.168.88.1
  • MIKROTIK_USERNAME 必填 env
    RouterOS user. Use a dedicated account rather than admin; its group must carry the `api` policy, and a group without it is rejected with the same error as a wrong password.
  • MIKROTIK_PASSWORD 机密 必填 env
    Password for that user.
  • MIKROTIK_PORT env
    API port: 8729 for api-ssl (default), 8728 for plaintext.
  • MIKROTIK_TLS env
    Use the TLS API. Defaults to true; turning it off sends the router password over the network in the clear.
  • MIKROTIK_TLS_FINGERPRINT env
    SHA-256 of the router certificate. MikroTik's API-SSL certificate is self-signed, so pinning this is what makes the connection authenticated rather than merely encrypted.
  • MIKROTIK_TIMEOUT env
    Connection timeout in seconds. Defaults to 10.

说明仍为英文原文。

这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。

一览

每周下载量i
27/周
连接方式
在你的电脑上运行
最新版本i
0.3.1
分类i
其他
发布到注册中心i
2026年11月13日
代码最后更新i
2026年11月13日
作者
StefanKnol
软件包
pypi: mikrotik-mcp
注册状态
活跃

哪些应用可以使用它

依据这个服务器的连接方式和各应用自己的文档,检查于 2026年11月10日。

在你的电脑上运行,适用于

ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast

全部应用及其优缺点 →

它能做什么

它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。

基础检查i

我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月15日

  • ✓ 通过

    作者与仓库一致

    注册名称已通过 GitHub 账户 StefanKnol 验证,该账户拥有此仓库

  • ✓ 通过

    仍在维护

    代码最后更新于前天

  • ✓ 通过

    有许可证

    使用 MIT

  • – 不适用

    端点有响应

    它在你的电脑上运行,没有互联网端点

  • – 不适用

    使用 OAuth 登录

    在你的电脑上运行,改用本地设置

  • … 尚未检查

    工具描述中没有隐藏指令

    它在你的电脑上运行;我们只能读取互联网端点的工具列表

讨论

提问、分享技巧或报告无法使用。按“有帮助”数量排序。

还没有帖子,欢迎第一个提问或分享。

此处内容由用户撰写,不代表 PopNx 团队。

使用 Google 登录后发帖

用户评价

还没有评价

用 Google 登录后写评价

与“其他”中的其他服务器比较i

  • 星标数多于此分类中其他 19812 个服务器的 0%
  • 发布到注册中心的时间比此分类中其他 19812 个服务器的 94% 更新
  • 基础检查结果等于或优于此分类中其他 19812 个服务器的 100%

与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。

常见问题

MikroTik RouterOS 安全吗?

它在 3 项适用的基础检查中通过了 3 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。

它需要哪些密钥或代码?

你需要填写:MIKROTIK_PASSWORD

它在我的电脑上运行还是在云端?

它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。

它还在维护吗?

GitHub 仓库最后更新于前天,最新版本(0.3.1)于前天进入注册中心。

哪些应用可以使用它?

支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Python (uv)。

有什么可以替代它?

同一分类中有:World Monitor, Claude Flow, Windmill

同类别的其他选择

同一分类中其他作者的服务器,按星标数排序。

如何看卡片:↓ 每周下载量i★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i

World Monitor

Real-time global intelligence on conflict, markets, energy, trade, shipping and cyber. 97 tools.

作者:koala73广泛使用★ 9.1万昨天更新

在云端运行✓ 服务方 · worldmonitor.app

Claude Flow

AI orchestration with hive-mind swarms, neural networks, and 87 MCP tools for enterprise dev.

作者:ruvnet广泛使用↓ 1.4万/周★ 8.2万14个月前更新

在你的电脑上运行

Windmill

Run Windmill scripts and flows and manage jobs, schedules, resources and variables.

作者:windmill-labs广泛使用★ 1.9万3天前更新

在云端运行

作者的 README

打开 README

按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。

mikrotik-mcp

mcp-name: io.github.StefanKnol/mikrotik-mcp

An MCP server for MikroTik RouterOS, over the binary API rather than by driving the CLI over SSH.

That distinction is the whole point. The CLI prints *positional* numbers, which are not a rule's identity. A server that lists rules by position and then writes by position either fails outright — where .id=3 matches nothing, so every write reports "not found" for rules that plainly exist — or, worse, succeeds against a different rule once the order has shifted. On a firewall that means deleting the wrong rule.

The binary API returns the real .id (*7, *1f) on every read. So:

  • every read returns id, and every write takes one back;
  • list results also carry position, which is display-only and refused for writes, with an error that explains why;
  • writes read back what they wrote, so a change can be verified rather than assumed;
  • remove_firewall_rule takes an optional confirm_comment and returns the rule it deleted.

Use it

uvx mikrotik-mcp

Configure through the environment — ps would show a password passed as a flag:

VariableDefaultMeaning
MIKROTIK_HOST—Router address. Required.
MIKROTIK_USERNAME—Required.
MIKROTIK_PASSWORD—
MIKROTIK_PORT87298729 for api-ssl, 8728 for plaintext.
MIKROTIK_TLStrue
MIKROTIK_TLS_FINGERPRINT—SHA-256 of the router certificate, to pin it.
MIKROTIK_TIMEOUT10

In an MCP client's config:

{

"mcpServers": { "mikrotik": { "command": "uvx", "args": ["mikrotik-mcp"], "env": { "MIKROTIK_HOST": "192.168.88.1", "MIKROTIK_USERNAME": "mcp-agent", "MIKROTIK_PASSWORD": "..." } } } }

On the router

/ip service enable api-ssl

/user group add name=mcp policy=api,read,write,test /user add name=mcp-agent group=mcp password=

The api policy is not optional, and its absence produces a login error identical to a wrong password — so if credentials look right and login still fails, check the group first.

Set MIKROTIK_TLS_FINGERPRINT if you can. MikroTik's API-SSL certificate is self-signed, so ordinary CA validation cannot succeed against a stock device; pinning is what makes the connection authenticated rather than merely encrypted.

Tools

34 of them, covering system info, interfaces, IP addressing, firewall filter (IPv4 and IPv6), firewall address lists, NAT, DHCP leases, DNS, routes and logs — plus ros_list, which reads any RouterOS path and so covers everything without a dedicated tool.

There is deliberately no generic write escape hatch.

Three things worth knowing before the first call:

  • **Writes take an id (*7), never a position.** Both appear in every list result. position is where a rule currently sits in evaluation order; it shifts whenever anything is added, removed or moved, and it is counted across the whole table rather than within the chain you filtered to. Passing one to a write is rejected rather than guessed at.
  • IPv4 and IPv6 are separate rule sets. The firewall tools take a family and default to ipv4, so a device can read as locked down while its IPv6 table is empty and therefore accepting everything. Listing IPv4 reports the IPv6 rule count for exactly this reason.
  • Address lists hold state no configuration export shows. Entries a rule adds at runtime carry a timeout and exist only in memory. Ask list_address_list_entries for a count_only first: a populated block list can hold tens of thousands.

With mcphub

mcphub puts MCP servers behind one sign-in and grants them out per account. One router is one backend, at its own /mcp/ , registered in a client as its own connector.

Adding it

From the registry — the better default. *Add from registry*, search for mikrotik-mcp, and the hub builds the settings form from server.json and launches uvx mikrotik-mcp when you enable the backend. It runs in its own process and cannot read credentials the hub holds for anything else. Backends added this way start disabled: open it, look at the tool list, then enable.

As a plugin — install this package into the hub's own environment and mikrotik appears as a backend kind, with typed fields and a Test button that reports the router's identity and RouterOS version. Nicer to configure, but an in-process plugin can read every credential the hub holds. Use it when you build your own hub image.

What to set

Either route asks for the same things. As environment variables:

VariableDefault
MIKROTIK_HOST—Router address. Required.
MIKROTIK_USERNAME—Required. A dedicated user, not admin; its group needs the api policy.
MIKROTIK_PASSWORD—Required.
MIKROTIK_PORT87298729 for api-ssl, 8728 for plaintext.
MIKROTIK_TLStrueTurning it off sends the router password over the network in the clear.
MIKROTIK_TLS_FINGERPRINT—SHA-256 of the router certificate. Pinning it is what makes the TLS connection authenticated rather than merely encrypted.
MIKROTIK_TIMEOUT10Seconds.

No data directory: everything this server reads and writes lives on the router, so there is no local state to keep. Leave Give this server a data directory unticked.

Levels

The hub reads readOnlyHint and destructiveHint from each tool and enforces the grant's level from those alone — a tool above the level is left out of tools/list and refused if called anyway.

LevelGets
viewer17 toolsReads the whole configuration and changes nothing.
user+7 toolsAdds rules and entries, and disables or re-enables them.
admin+10 toolsDeletes, edits in place, and reorders.

viewer — connectivity_check, get_dns_settings, get_firewall_rule, get_logs, get_nat_rule, list_address_list_entries, list_address_lists, list_dhcp_leases, list_dns_adlist, list_dns_static, list_firewall_rules, list_interfaces, list_ip_addresses, list_nat_rules, list_routes, ros_list, system_info.

user adds add_address_list_entry, add_dns_static, add_firewall_rule, add_nat_rule, make_lease_static, set_firewall_rule_enabled, set_nat_rule_enabled. Each of these writes, and none of them takes anything away: adding a rule is a write, not a destruction, and disabling one keeps the rule, its comment and its position so that re-enabling restores exactly what was there. Disabling is the reversible way to find out whether a rule is responsible for something, so it sits here rather than behind admin — the alternative would leave a user with no safe way to test at all.

admin adds the destructive ten:

ToolWhat is lost
remove_firewall_ruleThe rule. The returned copy is the only record.
remove_nat_ruleThe rule.
remove_dns_staticThe entry.
remove_address_list_entryThe entry. A dynamic one returns when its rule next matches; a static one does not.
update_firewall_ruleThe previous values of whatever it sets or clears.
update_nat_ruleThe same.
update_dns_staticThe same.
move_firewall_ruleThe previous order, which is the entire semantics of a firewall.
move_nat_ruleThe same.
set_interface_enabledNothing on disk — but disabling the interface the request came in through severs the only route back, and nothing here can undo that remotely.

A test pins every one of these assignments by name, so a tool added later fails the suite until someone decides which level it belongs to.

Publishing to the MCP registry

server.json is the manifest for the official MCP registry, validated against the published schema. It declares the uvx mikrotik-mcp command and every MIKROTIK_* variable, marking which are required and which are secret — so a client that browses the registry can generate a correct settings form without knowing anything about this server.

Publishing has an order to it, because the registry verifies that whoever publishes an entry actually owns the package it points at.

1. The package must already be on PyPI. The registry fetches pypi.org/pypi/mikrotik-mcp/ /json and refuses an entry whose package does not exist. Tag a release and let CI publish it:

git tag v0.1.0 && git push --tags

That needs a PyPI Trusted Publisher first, and because this project does not exist on PyPI yet it has to be a pending publisher — the per-project Publishing tab only appears once a project exists, which is the chicken-and-egg this page solves:

pypi.org → Account settings → Publishing → *Add a new pending publisher*

| Field | Value |

| --- | --- |

| PyPI Project Name | mikrotik-mcp |

| Owner | StefanKnol |

| Repository name | mikrotik-mcp |

| Workflow name | ci.yml |

| Environment name | pypi |

The environment name matters: the publish job declares environment: pypi, and PyPI rejects the upload if they disagree.

2. The README must carry the ownership token. The registry looks for mcp-name: io.github.StefanKnol/mikrotik-mcp in the PyPI description, which is this file — it is at the top, on its own line. That is what proves the person publishing the registry entry controls the PyPI package.

3. The registry entry publishes itself. The registry job in ci.yml runs after the PyPI upload on the same tag, authenticating with mcp-publisher login github-oidc. GitHub signs a short-lived OIDC token, the registry verifies it and grants the io.github.StefanKnol/* namespace from the repository owner. There is no secret to store and no device-flow login to sit through on each release.

It waits for PyPI to actually serve the new version first. The registry fetches pypi.org/pypi/mikrotik-mcp/ /json and refuses an entry whose package it cannot see, and that endpoint lags the upload by some seconds — long enough that publishing straight afterwards races it.

Re-running it is safe: a version already in the registry is the outcome the job exists to produce, so it reports that and passes rather than failing on the registry's duplicate refusal.

To publish by hand — recovering a failed run, or a version released before this job existed:

curl -sL https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_linux_amd64.tar.gz | tar xz mcp-publisher

./mcp-publisher login github && ./mcp-publisher publish

login github opens the device flow and proves you are StefanKnol, which authorises the same namespace the OIDC path gets without asking.

The version appears in four places — pyproject.toml, __version__, server.json, and again inside that file's packages entry. Rather than edit them by hand:

uv run python scripts/release.py 0.2.0 --tag

It sets all four, verifies them, commits and tags. The registry treats each version as its own row and checks PyPI has the package at exactly that version, so the nested packages[].version matters as much as the top-level one — and it is the one that gets missed, because the manifest still validates without it. A test enforces that they agree.

Development

uv sync --extra dev

uv run pytest

License

MIT