DrayTek Vigor MCP Server
This server provides MCP tools to diagnose and interact with a DrayTek Vigor 167 modem over its interactive SSH CLI.
Discover available CLI commands via
?with on-disk caching.Run a single arbitrary DrayTek CLI command over SSH.
Run multiple CLI commands in one SSH session.
Retrieve DSL sync status and line information (
exec dslinfo).Retrieve firmware and device information (
exec sysinfo).Retrieve device time (
exec date).Retrieve open services/ports (
exec services).Retrieve config profile status (
exec cfg status).Return a cached command-tree summary or refresh it if missing.
Click on "Deploy 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., "@DrayTek Vigor MCP Server Check the DSL status"
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.
DrayTek Vigor 167 MCP Server
MCP-Server für DSL-Diagnose und CLI-Zugriff am DrayTek Vigor 167 (Firmware 5.2.8) über interaktive SSH-Shell.
Befehle werden nicht geraten: Discovery läuft live gegen das Gerät (? / help) und wird unter cache/command_tree.json gecacht. Convenience-Tools und Parser basieren auf verifiziertem CLI-Output.
Status
Komponente | Status |
Python venv ( |
|
Cursor MCP ( | Noch nicht eingetragen — siehe Abschnitt Cursor einbinden |
| Lokal vorhanden, nicht im Git |
Related MCP server: mikrotik-mcp
Voraussetzungen
Python 3.11+
Netzwerkzugang zum Modem (Standard:
192.168.167.1:22)Cursor oder anderer MCP-Client
DrayTek Vigor 167 mit eingeschränkter Bridge-CLI (kein voller DrayOS-Befehlssatz)
Schnellstart
cd ~/Workspaces/draytek-vigor-mcp
python -m venv .venv
source .venv/bin/activate
pip install "mcp[cli]" paramiko.env anlegen (Format siehe unten), dann Discovery testen:
.venv/bin/python discover.py 2 --refresh
.venv/bin/python -c "from vigor_ssh import run_command; print(run_command('exec dslinfo'))"Server manuell starten (stdio-MCP):
.venv/bin/python server.pyCredentials (.env)
Nicht committen (steht in .gitignore). Kein Standard-dotenv — Parsing: erstes : trennt Schlüssel und Wert, umschließende " am Wert werden entfernt.
mcp:"geheim"
VIGOR_HOST:"192.168.167.1"
VIGOR_PORT:"22"Optional:
VIGOR_PROMPT:"vigor>\\s*$"
VIGOR_IDLE_SEC:"0.8"Die erste Zeile ohne reservierten Schlüssel (VIGOR_*) ist der CLI-Benutzername; der Wert ist das CLI-Passwort.
SSH- und CLI-Ablauf (Vigor 167)
Am 167 unterscheidet sich der Ablauf von klassischen DrayTek-Routern:
SSH-Transport:
auth_none(kein SSH-Passwort/Key nötig)Interaktive Shell:
invoke_shell+ PTY —exec_commandliefert oft leere AusgabeCLI-Login: Gerät fragt
Username:/Password:(Credentials aus.env)Prompt:
vigor>Neue Session pro Aufruf: Das Modem beendet idle SSH-Sessions
enable ist in der CLI vorhanden, aber am Vigor 167 ohne konfigurierbares Passwort nutzlos (Access denied). DSL-Diagnose funktioniert ohne privilegierten Modus.
Cursor einbinden
Eintrag in ~/.cursor/mcp.json unter mcpServers ergänzen:
{
"mcpServers": {
"draytek-vigor": {
"command": "/home/ladwein/Workspaces/draytek-vigor-mcp/.venv/bin/python",
"args": ["/home/ladwein/Workspaces/draytek-vigor-mcp/server.py"],
"cwd": "/home/ladwein/Workspaces/draytek-vigor-mcp"
}
}
}Danach Cursor neu laden oder MCP-Server in den Einstellungen aktivieren.
MCP-Tools
Tool | CLI-Befehl | Beschreibung |
|
| Befehlsbaum vom Gerät (gecacht) |
| beliebig | Einzelbefehl ausführen |
| beliebig | Mehrere Befehle in einer SSH-Session |
|
| Sync-Status, Profil, Raten, SNR |
|
| Modell, Firmware, Build-Infos |
|
| Gerätezeit |
|
| Offene Dienste/Ports |
|
| Config-Profil-Status |
| — | Gecachter Discovery-Baum |
run_command / run_commands decken per Definition alle vom Gerät akzeptierten Befehle ab. Ungültige Befehle liefern die Geräte-Fehlermeldung im Ergebnis, keine Exception nach außen.
Beispiel get_dsl_info (FW 5.2.8, verifiziert)
Status : Showtime
Mode : VDSL2
Profile : 17a
Annex : ANNEX B
DSL Version : 5.12.31.0_B_A60901
Line Uptime : …
Downstream Line Rate : … kbps
Upstream Line Rate : … kbps
SNR Downstream : … dB
SNR Upstream : … dBNicht verfügbar in exec dslinfo auf 5.2.8: Attenuation, CRC/FEC/ES/SES — dafür gibt es bewusst kein Convenience-Tool.
Verifizierter Befehlsbaum (Kurzüberblick)
Top-Level (?)
help, quit, logout, history, enable, exit, config, exec
Exec (exec ?)
date, ping, reboot_system, operation_mode, lan_mtu, wan_mtu, dot3ah_oam, y1731, dsl_dbg, dsl_35b_enhance, dsl_35b_target, process_dbg, tr069, coredump, sysinfo, telnet, cfg, services, dslinfo, nat_prio
Config (help, Auszug)
config Configuration Physical_Interface
config Configuration WAN WAN_Connections
config Monitoring DSL_Status Monitoring_DSL_General
config Monitoring DSL_Status Monitoring_DSL_Tone
config System_Maintenance Device_Settings Time
config System_Maintenance Management Access_Control
…Config-Zweige nutzen Web-Form-CLI (show / edit); ohne enable kaum schreibbar.
Vollständiger Baum: cache/command_tree.json oder discover.py 2 --refresh.
Discovery manuell
.venv/bin/python discover.py 2 --refreshParameter: Tiefe (Standard 2), --refresh erzwingt Neuerkennung.
Projektstruktur
server.py MCP-Server (FastMCP)
vigor_ssh.py SSH auth_none, CLI-Login, Prompt-Handling
discover.py Befehls-Discovery via ?
parsers.py Regex-Parser für verifizierte Ausgaben
pyproject.toml Abhängigkeiten
cache/ command_tree.json (generiert, nicht committen)
.env Credentials (lokal, nicht committen)Hinweise und Grenzen
Bridge-Modem: Absichtlich eingeschränkte CLI — kein voip/qos/etc. wie bei großen DrayOS-Routern.
Kein
enable: Privilegierte Config-Befehle über CLI nicht erreichbar.Timing:
VIGOR_IDLE_SECerhöhen (z. B.1.0), falls Ausgaben abgeschnitten werden.Credentials: Niemals in Code, Logs oder Commits — nur in
.env.Parser: Nur für tatsächlich gelieferte Felder; bei Firmware-Änderungen Discovery und Parser neu verifizieren.
Fehlerbehebung
Symptom | Ursache / Lösung |
Leere SSH-Ausgabe | Kein PTY / |
| Erwartet; am 167 kein Enable-Passwort |
| Am 167 |
Abgeschnittene CLI-Ausgabe |
|
MCP-Tools fehlen in Cursor | Eintrag in |
Lizenz / Gerät
Getestet gegen DrayTek Vigor 167, Firmware 5.2.8, Host 192.168.167.1.
License
Copyright 2026 thelad-dev. Licensed under the Apache License 2.0, see LICENSE.
Available Tools
9 toolsdiscover_commandsB
Discover CLI commands via '?' on the device. Results are cached on disk.
Inputs: depth, refresh. Returns: object
get_command_tree_summaryA
Return cached discovery tree or refresh if missing.
Inputs: no named parameters. Returns: object
get_config_statusA
Config profile status via verified command 'exec cfg status'.
Inputs: no named parameters. Returns: object
get_device_timeA
Device clock via verified command 'exec date'.
Inputs: no named parameters. Returns: object
get_dsl_infoB
DSL sync status via verified command 'exec dslinfo'.
Inputs: no named parameters. Returns: object
get_servicesA
Open CPE services via verified command 'exec services'.
Inputs: no named parameters. Returns: object
get_system_infoA
Firmware and device info via verified command 'exec sysinfo'.
Inputs: no named parameters. Returns: object
run_commandC
Run an arbitrary DrayTek CLI command over SSH.
Inputs: command (required). Returns: object
run_commandsC
Run multiple CLI commands in one SSH session.
Inputs: commands (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Each tool has a clearly distinct purpose. For example, discover_commands and get_command_tree_summary are related but serve different stages (discovery vs. cached retrieval), while run_command and run_commands differ in the number of commands executed. No two tools could be easily confused.
All tools use snake_case with a consistent pattern: get_ prefix for status retrieval, discover_ for discovery, and run_ for command execution. The naming is uniform and predictable.
9 tools is well-scoped for a network device management server. It covers discovery, common status queries, and arbitrary CLI execution without being too many or too few.
The tool set covers discovery, status checks, and command execution. While it lacks dedicated tools for some operations (e.g., interface stats, reboot), these can be achieved via run_command. Minor gaps exist but do not severely hinder common use cases.
Maintenance
Related MCP Connectors
Network, domain and website diagnostics for AI clients via MCP.
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Remote MCP server: 19 domain-hygiene and email-auth tools (DNS, SPF, DMARC, DKIM, TLS).
SSH client, server management and one remote MCP URL for your machines, with human approvals.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables SSH interactive session management through MCP, supporting commands, menus, and session lifecycle operations.1-
- AlicenseNot gradedqualityBmaintenanceTurns a MikroTik router into 310 MCP tools for AI-driven configuration over SSH, covering firewall, routing, VPN, and more.2,053 npm29MIT
- AlicenseBqualityDmaintenanceEnables AI applications to interact with Zyxel switches via CLI for network configuration, monitoring, and management, supporting SSH/Telnet sessions and MCP-compliant tools, resources, and prompts.19MIT
- AlicenseCqualityBmaintenanceEnables AI assistants to operate a DrayTek Vigor 3912S router through the full DrayOS CLI, with read-only tools by default and two-step confirm-gated writes. It also provides SQLite audit logging and safety controls like host-key pinning and command blocklists.217MIT