Get the FREE Ultimate OpenClaw Setup Guide →

mcp -junos

MCP server for Juniper devices running Junos. Tools for executing operational commands and changing device configuration

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio dpajin-mcp-server-junos python mcp_server_junos.py \
  --env LOG_LEVEL="Logging level (e.g., INFO, DEBUG)" \
  --env MCP_SERVER_JUNOS_HOST="IP address to bind (e.g., 0.0.0.0 for all interfaces)" \
  --env MCP_SERVER_JUNOS_PORT="Port to listen on (default 10008)" \
  --env MCP_SERVER_JUNOS_TRANSPORT="Transport type, e.g., "streamable-http" or "sse""

How to use

This Junos MCP Server provides MCP tooling for managing Juniper devices running Junos. It exposes commands to view device state and apply configuration changes, including get_fact for basic device information, show_command to run arbitrary show commands or retrieve configurations, apply_config to load and commit changes in set or the Junos format, and list_devices to enumerate locally configured devices. Clients connect to the server over the MCP transport (Streamable HTTP or SSE) and can issue the provided tools via the MCP client. For local access, you can use http://127.0.0.1:10008/sse or http://127.0.0.1:10008/mcp/ depending on the selected transport. The server supports environment-variable overrides for device access credentials and global server settings, making it convenient to deploy in containers or on hosts with preconfigured values.

How to install

Prerequisites:

  • Python 3.8+ installed on the host
  • Network access to Junos devices or properly configured inventory

Installation steps:

  1. Clone the repository: git clone <repository-url> cd mcp-server-junos

  2. Install Python dependencies: pip install -r requirements.txt

  3. Prepare configuration:

    • Rename or create the config file from the example: mv config.example.yml config.yml
    • Edit config.yml to define your global server settings and devices inventory as needed
  4. Run the MCP server: python mcp_server_junos.py

Optional: run via Docker

  • Build the image: docker build -t mcp-server-junos .
  • Run the container with environment overrides for access and host/port: docker run -d
    --net=host
    --name mcp-server-junos
    -e MCP_SERVER_JUNOS_ACCESS_DEFAULT_USER="admin"
    -e MCP_SERVER_JUNOS_ACCESS_DEFAULT_PASSWD="admin@123"
    -e MCP_SERVER_JUNOS_ACCESS_DEFAULT_PORT=830
    -e MCP_SERVER_JUNOS_HOST="0.0.0.0"
    -e MCP_SERVER_JUNOS_PORT=10008
    -e MCP_SERVER_JUNOS_TRANSPORT="streamable-http"
    mcp-server-junos:latest

Additional notes

Environment variables take precedence over configuration file values. When running in docker, you can mount a config.yml into the container or bake the file into the image before building. The tools rely on Juniper's junos-eznc Python SDK, so ensure network access to devices and that Python dependencies in requirements.txt are compatible with your environment. If you encounter connection issues, verify SSH/NETCONF credentials and device reachability. For diagnostics, enable DEBUG logs temporarily by setting LOG_LEVEL to DEBUG.

Related MCP Servers

Sponsor this space

Reach thousands of developers