Get the FREE Ultimate OpenClaw Setup Guide →

First_MCP_Server

MCP server from E-Conners-Lab/First_MCP_Server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio e-conners-lab-first_mcp_server python server.py \
  --env LAB_PASSWORD="your_password" \
  --env LAB_USERNAME="your_username"

How to use

This MCP server is designed to interact with network devices (such as Cisco IOS-XE) via SSH using Scrapli. It exposes tools to execute show commands on devices, list the devices in the lab inventory, and manage asynchronous SSH connections for faster, scalable probing. To operate the server, run it with the project’s build tool (uv) and then interact with the server’s capabilities through its exposed endpoints or built-in commands. The lab's inventory is defined in the server.py file, and it connects to devices using credentials provided in a .env file.

Once the server is running, you can leverage the following capabilities:

  • Execute predefined show commands on a target device to retrieve configuration, status, or operational data.
  • List the devices available in the lab inventory so you know which devices you can query.
  • Benefit from asynchronous SSH connections via Scrapli to perform multiple device interactions concurrently, improving responsiveness for larger inventories.

If you need to authenticate, place your credentials in a .env file as LAB_USERNAME and LAB_PASSWORD, and ensure server.py points to the correct device inventory. The server uses Scrapli under the hood to establish SSH sessions and run the requested CLI commands, returning structured results for easy parsing by your automation workflows.

How to install

Prerequisites:

  • Python 3.13+ installed on your system
  • Git installed
  • Internet access to install dependencies

Step-by-step installation:

  1. Clone the repository: git clone <repository-url> cd <repository-directory>

  2. Install dependencies using uv (the Python package manager for this project): uv sync

  3. Create a .env file with your device credentials: LAB_USERNAME=your_username LAB_PASSWORD=your_password

  4. Update the device inventory in server.py with your device IPs and any device-specific connection parameters (e.g., device_type, port, secret).

  5. Run the MCP server: uv run server.py

Additional notes

Notes and tips:

  • Ensure your target devices are reachable over SSH and that Scrapli supports the device OS you are using (e.g., Cisco IOS-XE).
  • The .env file is used to securely provide credentials; never commit this file to version control.
  • If you modify server.py to add more devices or commands, restart the MCP server to apply changes.
  • If you encounter connection failures, verify network reachability, SSH access, and correct device type and credentials in the inventory.
  • This configuration uses Python via uv (as indicated in the README); no npm packages are required for this setup.

Common environment variables:

  • LAB_USERNAME: SSH username for devices
  • LAB_PASSWORD: SSH password for devices
  • Optional device-specific vars may be added as needed in server.py or the environment, depending on how you configure Scrapli connections.

Related MCP Servers

Sponsor this space

Reach thousands of developers