Get the FREE Ultimate OpenClaw Setup Guide →

junos

This is a Junos Model Context Protocol (MCP) Server project that provides a bridge between MCP-compatible clients (like Claude Desktop) and Juniper Junos network devices.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio juniper-junos-mcp-server python3 jmcp.py -f devices.json -t stdio \
  --env JUNOS_TIMEOUT="Command timeout in seconds for Junos CLI operations" \
  --env JMCP_STATELESS="Controls streamable-http session mode (default: false)"

How to use

This MCP server provides an interface to interact with Juniper Junos devices using the MCP framework. It exposes a toolset designed to let an LLM operate on network equipment via Junos CLI, enabling configuration generation, device querying, and operational commands within a controlled session. The server supports both stdio transport and, when configured, streamable-http workflows for elicitation and tool-based actions. Typical usage revolves around starting the server with a device mapping file (devices.json) and then issuing MCP tool calls to perform tasks such as retrieving device state, generating configuration snippets, or applying changes through the JunoS CLI abstraction layer. The included elicitation and dynamic-device tooling (e.g., add_device) facilitates guided interactions that can manage device inventories during an ongoing session.

How to install

Prerequisites:

  • Python 3.11 or compatible Python environment
  • Git installed
  • Access to Junos devices (or simulated devices) for testing

Installation steps:

  1. Clone the repository git clone https://github.com/Juniper/junos-mcp-server.git cd junos-mcp-server

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

  3. Prepare device mapping

    • Create a devices.json file that maps identifiers to Junos devices and connection details per your environment.
  4. Run the server (example with uv alternative not required for Python run):

    • Running directly with Python (stdio transport included in README): uv and other runners are optional; the canonical startup is: python3 jmcp.py -f devices.json -t stdio
  5. Optional: Run with uv (if you prefer the uv runner): uv run python jmcp.py -f devices.json -t stdio

Notes:

  • Ensure JUNOS_TIMEOUT and JMCP_STATELESS (and any other security-related env vars) are set appropriately for your deployment.
  • If using Docker or other containers, adjust the command and mount paths to your environment.

Additional notes

Tips and notes:

  • Security: Do not expose MCP server endpoints publicly without authentication and proper access controls. Review the Security Best Practices section in the README and enable SSH keys for Junos access.
  • Environment variables: JUNOS_TIMEOUT controls CLI operation timeouts; JMCP_STATELESS toggles session behavior for elicitation workflows like add_device. Adjust according to your deployment needs.
  • Device mapping file: devices.json must reflect your Junos devices and their connection methods. Absolute paths are recommended when running inside containers or via different runtimes.
  • Transport modes: The server supports stdio transport by default; if you plan to connect via HTTP-based tooling or external clients, ensure your transport configuration matches your client capabilities.
  • Debugging: Use the provided --help output to verify available options and ensure your devices.json path is correct. Check logs for any SSH or CLI command failures and confirm network reachability to the Junos devices.

Related MCP Servers

Sponsor this space

Reach thousands of developers