npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mikrotik-mcp

v1.0.0

Published

MikroTik MCP Server - AI-powered assistant for MikroTik RouterOS management

Downloads

113

Readme

🛜 Tum's MikroTik MCP Server

MCP (Model Context Protocol) Server สำหรับจัดการ MikroTik RouterOS ผ่าน SSH

✨ Features

MCP Server นี้มี Tools ทั้งหมด 12 ตัว สำหรับจัดการ MikroTik:

📊 Network Information

  • mikrotik_get_ip_addresses - ดูรายการ IP Address ทั้งหมด
  • mikrotik_get_interface_status - เช็คสถานะ Interface
  • mikrotik_get_dhcp_leases - ดู DHCP Leases
  • mikrotik_get_routes - ดู Routing Table
  • mikrotik_get_bridges - ดู Bridge Interfaces
  • mikrotik_get_wireless_interfaces - ดู Wireless Interfaces

🔒 Security & Firewall

  • mikrotik_get_firewall_rules - ดู Firewall Filter Rules
  • mikrotik_get_nat_rules - ดู NAT Rules

⚙️ System

  • mikrotik_get_system_resources - ดู CPU, Memory, Uptime
  • mikrotik_get_dns_settings - ดู DNS Settings
  • mikrotik_test_connection - ทดสอบการเชื่อมต่อ

🛠️ Advanced

  • mikrotik_execute_command - รันคำสั่ง RouterOS แบบ Custom (Read-only)

📋 Prerequisites

  • Node.js 18+
  • MikroTik Router with SSH enabled
  • SSH credentials (username/password)

🚀 Installation

Local Development

# Clone or navigate to the project
cd /home/rookief/MCP/mikrotik

# Install dependencies
npm install

# Build
npm run build

Configuration

สร้างไฟล์ ~/.env/mikrotik.env:

MIKROTIK_HOST="IP GATEWAY"
MIKROTIK_USERNAME="your-username"
MIKROTIK_PASSWORD="your-password"
MIKROTIK_PORT="22"

Add to Opencode

เพิ่มใน ~/.config/opencode/opencode.json:

{
  "mcpServers": {
    "mikrotik": {
      "command": "node",
      "args": ["/home/rookief/MCP/mikrotik/dist/index.js"]
    }
  }
}

หรือใช้ shell wrapper เพื่อความปลอดภัย:

{
  "mcpServers": {
    "mikrotik": {
      "command": "bash",
      "args": [
        "-c",
        "source ~/.env/mikrotik.env && node /home/rookief/MCP/mikrotik/dist/index.js"
      ]
    }
  }
}

🎯 Usage Examples

ตัวอย่างการใช้งาน

// ดู IP Addresses
mikrotik_get_ip_addresses()

// เช็คสถานะ Interface
mikrotik_get_interface_status()

// ดู System Resources
mikrotik_get_system_resources()

// รันคำสั่งแบบกำหนดเอง
mikrotik_execute_command({
  command: "/system identity print"
})

🔒 Security

  • Tools ทั้งหมดเป็น Read-only เป็นหลัก
  • mikrotik_execute_command มีการป้องกันคำสั่งอันตราย:
    • ไม่อนุญาต: /system reset, /system reboot, remove
    • แนะนำให้ใช้กับคำสั่ง print เท่านั้น

🧪 Development

# Run in development mode (with auto-reload)
npm run dev

# Build for production
npm run build

# Test connection
npm run start

📁 Project Structure

mikrotik/
├── src/
│   ├── index.ts          # MCP Server main
│   └── mikrotik.ts       # SSH Client & RouterOS commands
├── dist/                 # Compiled JavaScript
├── package.json
├── tsconfig.json
└── README.md

🐛 Troubleshooting

Connection Failed

  1. เช็ค SSH credentials ใน ~/.env/mikrotik.env
  2. ทดสอบการเชื่อมต่อ: ssh [email protected]
  3. ตรวจสอบว่า SSH service เปิดอยู่บน MikroTik

Tools ไม่แสดง

  1. Restart Opencode
  2. เช็ค logs: tail -f ~/.config/opencode/mcp-*.log
  3. ทดสอบรัน server: npm run start

📝 License

MIT

👤 Author

Tum


Made with ❤️ for MikroTik RouterOS automation