MikroCLAW
MikroCLAW is an MCP server that lets Claude Code monitor, diagnose, and manage MikroTik RouterOS devices through 100 structured tools (78 read-only, 22 write), plus a live web dashboard (Pulse) and AI-powered features.
๐ Monitoring & Diagnostics (always active)
System: Resource usage, health sensors (temp/voltage/fans), license, packages, uptime, board info
Interfaces & L2: All interfaces, Ethernet, bridges, VLANs, link status, live throughput sampling
IP & Routing: IP addresses, ARP, routing table, DHCP servers/leases/networks, DNS settings/cache, NTP, IP pools
Firewall & NAT: Filter rules, NAT, mangle, address lists, connection tracking, IPv6 firewall
WiFi & CAPsMAN: Interfaces, client registrations, radios, managed APs
VPN & Tunnels: WireGuard interfaces/peers, PPP active sessions/accounts, IPsec peers
Routing Protocols: BGP sessions, OSPF neighbors
Hotspot & AAA: Servers, active users, accounts, RADIUS
Security & Audit: Users, groups, active sessions, certificates (with expiry), IP services
Diagnostics: Ping, traceroute, live logs, Netwatch, update checks, MNDP/CDP/LLDP neighbors
Generic Read:
rest_getfor any RouterOS REST API path
โ๏ธ Configuration & Management (requires MIKROCLAW_ALLOW_WRITE=true)
Enable/disable interfaces and IP services
Firewall: add/delete/toggle rules, manage address lists, add NAT rules
Network: assign IPs, add static routes, set DNS servers, pin DHCP leases, add static DNS entries
VPN & Users: add WireGuard peers, PPPoE/PPP accounts, hotspot users, IPv6 addresses
QoS: add simple queues for bandwidth limiting
System: set identity, create config backups, reboot router
Generic Write:
rest_writefor any PUT/PATCH/DELETE/POST operation
๐ค AI-Powered Features
Twin (Packet Simulator): Trace hypothetical packets through live firewall/NAT/routing rules and test new rules before applying
Sentinel (Botnet Detection): Fingerprint per-device behavior from connection tracking to detect infected IoT devices, miners, and scanners โ no signatures needed
Chronicle (Config Time Machine): Snapshot configs with hashing, diff live vs. last snapshot with risk assessment (new users, open ports, persistence indicators)
Replay (Retrospective RCA): Reconstruct telemetry history to explain past incidents (e.g., "why was it slow yesterday?")
Concierge (Business Reports): Translate telemetry into business signals for ISPs โ active subscribers, idle accounts, bandwidth thieves, upgrade recommendations
Role Detection: Classify router function (gateway, BGP router, AP, BRAS, VPN hub, etc.) with evidence and confidence scores
๐ Pulse Dashboard A live web interface (via Server-Sent Events) showing CPU/memory/disk/temperature, WAN status, interface matrix with live throughput, client list (DHCP + PPPoE + hotspot + WiFi), service risk indicators, live log stream, deterministic trend predictions, and an optional AI Analyst card narrating network health and anomalies.
๐ Security
Read-only by default; writes require explicit opt-in flag
Credentials isolated in
.env, never exposed in chatTLS support, least-privilege user recommended
All write operations leave audit comments
Provides tools for monitoring and managing MikroTik RouterOS devices via REST API, including system info, interfaces, DHCP, firewall, routing, and more.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MikroCLAWshow active DHCP leases"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
๐ฆ MikroCLAW
MikroTik + CLAW (Claude) โ kendalikan RouterOS dari percakapan Claude Code
MCP server yang membuat Claude Code bisa mengakses, memonitor, dan mengelola perangkat MikroTik RouterOS lewat tool ber-skema โ plus dashboard monitoring live "Pulse".
MikroCLAW menjembatani Claude Code dengan RouterOS melalui REST API RouterOS v7
(HTTPS). Alih-alih Anda mengetik perintah curl/ssh manual, Claude memanggil
tool seperti dhcp_leases atau firewall_filter_rules sebagai pemanggilan ber-skema
โ aman, terstruktur, dan kredensial tidak pernah bocor ke jendela chat.
"Siapa saja klien DHCP yang aktif?" ยท "Interface mana yang down?" ยท "Blokir IP 10.0.0.5." โ cukup ketik dalam bahasa biasa, Claude memanggil tool yang tepat.
โจ Kenapa MikroCLAW?
๐ Read-only secara default | Aman untuk eksplorasi & monitoring tanpa risiko mengubah konfigurasi. |
๐ง Operasi write digerbang | Setiap tool yang mengubah config dikunci flag |
๐ Kredensial via | Tidak pernah muncul di chat, tidak ikut ter-commit. |
๐งฉ 100 tool ber-skema | 78 read + 22 write, termasuk lima fitur cerdas (Twin/Sentinel/Chronicle/Replay/Concierge), |
๐ง 12 Agent Skills | Playbook siap pakai: health-check, audit firewall, audit keamanan, overview jaringan, troubleshoot, backup-snapshot, deteksi-peran + 5 fitur cerdas baru. |
๐ค 5 fitur cerdas AI | Twin (simulator what-if paket), Sentinel (deteksi botnet/IoT terinfeksi tanpa signature), Chronicle (mesin waktu konfigurasi + deteksi intrusi), Replay (RCA retrospektif "kenapa tadi lemot"), Concierge (laporan bisnis RT-RW net). |
๐ MikroCLAW Pulse | Dashboard web monitoring live per-detik (read-only, via Server-Sent Events). |
โ๏ธ Installer satu-baris | Windows (PowerShell) & macOS/Linux (bash) โ pasang |
๐ Tanpa lock-in v7 | RouterOS v6 cukup ganti lapis transport ke API biner; daftar tool tetap. |
Versi terkini: v1.7.0 ยท Python 3.10+ ยท RouterOS v7.1+ ยท Lisensi Apache-2.0.
๐ Dokumen lain:
docs/FITUR.md(ikhtisar fitur ringkas) ยทMANUAL_BOOK.md(panduan tutorial langkah demi langkah).
Daftar Isi
Related MCP server: MikroMCP
Bagaimana Claude Code mengakses MikroTik
Claude Code tidak punya driver MikroTik bawaan. MikroCLAW berperan sebagai MCP server (Model Context Protocol): proses lokal yang mengekspos sekumpulan tool. Claude Code memanggil tool itu; MikroCLAW menerjemahkannya menjadi panggilan REST API ke RouterOS, lalu mengembalikan JSON hasilnya.
flowchart LR
subgraph local["๐ป Mesin Anda (lokal)"]
CC["Claude Code<br/>(CLI ยท IDE ยท Web)"]
MC["๐ฆ
MikroCLAW<br/>MCP server + Pulse"]
ENV[(".env<br/>host ยท user ยท pass")]
end
ROS["๐ก RouterOS<br/>(MikroTik v7)"]
BROWSER["๐ Browser<br/>(Pulse dashboard)"]
CC -- "panggil tool (stdio MCP)" --> MC
MC -- "hasil JSON" --> CC
MC -- "HTTPS /rest/... (REST API v7)" --> ROS
ROS -- "JSON" --> MC
ENV -. "dibaca saat start" .-> MC
BROWSER -- "SSE live per-detik" --> MC
classDef box fill:#10182a,stroke:#1f2d44,color:#e6edf3;
class CC,MC,ROS,BROWSER box;Alurnya (mis. "siapa saja klien DHCP yang aktif?"):
sequenceDiagram
autonumber
participant U as ๐ค Anda
participant C as Claude Code
participant M as ๐ฆ
MikroCLAW
participant R as ๐ก RouterOS
U->>C: "siapa klien DHCP yang aktif?"
C->>M: panggil tool dhcp_leases (MCP/stdio)
M->>R: GET /rest/ip/dhcp-server/lease (Basic Auth dari .env)
R-->>M: JSON daftar lease
M-->>C: hasil terstruktur
C-->>U: ringkasan klien DHCPRinciannya:
Anda menulis prompt biasa, mis. "siapa saja klien DHCP yang aktif?".
Claude Code memilih tool
dhcp_leasesdan memanggilnya lewat protokol MCP (stdio).MikroCLAW (
client.py) mengirimGET https://<router>/rest/ip/dhcp-server/leasedengan Basic Auth dari.env.RouterOS membalas JSON; MikroCLAW meneruskannya ke Claude.
Claude meringkas/menyajikan hasil untuk Anda.
RouterOS REST memetakan path konsol ke URL secara langsung, contoh:
Perintah konsol RouterOS | Operasi REST |
|
|
|
|
tambah item |
|
ubah item ber- |
|
hapus item ber- |
|
command (ping, dst.) |
|
Prasyarat
Komponen | Versi | Catatan |
RouterOS | v7.1+ | REST API hanya ada di v7. Untuk v6 lihat kompatibilitas. |
Python | 3.10+ | Diuji pada 3.14. |
uv | terbaru | Pengelola environment/dependency โ https://docs.astral.sh/uv/ |
Akses jaringan | โ | Host yang menjalankan MikroCLAW harus bisa menjangkau port 443/80 router. |
Persiapan RouterOS
Lakukan sekali di router. Disarankan HTTPS + user least-privilege.
# 1) (HTTPS) Aktifkan service www-ssl dengan sertifikat yang sudah ada di /certificate.
# Jika belum punya sertifikat, buat self-signed dulu (lihat di bawah).
/ip/service/set www-ssl certificate=<nama-sertifikat> disabled=no
# Alternatif cepat (kurang aman): pakai HTTP biasa.
# /ip/service/set www disabled=no
# 2) Buat user khusus MikroCLAW โ JANGAN pakai 'admin' penuh.
/user/add name=mikroclaw password=<password-kuat> group=read ;# read-only
# Untuk mengizinkan operasi write, gunakan group=write atau policy kustom.
# 3) Batasi sumber yang boleh mengakses service (mis. hanya subnet LAN/host admin).
/ip/service/set www-ssl address=192.168.88.0/24Membuat sertifikat self-signed (jika belum ada):
/certificate/add name=mikroclaw-ca common-name=mikroclaw-ca key-usage=key-cert-sign,crl-sign
/certificate/sign mikroclaw-ca
/certificate/add name=mikroclaw-https common-name=<ip-atau-hostname-router>
/certificate/sign mikroclaw-https ca=mikroclaw-ca
/ip/service/set www-ssl certificate=mikroclaw-https disabled=noKarena sertifikat self-signed, biarkan
MIKROTIK_VERIFY_TLS=falsedi.env(default). Settruehanya jika memakai sertifikat yang tepercaya.
Instalasi
Pilih jalur tercepat sesuai OS Anda โ installer mengurus uv, dependency, .env, dan registrasi MCP sekaligus:
Jalur | OS | Kapan dipakai | Perintah |
๐ Bootstrap 1-baris | Windows | Belum punya repo, ingin clone + install sekaligus |
|
๐ Bootstrap 1-baris | macOS / Linux | Belum punya repo, ingin clone + install sekaligus |
|
๐ ๏ธ Installer lokal | Windows | Sudah punya repo |
|
๐ ๏ธ Installer lokal | macOS / Linux | Sudah punya repo |
|
โ Manual | semua | Ingin kontrol penuh tiap langkah |
|
Detail tiap jalur di bawah.
Windows (installer otomatis)
Installer memasang uv, dependency (termasuk Python via uv bila perlu),
menulis .env secara interaktif, dan mendaftarkan MCP server ke Claude Code.
Opsi A โ satu baris (clone + install) di PowerShell:
irm https://raw.githubusercontent.com/Syamsuddin/MikroCLAW/main/bootstrap.ps1 | iexOpsi B โ sudah punya repo: masuk folder MikroCLAW lalu double-click
install.bat, atau di PowerShell:
.\install.ps1Argumen berguna: -MikrotikHost 192.168.88.1 -MikrotikUser mikroclaw,
-AllowWrite (izinkan write), -NonInteractive, -SkipMcpRegister.
Lepas instalasi: .\uninstall.ps1 (tambah -RemoveEnv / -RemoveVenv).
Jika PowerShell memblokir skrip, jalankan lewat
install.bat(sudah pakai-ExecutionPolicy Bypass) atau jalankan PowerShell sebagai:powershell -ExecutionPolicy Bypass -File .\install.ps1.
macOS / Linux (installer otomatis)
Installer memasang uv, dependency (termasuk Python via uv bila perlu), menulis
.env (mode 600), dan mendaftarkan MCP server ke Claude Code.
Opsi A โ satu baris (clone + install):
curl -LsSf https://raw.githubusercontent.com/Syamsuddin/MikroCLAW/main/bootstrap.sh | bashOpsi B โ sudah punya repo:
cd /path/ke/MikroCLAW
./install.shArgumen berguna: --host 192.168.88.1 --user mikroclaw, --allow-write,
--http, --non-interactive, --skip-mcp.
Lepas instalasi: ./uninstall.sh (tambah --remove-env / --remove-venv).
Manual (Windows / macOS / Linux)
cd /path/ke/MikroCLAW
cp .env.example .env # lalu isi host + kredensial router
uv sync # pasang dependency (mcp, httpx, python-dotenv)uv sync membuat virtualenv .venv/ dan menginstal proyek beserta dependensinya.
Konfigurasi (.env)
Semua konfigurasi lewat environment / file .env (otomatis dibaca saat server start).
Variabel | Wajib | Default | Keterangan |
| โ | โ | IP/hostname router, mis. |
| โ |
| User RouterOS (disarankan user khusus least-privilege). |
| โ | (kosong) | Password user tersebut. |
| โ |
|
|
| โ |
| Port REST. Default mengikuti |
| โ |
| Verifikasi sertifikat TLS. |
| โ |
| Timeout request (detik). |
| โ |
| Gerbang keamanan. |
Contoh .env minimal:
MIKROTIK_HOST=192.168.88.1
MIKROTIK_USER=mikroclaw
MIKROTIK_PASSWORD=rahasia-kuat
MIKROTIK_USE_TLS=true
MIKROTIK_VERIFY_TLS=false
MIKROCLAW_ALLOW_WRITE=falseMenghubungkan ke Claude Code
File .mcp.json sudah disertakan (scope project), isinya:
{
"mcpServers": {
"mikroclaw": {
"command": "uv",
"args": ["run", "--directory", "/Users/syams/PROJECTS/MikroCLAW", "mikroclaw"]
}
}
}Server berjalan via stdio; kredensial diambil dari .env (bukan dari file
ini), jadi .mcp.json aman untuk di-commit.
Langkah di Claude Code:
/mcp # cek server "mikroclaw" muncul & status connectedSaat pertama kali, Claude Code akan meminta persetujuan untuk menjalankan MCP server project-scope โ setujui untuk mengaktifkannya.
Ingin dipakai di semua proyek, bukan cuma folder ini? Daftarkan sebagai user-scope:
claude mcp add mikroclaw -s user -- uv run --directory /Users/syams/PROJECTS/MikroCLAW mikroclaw
Daftar tool
100 tool terbagi dua kelas: READ (selalu aktif) dan WRITE (digerbang flag).
pie showData
title Distribusi 100 tool MikroCLAW
"Read (selalu aktif)" : 78
"Write (digerbang)" : 22Cakupan domain READ (ringkas):
Domain | Contoh tool |
๐ฅ๏ธ Sistem & perangkat |
|
๐ Interface & L2 |
|
๐ IP & routing |
|
๐ก๏ธ Firewall & NAT |
|
๐ถ WiFi & CAPsMAN |
|
๐ VPN & tunnel |
|
๐ QoS & bandwidth |
|
๐ IPv6 |
|
๐งญ Routing dinamis |
|
๐ฅ Hotspot & AAA |
|
๐ Keamanan & audit |
|
๐ฉบ Diagnostik |
|
๐งญ Deteksi peran |
|
๐ค Fitur cerdas AI |
|
Read โ selalu aktif
Tool | Parameter | Fungsi | REST |
| โ | Versi RouterOS, CPU, memori, uptime, board, arsitektur. |
|
| โ | Nama/identitas perangkat. |
|
| โ | Semua interface + status running/disabled + statistik. |
|
| โ | Alamat IP per interface. |
|
| โ | Klien DHCP yang mendapat IP dari router. |
|
| โ | Pemetaan IP โ MAC yang terlihat router. |
|
| โ | Aturan firewall filter (input/forward/output). |
|
| โ | Aturan NAT (masquerade, port forward). |
|
| โ | Tabel routing IP (route aktif & statis). |
|
| โ | Simple queue โ pembatasan bandwidth per IP/target. |
|
| โ | Isi semua firewall address-list. |
|
| โ | Konfigurasi DNS: server upstream, cache, allow-remote. |
|
| โ | DHCP server + interface & address-pool-nya. |
|
| โ | Sesi PPP aktif (PPPoE/L2TP/PPTP/SSTP). |
|
| โ | Tabel host bridge (MAC per port). |
|
| โ | Tetangga terdeteksi (MNDP/CDP/LLDP). |
|
| โ | Sensor HW: suhu, tegangan, kipas (jika ada). |
|
| โ | Host yang dipantau Netwatch + status up/down. |
|
| โ | Daftar user RouterOS + grup/hak aksesnya. |
|
| โ | Interface WiFi (auto wifiwave2/legacy). |
|
| โ | Klien WiFi yang terhubung (auto wifiwave2/legacy). |
|
| โ | Interface WireGuard (VPN) + public key & port. |
|
| โ | Peer WireGuard + allowed-address & handshake. |
|
| โ | Akun PPP (PPPoE/VPN) โ name/service/profile. |
|
| โ | IP pool (rentang IP untuk DHCP/PPP). |
|
| โ | Entri DNS statis (A/CNAME) yang dilayani router. |
|
| โ | Status & konfigurasi NTP client. |
|
| โ | Tugas terjadwal RouterOS. |
|
| โ | Script tersimpan di RouterOS. |
|
| โ | Interface VLAN + vlan-id & interface induk. |
|
| โ | Service IP (api/ssh/www/telnet/winbox) + port. |
|
| โ | Status DHCP client (mis. IP WAN dari ISP). |
|
| โ | IP publik & DDNS MikroTik (remote access). |
|
| โ | Paket RouterOS terpasang + status. |
|
| โ | Model, serial, firmware terpasang vs tersedia. |
|
| โ | User yang sedang login (audit keamanan). |
|
| โ | File di router (backup/export) + ukuran & waktu. |
|
| โ | Connection tracking aktif (troubleshooting). |
|
| โ | Pemetaan port ke bridge. |
|
| โ | Sertifikat + masa berlaku (audit kedaluwarsa). |
|
| โ | Isi cache DNS resolver router. |
|
| โ | Gateway/DNS/netmask yang ditawarkan DHCP. |
|
| โ | Aturan mangle (marking QoS/policy routing). |
|
| โ | Queue tree (bandwidth hierarkis berbasis mark). |
|
| โ | Profil PPP (rate-limit, pool, DNS). |
|
| โ | Grup hak akses + policy (audit keamanan). |
|
| โ | Detail port ethernet (link speed, auto-neg). |
|
| โ | Konfigurasi peer IPsec. |
|
| โ | Tunnel IPsec yang sedang aktif. |
|
| โ | Alamat IPv6 per interface. |
|
| โ | Tabel routing IPv6. |
|
| โ | Aturan firewall filter IPv6. |
|
| โ | Tabel neighbor IPv6 (NDP). |
|
| โ | Server hotspot + interface & profil. |
|
| โ | User hotspot yang sedang login. |
|
| โ | Akun user hotspot. |
|
| โ | CAP/AP yang dikelola CAPsMAN (auto legacy/wifiwave2). |
|
| โ | Klien via CAPsMAN (auto legacy/wifiwave2). |
|
| โ | Radio WiFi fisik (wifiwave2). |
|
| โ | Sesi BGP (v7). |
|
| โ | Neighbor OSPF + state adjacency (v7). |
|
| โ | Server RADIUS (AAA). |
|
| โ | Riwayat perubahan config (undo). |
|
| โ | Info lisensi (level/CHR). |
|
|
| Log terbaru RouterOS. |
|
|
| Ping dari router ke sebuah alamat (diagnostik). |
|
|
| Traceroute (jejak hop) dari router. |
|
|
| Satu sampel throughput real-time (rx/tx bps). |
|
| โ | Cek update RouterOS (tidak mengubah config). |
|
| โ | Deteksi peran perangkat (gateway NAT, firewall, BGP/OSPF, switch/AP, BRAS, VPN, DHCP/DNS, QoS, dll) + bukti & keyakinan. | multi |
|
| Twin โ telusuri paket hipotetis menembus mangleโdst-natโroutingโfilterโsrc-nat di atas ruleset live; lapor verdict + jejak. | multi |
|
| Twin โ uji dampak satu aturan firewall baru SEBELUM diterapkan (diff verdict). | multi |
|
| Sentinel โ sidik-jari perilaku per-perangkat dari conntrack; deteksi botnet IoT/miner/scan tanpa signature, berkonteks kelas perangkat. |
|
|
| Chronicle โ simpan snapshot konfigurasi relevan-keamanan (ber-hash) ke disk lokal. | multi |
|
| Chronicle โ diff konfigurasi live vs snapshot terakhir + penilaian risiko (user baru, port mgmt dibuka, persistensi, dll). | multi |
|
| Replay โ rekonstruksi telemetri jendela waktu lampau (riwayat Pulse) + anomali untuk RCA "kenapa tadi lemot". | file riwayat lokal |
|
| Concierge โ terjemahkan telemetri jadi sinyal bisnis RT-RW net (pelanggan, akun nganggur, pencuri bandwidth, utilisasi WAN). | multi |
|
| GET generic ke path REST apa pun (read-only). |
|
Contoh rest_get untuk hal yang belum punya tool khusus:
ip/dns, ppp/active, interface/wireless, system/clock, queue/simple.
Write โ perlu MIKROCLAW_ALLOW_WRITE=true
Jika flag bernilai false (default), tool ini mengembalikan error dan tidak
menyentuh router.
Tool | Parameter | Fungsi | REST |
|
| Aktif/nonaktifkan interface (by |
|
|
| Tambah aturan DROP untuk sumber tertentu. |
|
|
| Tambah IP/subnet ke firewall address-list. |
|
|
| Hapus satu aturan firewall filter by |
|
|
| Aktif/nonaktifkan satu aturan firewall by |
|
|
| Tambah simple queue (batas bandwidth target). |
|
|
| Buat file backup konfigurasi (.backup) di router. |
|
| โ | Reboot router sekarang (mengganggu koneksi). |
|
|
| Tambah entri DNS statis (A record). |
|
|
| Tambah akun PPP (PPPoE/VPN). |
|
|
| Tambah peer WireGuard. |
|
|
| Aktif/nonaktifkan IP service (mis. matikan telnet). |
|
|
| Tambah NAT: port-forward (dstnat) / masquerade (srcnat). |
|
|
| Tambah route statis (termasuk default route). |
|
|
| Pin IP statis ke MAC (static lease). |
|
|
| Pasang IP (CIDR) ke interface. |
|
|
| Ganti nama/identitas router. |
|
|
| Set DNS upstream router. |
|
|
| Hapus entri address-list by |
|
|
| Tambah akun user hotspot. |
|
|
| Pasang alamat IPv6 ke interface. |
|
|
| Write generic untuk operasi lanjutan. Gunakan hati-hati. | sesuai |
Skills (playbook orkestrasi)
Selain 100 tool atomik, MikroCLAW menyertakan Agent Skills di
.claude/skills/ โ playbook yang mengoordinasikan banyak tool
menjadi alur kerja siap pakai. Claude Code memuatnya otomatis saat frasa pemicunya
muncul; bisa juga dipanggil eksplisit dengan /<nama-skill>.
Skill | Fungsi | Pemicu contoh |
| Laporan kesehatan & maintenance (resource, suhu, firmware, update, WAN, NTP). | "cek kesehatan router", "ada update routeros?" |
| Tinjau filter/NAT/mangle, address-list, koneksi; temuan + rekomendasi. | "audit firewall", "firewall monitoring" |
| Hardening: service terbuka, user/grup, sesi, sertifikat, DNS, proteksi input. | "audit keamanan", "apakah router aman" |
| Snapshot inventaris: WAN, subnet, interface/VLAN, routing, klien, tetangga. | "overview jaringan", "dokumentasi config" |
| Diagnosa konektivitas berlapis (L1โIPโDNSโfirewall). | "internet mati", "tidak bisa browsing" |
| Backup biner + snapshot JSON konfigurasi kunci untuk diff/dokumentasi. | "backup mikrotik", "snapshot sebelum perubahan" |
| Deteksi & jelaskan peran perangkat (gateway/firewall/BGP/AP/BRAS/VPN/โฆ) beserta bukti & keyakinan. | "deteksi peran mikrotik", "router ini berfungsi sebagai apa" |
| Simulator what-if โ telusuri nasib paket & uji aturan firewall baru sebelum diterapkan. | "kalau klien X akses Y lolos?", "simulasikan rule ini", "uji firewall sebelum pasang" |
| Deteksi perangkat terinfeksi โ botnet IoT/miner/scan dari perilaku koneksi, tanpa signature. | "ada perangkat terinfeksi?", "cek botnet", "kenapa CCTV ini aneh" |
| Mesin waktu konfigurasi โ snapshot + diff berisiko untuk deteksi perubahan/intrusi. | "apa yang berubah di config?", "deteksi perubahan tak terjadwal", "ada backdoor?" |
| RCA retrospektif โ jelaskan insiden masa lampau dari riwayat telemetri. | "kenapa tadi sore lemot?", "internet sempat putus jam berapa" |
| Laporan bisnis โ pelanggan, akun nganggur, pencuri bandwidth, utilisasi WAN, kapan upgrade. | "laporan bisnis RT-RW net", "ada yang nyolong bandwidth?", "perlu upgrade paket?" |
Semua skill read-only secara default; remediasi yang mengubah konfigurasi selalu
meminta konfirmasi dan tetap butuh MIKROCLAW_ALLOW_WRITE=true.
MikroCLAW Pulse โ dashboard monitoring live
Selain MCP server, MikroCLAW menyertakan Pulse: laman web monitoring yang memperbarui indikator per detik lewat Server-Sent Events.
Fase 1 โ data plane: read-only, tanpa dependency baru (memakai Starlette + uvicorn yang sudah ikut
mcp). Memantau RouterOS bertingkat & menyusun state live.Fase 2 โ lapis AI (opsional): kartu ๐ง AI Analyst menarasikan kondisi jaringan, mendeteksi anomali tanpa ambang tetap, mengkorelasikan akar masalah, dan menyarankan remediasi โ memanggil Anthropic Messages API langsung via
httpx(tanpa SDK), output terstruktur lewat tool-use. Tetap read-only (hanya membaca snapshot). Aktif bilaANTHROPIC_API_KEYdi-set; tanpa itu Pulse tetap jalan dan kartu AI menampilkan status "nonaktif".Fase 3 โ AI proaktif: ๐ฎ Prediksi tren deterministik (regresi linear dari riwayat โ tren %/jam + ETA mencapai ambang untuk CPU/memori/disk โ jalan tanpa API key), plus โก Remediasi 1-klik yang diusulkan AI dan dieksekusi dari dashboard. Remediasi di-gate ganda: butuh
MIKROCLAW_ALLOW_WRITE=truedan hanya aksi dari allowlist sempit (blokir_ip,tambah_address_list,nonaktifkan_service) yang persis diusulkan AI โ tiap aksi diberi komentar auditadded-by-pulse-ai.
# memakai kredensial yang sama dari .env
uv run mikroclaw-web # atau: python -m mikroclaw.web
# buka http://127.0.0.1:8800Arsitektur Pulse โ empat loop polling bertingkat โ state in-memory โ SSE โ browser:
flowchart LR
subgraph poller["poller.py โ empat loop async"]
F["โก fast ยท 1 dtk<br/>resource ยท health ยท throughput"]
M["๐ mid ยท 5 dtk<br/>klien ยท firewall ยท queue"]
S["๐ข slow ยท 30 dtk<br/>WAN ยท service ยท sertifikat"]
P["๐ก ping ยท 5 dtk<br/>RTT gateway & 8.8.8.8"]
end
ROS["๐ก RouterOS<br/>REST v7"]
STATE[("๐ง state in-memory<br/>+ ring-buffer 60 dtk")]
APP["app.py<br/>Starlette + SSE"]
UI["๐ index.html<br/>(vanilla JS, 0 dependency)"]
ROS --> F & M & S & P
F & M & S & P --> STATE
STATE -- "snapshot tiap tick" --> APP
APP -- "/api/stream (SSE)" --> UI
classDef box fill:#10182a,stroke:#1f2d44,color:#e6edf3;
class F,M,S,P,ROS,STATE,APP,UI box;๐ก Throughput diturunkan dari delta counter rx/tx
/interface(satu request untuk semua interface), bukanmonitor-trafficper-interface โ jauh lebih ringan untuk router.
ENV | Default | Keterangan |
|
| Alamat bind. Set |
|
| Port HTTP laman. |
| (kosong) | Mengaktifkan lapis AI (Fase 2). Tanpa ini, kartu AI tampil "nonaktif". |
|
| Model Claude untuk analisis. |
|
| Detik antar-analisis otomatis. |
|
| Batas token output analisis. |
Yang ditampilkan (semua dari tool read yang ada):
Vitals (1 dtk): CPU, memori, disk, suhu/tegangan, jumlah klien, firewall drops/dtk, conntrack, sesi login, sertifikat terdekat kedaluwarsa.
WAN: IP WAN/publik, DDNS, gateway, RTT ping gateway &
8.8.8.8, sparkline download/upload 60 detik.Interface matrix (1 dtk): throughput rx/tx live (delta counter), status link, link-speed, error/drop.
Klien: gabungan DHCP + PPPoE + hotspot + WiFi (sinyal), tebakan vendor dari OUI MAC, dan bandwidth per-klien bila ada simple queue yang cocok.
Service terbuka: ditandai merah bila berisiko (telnet/ftp/www/api) tanpa batasan
address.Log Stream: tail
/logterbaru dengan pewarnaan severity (error/warning).๐ง AI Analyst (Fase 2): status sehat/perhatian/kritis, ringkasan naratif, daftar anomali ber-severity, dan rekomendasi โ plus tombol "Analisa sekarang".
๐ฎ Prediksi Tren (Fase 3): tren & ETA CPU/memori/disk (deterministik, tanpa API key).
โก Remediasi 1-klik (Fase 3): tombol eksekusi aksi yang diusulkan AI (muncul ter-kunci bila write-gate mati).
Cadence bertingkat (1 dtk vitals/interface ยท 5 dtk klien & ping ยท 30 dtk WAN/
service/sertifikat & sampel prediksi ยท analisis AI default 60 dtk) agar tidak
membebani router. Endpoint: / (laman), /api/stream (SSE), /api/snapshot
(JSON sekali ambil), /api/analyze (POST โ picu analisis AI), /api/remediate
(POST โ eksekusi 1 aksi remediasi; butuh ALLOW_WRITE).
Contoh penggunaan
Cukup minta dalam bahasa biasa di Claude Code:
"Tampilkan versi RouterOS dan pemakaian CPU/memori." โ
system_resource"Siapa saja klien DHCP yang aktif sekarang?" โ
dhcp_leases"Interface mana yang sedang down?" โ
list_interfaces"Tunjukkan 100 baris log terakhir yang mengandung error." โ
recent_logs+ filter"Ping 8.8.8.8 dari router." โ
ping"Apa konfigurasi DNS router?" โ
rest_get path=ip/dns"Blokir IP 10.0.0.5 di firewall." โ
add_firewall_drop(butuhALLOW_WRITE=true)"Nonaktifkan interface ether5." โ
set_interface_enabled(butuhALLOW_WRITE=true)
Uji manual tanpa Claude
Memastikan REST hidup & kredensial benar sebelum menyalakan dari Claude:
source .env
curl -sk -u "$MIKROTIK_USER:$MIKROTIK_PASSWORD" \
"https://$MIKROTIK_HOST/rest/system/resource" | jq .Uji server MCP-nya sendiri (memuat & mendaftarkan tool, tanpa konek router):
uv run python -c "
import asyncio
from mikroclaw.server import mcp
tools = asyncio.run(mcp.list_tools())
print(f'{len(tools)} tools:', ', '.join(t.name for t in tools))
"Test suite (pytest)
Tersedia unit test untuk client REST, helper poller, prediksi/throughput, remediasi, lapis AI, dan endpoint Pulse โ semuanya offline (httpx di-mock, tanpa router/jaringan/biaya API):
uv run --extra test pytest # memasang & menjalankan pytest (extra 'test')83 passed in 0.45sKeamanan
User least-privilege โ buat user khusus (mis. grup
read); jangan pakaiadminpenuh.Pisahkan kredensial โ hanya di
.env, yang sudah masuk.gitignore. Jangan tempel password di chat atau di.mcp.json.Gunakan TLS โ
MIKROTIK_USE_TLS=true. SetMIKROTIK_VERIFY_TLS=truesetelah memasang sertifikat tepercaya.Batasi sumber akses di router:
/ip/service/set www-ssl address=<subnet-tepercaya>.Write off by default โ biarkan
MIKROCLAW_ALLOW_WRITE=falsekecuali memang sedang melakukan perubahan; matikan lagi sesudahnya.Audit โ operasi
add_firewall_dropmenyertakan komentaradded-by-mikroclawagar mudah ditelusuri/dihapus.
Troubleshooting
Gejala | Kemungkinan sebab | Solusi |
|
|
|
| Port REST tertutup / host salah / firewall | Cek |
| User/password salah | Periksa |
| Path tidak ada di versi RouterOS ini | Cek nama path; sebagian fitur beda antar versi. |
Error sertifikat / SSL | Self-signed + verify aktif | Set |
| Mencoba tool write saat gate off | Set |
Server tak muncul di |
| Jalankan |
Perubahan | Server masih pakai proses lama | Restart koneksi MCP (toggle via |
Kompatibilitas RouterOS v6 vs v7
REST API hanya ada di RouterOS v7. Jika router Anda v6:
Antarmuka tool di
server.pytidak perlu berubah.Ganti lapisan transport di
client.pyke API biner (port8728/8729TLS) memakai library sepertilibrouteros.RouterOSClient.get/put/patch/deletecukup dipetakan ke perintah API biner; sisanya (config, server, daftar tool) tetap sama.
API biner juga bekerja di v7, sehingga bisa dipakai sebagai transport tunggal lintas versi bila diinginkan.
Struktur proyek
MikroCLAW/
โโโ .mcp.json # registrasi server untuk Claude Code (project-scope)
โโโ .env.example # template variabel environment
โโโ .env # kredensial nyata (di-gitignore, buat sendiri)
โโโ .gitignore
โโโ pyproject.toml # metadata + dependency + entry point `mikroclaw`
โโโ README.md
โโโ CLAUDE.md # panduan repo untuk Claude Code (arsitektur & konvensi)
โโโ LICENSE # Apache License 2.0
โโโ install.ps1 / install.sh # installer (Windows / macOS+Linux)
โโโ install.bat # launcher double-click untuk install.ps1
โโโ uninstall.ps1 / uninstall.sh# lepas registrasi MCP (opsi hapus .env/.venv)
โโโ bootstrap.ps1 / bootstrap.sh# clone + install satu baris
โโโ tests/ # unit test pytest (offline, httpx di-mock)
โโโ .claude/skills/ # Agent Skills (playbook orkestrasi tool)
โ โโโ mikrotik-health-check/SKILL.md
โ โโโ mikrotik-firewall-audit/SKILL.md
โ โโโ mikrotik-security-audit/SKILL.md
โ โโโ mikrotik-network-overview/SKILL.md
โ โโโ mikrotik-troubleshoot/SKILL.md
โ โโโ mikrotik-backup-snapshot/SKILL.md
โ โโโ mikrotik-role-detect/SKILL.md
โ โโโ mikrotik-twin/SKILL.md # ๐ simulator what-if
โ โโโ mikrotik-sentinel/SKILL.md # ๐ deteksi perangkat terinfeksi
โ โโโ mikrotik-chronicle/SKILL.md # ๐ mesin waktu konfigurasi
โ โโโ mikrotik-replay/SKILL.md # ๐ RCA retrospektif
โ โโโ mikrotik-concierge/SKILL.md # ๐ laporan bisnis
โโโ src/mikroclaw/
โโโ __init__.py # versi paket
โโโ config.py # baca .env/env โ objek Config + validasi
โโโ client.py # client REST RouterOS v7 (async httpx)
โโโ roles.py # classify_roles: deteksi peran dari bukti (murni)
โโโ storage.py # ๐ helper state dir lokal (Chronicle & Replay)
โโโ twin.py # ๐ Twin: engine simulator paket (murni)
โโโ sentinel.py # ๐ Sentinel: sidik-jari perilaku perangkat (murni)
โโโ chronicle.py # ๐ Chronicle: snapshot/diff/risiko konfigurasi (murni)
โโโ concierge.py # ๐ Concierge: telemetri โ sinyal bisnis (murni)
โโโ server.py # FastMCP + definisi 100 tool + write-gate
โโโ web/ # MikroCLAW Pulse โ dashboard monitoring live
โโโ poller.py # data plane: poll bertingkat + ring-buffer + throughput + prediksi
โโโ history.py # ๐ Replay: persistensi riwayat telemetri + ringkasan jendela
โโโ analyst.py # lapis AI (Fase 2): Anthropic Messages API via httpx
โโโ actions.py # remediasi 1-klik (Fase 3): allowlist aksi write yang aman
โโโ app.py # Starlette + SSE + endpoint analyze/remediate + entry `mikroclaw-web`
โโโ static/
โโโ index.html # dashboard vanilla JS (tanpa dependency eksternal)Pengembangan: menambah tool
Tambahkan fungsi async di src/mikroclaw/server.py dengan dekorator @mcp.tool().
Docstring menjadi deskripsi tool yang dilihat Claude โ tulis sejelas mungkin.
Contoh menambah daftar simple queue (read):
@mcp.tool()
async def simple_queues() -> Any:
"""Daftar simple queue (pembatasan bandwidth per target)."""
return await _ros().get("/queue/simple")Contoh tool write (selalu panggil _require_write() di awal):
@mcp.tool()
async def reboot_router() -> Any:
"""Reboot router. BUTUH MIKROCLAW_ALLOW_WRITE=true."""
_require_write()
return await _ros().post("/system/reboot")Setelah mengubah kode, restart koneksi MCP di Claude Code (/mcp) agar tool baru
terdeteksi. Verifikasi cepat:
uv run python -c "import asyncio; from mikroclaw.server import mcp; print(len(asyncio.run(mcp.list_tools())), 'tools')"Riwayat versi
Versi | Sorotan |
v1.7.0 | 5 fitur cerdas AI โ Twin (simulator what-if paket: |
v1.6.0 | Deteksi peran โ tool |
v1.5.0 | Pulse Fase 3 โ AI proaktif: prediksi tren deterministik (CPU/mem/disk + ETA) & remediasi 1-klik ter-gate ganda (write-flag + allowlist + cocok usulan AI) lewat |
v1.4.0 | Pulse Fase 2 โ lapis AI Analyst (Anthropic Messages API via httpx, read-only, output terstruktur lewat tool-use) + Log Stream dengan pewarnaan severity + endpoint |
v1.3.0 | MikroCLAW Pulse โ laman web monitoring live per-detik (Starlette + SSE, read-only; tanpa dependency baru). |
v1.2.0 | Installer macOS / Linux (bash) + bootstrap satu-baris. |
v1.1.0 | Installer Windows (PowerShell) + bootstrap satu-baris. |
v1.0.0 | Rilis awal โ MCP server (92 tool: 70 read + 22 write) + 6 Agent Skills. |
Penomoran mengikuti urutan milestone fitur pada histori git; rincian tiap perubahan ada di
git log.
Lisensi
Dirilis di bawah Apache License 2.0 โ lihat LICENSE.
MikroCLAW dibuat untuk administrasi MikroTik yang sah pada perangkat milik/dikuasakan kepada Anda. Gunakan secara bertanggung jawab.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Syamsuddin/MikroCLAW'
If you have feedback or need assistance with the MCP directory API, please join our Discord server