routeros-inspector-mcp

routeros-inspector-mcp

A constrained, read-only MCP server for MikroTik RouterOS inventory inspection and policy-backed audits.

Category
Visit Server

README

routeros-inspector-mcp

A constrained, read-only MCP server for MikroTik RouterOS inventory inspection and policy-backed audits.

The server is fixture-only by default. Live access requires an explicit --live flag, inventory-defined devices, read-only credentials, and fail-closed transport configuration. It does not expose arbitrary RouterOS commands or mutation tools.

Safety model

  • No arbitrary command execution
  • No mutation, reboot, restore, firmware, or user-management tools
  • No caller-supplied hosts or IP addresses; callers select inventory device IDs only
  • Fixture-only operation unless --live is explicitly supplied
  • Verified API-SSL with pinned CA trust, hostname verification, and TLS 1.2+
  • No plaintext downgrade when TLS is configured
  • Allowlisted client errors and redacted outputs
  • Bounded audit fan-out
  • Stdio by default; optional HTTP is forced to 127.0.0.1

See docs/deployment.md for the complete deployment boundary and CHANGELOG.md for release history.

Requirements

  • Python 3.11+
  • RouterOS 7 for live API use
  • ansible-vault only when using the included Vault credential provider

Installation

python -m venv .venv
. .venv/bin/activate
python -m pip install -e '.[test]'

Fixture-first quick start

The checked-in inventory, policy, and RouterOS data are purpose-built synthetic examples. They contain no live-derived topology.

routeros-inspector list-devices --summary
routeros-inspector audit \
  --devices edge-router,core-switch \
  --audits vlan_consistency,wan_failover_state,snmp_scope \
  --summary
python scripts/smoke_mcp_fixture.py
python -m routeros_inspector_mcp.server --transport stdio

Fixture mode never constructs a live RouterOS backend, even if an explicitly supplied inventory declares live transports.

Configuration

Copy the synthetic examples before configuring live access:

cp config/devices.example.yaml config/devices.yaml
cp config/policy.example.yaml config/policy.yaml

config/devices.yaml and config/policy.yaml are ignored because real inventories and policies reveal operational details. Keep certificates and live captures outside the repository.

A verified API-SSL inventory entry looks like:

devices:
  edge-router:
    role: gateway
    risk: critical
    host: router.example.net
    transport: api
    credential_ref: vault_mikrotik_readonly
    allowed: true
    routeros_api_port: 8729
    routeros_api_tls: true
    routeros_api_certificate: /absolute/path/to/router-ca.pem
    routeros_api_server_name: router.example.net

TLS mode requires TCP/8729, a readable CA/certificate path, and a nonempty DNS name or IP SAN identity. Configuration errors fail closed and never trigger plaintext fallback.

Credential provider

The included provider resolves <credential_ref>_username and <credential_ref>_password from an Ansible Vault without logging values. Configure it with:

export ROUTEROS_INSPECTOR_VAULT_DIR="$HOME/.config/routeros-inspector-mcp"
export ROUTEROS_INSPECTOR_VAULT_FILE="vault.yml"
export ROUTEROS_INSPECTOR_VAULT_PASSWORD_FILE=".vault_pass"

The two file variables may also be absolute paths. Use a dedicated RouterOS read-only identity. Do not use a personal administrator or write-capable credential.

MCP tools

The server exposes fixed collectors such as device summaries, interfaces, bridge VLANs, routes, firewall tables, DHCP/ARP state, queues, WireGuard metadata, and IP services. It also exposes named audits for firmware, SNMP scope, STP, VLAN/trunk consistency, route ownership, WAN failover, encrypted DNS, QoS/DSCP, and backup metadata.

Tool responses omit connection details and credential references. Sensitive RouterOS fields are redacted.

Private fixture capture

scripts/refresh_routeros_fixture.py can transform an existing private artifact directory without network access. Live collection additionally requires the explicit --capture-live flag and explicit Ansible root, inventory, playbook, and Vault password paths. Captures still reveal topology and policy and default to the ignored artifacts/private-fixtures/ directory. Never copy them into tests/fixtures/routeros/ or commit them. Public tests must use purpose-built synthetic fixtures.

Development

make ci

Equivalent commands:

ruff check .
pytest -n auto -q
python -m compileall -q src tests

Security

Please read SECURITY.md before enabling live mode. Report vulnerabilities privately rather than opening a public issue.

License

MIT — see LICENSE.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured