MCP ExplorerExplorer

Junos Mcp Server

@Juniperon 4 days ago
13 Apache-2.0
FreeCommunity
AI Systems
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.

Overview

What is Junos Mcp Server

The Junos MCP (Model Context Protocol) server is designed for Juniper Junos devices, facilitating interactions with network equipment through a language model (LLM). It enables network administrators to communicate and manage networking devices effectively using LLMs.

Use cases

This server can be used for various purposes, including automating network management tasks, querying device configurations, troubleshooting network issues, and enhancing network monitoring through LLM-powered insights.

How to use

To use the Junos MCP server, clone the repository, install the required dependencies, and start the server using a specified JSON device mapping file. The server offers two transport options: ‘stdio’ for local testing and ‘streamable-http’ for broader applications, including integration with IDEs like VSCode.

Key features

Key features of the Junos MCP server include support for both password and SSH key-based authentication, customizable transport options, and the ability to facilitate secure communication with Junos devices. It also allows for easy integration with tools like VSCode and GitHub Copilot.

Where to use

The Junos MCP server is suitable for use in IT environments that utilize Juniper networking devices, particularly in scenarios requiring enhanced network management efficiency, integration with LLM solutions, and when there is a need for compliance with corporate security policies dealing with network infrastructure.

Content

junos-mcp-server

A Model Context Protocol (MCP) server for Juniper Junos devices that enables LLM interactions with network equipment.

⚠️ Important Security Notice

Warning: This server enables LLM access to your network infrastructure. Please review these security considerations carefully.

🔒 Security Requirements

  • Corporate Policy Compliance: Only use this server if your company’s policy allows sending data of Junos devices to LLM services.

  • Server Security: Always secure your Junos MCP server before deployment in production environments.

  • Authentication: Do not use password authentication for production deployments. We strongly recommend using SSH key-based authentication for enhanced security.

  • Deployment Strategy: Until your MCP server is properly secured, only deploy locally for testing purposes. Do not deploy remote servers in production without proper security measures.

🛡️ Security Best Practices

  • Use SSH key authentication instead of passwords
  • Implement proper network access controls
  • Monitor and log all MCP server activities
  • Regular security audits and updates
  • Follow your organization’s security policies

⚠️ Important Configuration Notice

Warning: The Junos MCP server supports configuration changes, but please ensure you only use this functionality when you want LLM-generated configurations to be loaded and committed on your Junos router.

Always review the configuration being generated by the LLM and only allow tool execution if it’s the correct configuration for your use case.

Getting started

Get the code.

git clone https://github.com/Juniper/junos-mcp-server.git
cd junos-mcp-server
pip install -r requirements.txt

Start Junos MCP server

$ python3.11 jmcp.py --help
Junos MCP Server

options:
  -h, --help            show this help message and exit
  -f DEVICE_MAPPING, --device-mapping DEVICE_MAPPING
                        the name of the JSON file containing the device mapping
  -H HOST, --host HOST  Junos MCP Server host
  -t TRANSPORT, --transport TRANSPORT
                        Junos MCP Server transport
  -p PORT, --port PORT  Junos MCP Server port

Junos MCP server supports both streamable-http and stdio transport. Do not use --host with stdio transport.

Config for Claude desktop [using stdio transport]

{
  "mcpServers": {
    "jmcp": {
      "type": "stdio",
      "command": "python3",
      "args": [
        "jmcp.py",
        "-f",
        "devices.json",
        "-t",
        "stdio"
      ]
    }
  }
}

Note: Please provide absolute path for jmcp.py and devices.json file.

Config for Claude desktop [using stdio transport and running it as a docker container]

{
  "mcpServers": {
    "jmcp": {
      "type": "stdio",
      "command": "/usr/local/bin/docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-v",
        "devices.json:/app/config/devices.json",
        "-v",
        "vsrx_keypair.pem:/app/config/vsrx_keypair.pem",
        "junos-mcp-server:latest"
      ]
    }
  }
}

Build docker container for Junos MCP Server

$ docker build -t junos-mcp-server:latest .

Note: Mount your config file (devices.json) and mount any other files, in my case I am using pem file for ssh priv key authentication so I am also mounting vsrx_keypair.pem

Junos device config

Junos MCP server supports both password based auth as well as ssh key based auth.

{
  "router-1": {
    "ip": "ip-addr",
    "port": 22,
    "username": "user",
    "auth": {
      "type": "password",
      "password": "pwd"
    }
  },
  "router-2": {
    "ip": "ip-addr",
    "port": 22,
    "username": "user",
    "auth": {
      "type": "ssh_key",
      "private_key_path": "/path/to/private/key.pem"
    }
  },
  "router-3": {
    "ip": "ip-addr",
    "port": 22,
    "username": "user",
    "auth": {
      "type": "password",
      "password": "pwd"
    }
  }
}

Note: Port value should be an integer (typically 22 for SSH).

VSCode + GitHub Copilot + Junos MCP server using streamable-http transport

Start your server

$ python3.11 jmcp.py -f devices.json
[06/11/25 08:26:11] INFO     Starting MCP server 'jmcp-server' with transport 'streamable-http' on http://127.0.0.1:30030/mcp
INFO:     Started server process [33512]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:30030 (Press CTRL+C to quit)

Point to this URL in your VSCode config

{
  "mcp": {
    "servers": {
      "my-junos-mcp-server": {
        "url": "http://127.0.0.1:30030/mcp/"
      }
    }
  }
}

Note: You can use VSCode’s Cmd+Shift+P to configure MCP server.

Tools

No tools

Comments