Token导航 LogoToken导航

MCP Server · AI代理

Network AI Automation Using MCP Server

通过Containerlab、Claude AI和Model Context Protocol(MCP)服务器实现智能网络配置和管理的自动化工具,支持Ansible和Arista路由器。

未说明官方级别未说明来源级核验工具 2
AI驱动PythonClaude

快速开始

公开资料没有提供安装命令,按仓库或官方文档接入。
作者 / 组织
chiwiks
提供方
chiwiks

工具数量

2

来源目录标注

资源数量

0

来源目录标注

提示词数量

0

来源目录标注

GitHub Star

0

仓库热度

收录来源

1 个

MCP World

选型结论

Network AI Automation Using MCP Server 属于AI代理类 MCP Server,公开资料标注 2 个工具,通过传输方式未标注接入,适配 Claude,没有现成的安装命令;接入前要先准备 会话凭据。

分类

AI代理

传输方式

未说明

认证方式

会话凭据

部署方式

公开资料未说明

安装与配置

公开目录没有给出安装命令,需要按仓库 README安装;下面按同类条目的通用流程说明。

公开命令不是通用的启动方式,拼不出可靠配置示例;请在客户端 MCP 配置里按官方文档填写 command 和 args。

上手步骤

  1. 1

    先确认运行方式

    公开资料没有标注传输方式,先看仓库 README,确认是本地进程还是远程地址。

  2. 2

    获取服务

    公开目录没有给出安装命令,按仓库 README里的步骤安装或获取服务。

  3. 3

    写入客户端配置

    在客户端的 MCP 配置里填启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4

    验证是否可用

    连接成功后客户端会列出 2 个工具,随便调一个只读工具确认能返回结果。

接入前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

公开资料仍需确认:安装命令

详细介绍

使用MCP服务器的网络AI自动化

通过与Ansible和Arista路由器集成的模型上下文协议(MCP)服务器,使用Containerlab、Claude AI自动化网络配置和管理。

🚀 概述

该项目利用Containerlab Claude AI和模型上下文协议(MCP)提供智能网络自动化功能。它将人工智能驱动的决策能力与行业标准的Ansible剧本相结合,有效地管理Arista网络设备。

主要特点

  • 人工智能驱动的自动化:使用Claude AI智能管理网络配置
  • MCP服务器集成:通过MCP与Claude无缝集成,实现动态网络运营
  • 可靠的集成:可靠网络自动化的行业标准剧本
  • Arista路由器支持:直接支持Arista EOS设备
  • OSPF配置:自动化OSPF路由协议管理
  • 可扩展设计:使用基于意图的配置组织您的网络基础设施

📋 先决条件

在开始之前,请确保已安装以下内容:

  • \[x\] Containerlab和Docker
  • \[x\] Python 3.8或更高版本
  • \[x\] 答案2.9+
  • \[x\] 使用MCP服务器功能访问Claude API
  • \[x\] 将部署在containerlab中的Arista路由器映像
  • \[x\] 为您的网络设备配置SSH访问

您将在下面找到:

  • \[x\] 如何 设置这个实验室 从零开始
  • \[x\] 电流 拓扑图 便携式网络图形
  • \[x\] The Containerlab YAML 实验室文件
  • \[x\] The 网络.json 库存文件
  • \[x\] The 意图。JSON 库存文件
  • \[x\] Ansible剧本文件
  • \[x\] 重要注意事项和指导

⚒️ 项目技术栈

用于构建项目的主要工具和技术:

  • \[x\] 克劳德AI(克劳德代码)
  • \[x\] MCP服务器(FastMCP)
  • \[x\] 集装箱实验室
  • \[x\] 可靠
  • \[x\] Python
  • \[x\] Scrapli
  • \[x\] EOS eAPI(Arista)
  • \[x\] Ubuntu
  • \[x\] VS代码
  • \[x\] VirtualBox/VMware

🛠️ 环境设置

在进入网络拓扑部分之前,您将在下面找到构建实验室的指导。如果你有更多的空间,你可以添加

本实验室的虚拟机资源:

  • \[x\] VirtualBox或VMware
  • \[x\] Ubuntu 24.04.4虚拟机
  • \[x\] 4个处理器核心
  • \[x\] 4 GB RAM内存
  • \[x\] 50GB硬盘

总结检查表

🔧 构建拓扑和配置路由器的步骤

  • \[x\] 所有要求的初始安装和升级都包括fastmcp。
- git clone https://github.com/chiwiks/Network-AI-Automation-using-MCP-Server.git
- cd Network-AI-Automation-using-MCP-Server
- python3 -m venv mcp
- source mcp/bin/activate
- pip install --upgrade pip
- pip install fastmcp==3.0.0b1 scrapli asyncssh python-dotenv
  • \[x\] 安装Docker和Containerlab
  • \[x\] 下载官方Arista路由器镜像并将其导入Docker:
- [Aristat cEOs] (https://www.arista.com/en/login) image
- Download lates cE0 image with .tar.xz
- sudo docker import ~/cEOS64-lab-4.35.0F.tar.xz ceos:4.35.0F
- docker images
  • \[x\] 使用Containerlab和\*\*\*aris.yml\*\*\*文件构建拓扑
name: aris-lab

topology:
  nodes:
    r1:
      kind: arista_ceos
      image: ceos:4.35.0F
      mgmt-ipv4: 172.20.20.11
    r2:
      kind: arista_ceos
      image: ceos:4.35.0F
      mgmt-ipv4: 172.20.20.22
    r3:
      kind: arista_ceos
      image: ceos:4.35.0F
      mgmt-ipv4: 172.20.20.33

  links:
    - endpoints: ["r1:eth1", "r2:eth1"]
    - endpoints: ["r2:eth2", "r3:eth1"]
    - endpoints: ["r1:eth2", "r3:eth2"]

# The topology consists of three Arista router connected to each other
  • \[x\] 运行Containerlab命令以构建topolgy
- containerlab deploy -t aris.yml (build topology)
- containerlab save -t aris.yml ( save topology and configurations)
- containerlab inspect -t aris.yml (check the condition of the topology)
- containerlab redeploy -t aris.yml (redeploy the deploy the topolgy)
- docker exec -it  Cli  (connect to different routers after they are deployed default is enable)

- containerlab graph -t aris.yml (view topology. The png is found topology folder)
- containerlab destroy -t aris.yml (Destroy the topology)
- Name of the three routers are clab-mcp-lab-r1 clab-mcp-lab-r2 clab-mcp-lab-r1
  • \[x\] 当前拓扑:
  • \[x\] 使用Ansible脚本文件在三个Arista路由器上配置接口ip和OSPF。
- When you build your topology using containerlab, it automatically creates an ansible inventory file of the topolgy. Run the playbook_ospf.yml to configure the arista routers.

- name: configure ospf on the three routers
   hosts: arista_ceos
   gather_facts: no

   tasks: 
     - name: Configure R1 interfaces
       arista.eos.eos_interfaces:
        config:
          - name: Ethernet1
            enabled: true
            mode: layer3
          - name: Ethernet2
            enabled: true
            mode: layer3
        state: merged
       when: inventory_hostname == "clab-aris-lab-r1"

     - name: Configure R2 interfaces
       arista.eos.eos_interfaces:
        config:
          - name: Ethernet1
            enabled: true
            mode: layer3
          - name: Ethernet2
            enabled: true
            mode: layer3
        state: merged
       when: inventory_hostname == "clab-aris-lab-r2"

     - name: Configure R3 interfaces
       arista.eos.eos_interfaces:
        config:
          - name: Ethernet1
            enabled: true
            mode: layer3
          - name: Ethernet2
            enabled: true
            mode: layer3
        state: merged
       when: inventory_hostname == "clab-aris-lab-r3"

     - name: Configure R1 layer interfaces
       arista.eos.eos_l3_interfaces:
         config:
        
           - name: Ethernet1
             ipv4:
               - address: 192.168.12.1/24
           - name: Ethernet2
             ipv4:
               - address: 192.168.13.1/24
         state: merged
       when: inventory_hostname == "clab-aris-lab-r1"
      
     - name: Configure R2 layer interfaces
       arista.eos.eos_l3_interfaces:
         config:
           - name: Ethernet1
             ipv4:
               - address: 192.168.12.2/24
           - name: Ethernet2
             ipv4:
               - address: 192.168.23.2/24
         state: merged
       when: inventory_hostname == "clab-aris-lab-r2" 

     - name: Configure R3 layer interfaces
       arista.eos.eos_l3_interfaces:
         config:   
           - name: Ethernet1
             ipv4:
               - address: 192.168.23.3/24
           - name: Ethernet2
             ipv4:
               - address: 192.168.13.3/24

         state: merged
       when: inventory_hostname == "clab-aris-lab-r3"
         

     - name: Configure OSPF on the three routers
       arista.eos.eos_ospfv2:
         config:
          hostname: clab-aris-lab-r1
           - process_id: 1
             router_id: "1.1.1.1"
             areas:
               id: "0.0.0.0"
               type: normal
             networks:
               - area: "0.0.0.0"
                 prefix: 192.168.12.0/24
               - area: "0.0.0.0"
                 prefix: 192.168.13.0/24
         state: merged
         
          hostname: clab-aris-lab-r2
           - process_id: 1
             router_id: "2.2.2.2"
             areas:
               id: "0.0.0.0"
               type: normal
             networks:
               - area: "0.0.0.0"
                 prefix: 192.168.12.0/24
               - area: "0.0.0.0"
                 prefix: 192.168.23.0/24
          state: merged
          
          hostname: clab-aris-lab-r3
           - process_id: 1
             router_id: "3.3.3.3"
             areas:
               id: "0.0.0.0"
               type: normal
             networks:
               - area: "0.0.0.0"
                 prefix: 192.168.23.0/24
               - area: "0.0.0.0"
                 prefix: 192.168.13.0/24
          state: merged
  • \[x\] 创建包含三个路由器及其类型和用于登录它们的连接类型的newtwork-json清单文件。
{
	"R1": { "host": "172.20.20.11", "platform": "arista_eos", "transport": "asyncssh"},
	"R2": { "host": "172.20.20.22", "platform": "arista_eos", "transport": "asyncssh"},
	"R3": { "host": "172.20.20.33", "platform": "arista_eos", "transport": "asyncssh"}
}

🔧 构建将连接到拓扑的python MCP服务器

  • \[x\] Mcpserver.py代码摘要
  • \[x\] Showcommand输入模型,处理MCP在设备上运行的客户端输入的显示和显示命令等输入(取设备和命令名称)
   class ShowCommand(BaseModel):
    """Run show command against network device"""
      device: str = Field(..., description="Device name from inventory (e.g. R1, R2 , R3)")
      command: str = Field(..., description="Show command to execute on the device")
  • \[x\] 处理设备推送配置的配置输入模型(接受设备和命令名称)
   class ConfigCommand(BaseModel):
    """ Send configuration commands to one or more devices"""
      devices: list[str] = Field(..., description="Device names from inventory (e.g. ['R1', 'R2'])")
      commands : list[str] = Field(..., description="Configuration commands to apply")
  • \[x\] 将处理show和config的函数馈送到mcp服务器中
  - run_show function  takes params from the ShowCommand input base model
  @mcp.tool(name="run_show")
  async def run_show(params: ShowCommand)

  - push_config function takes the params from the ConfigCommand input base model
  @mcp.tool(name="push_config")
  async def push_config(params: ConfigCommand) -> dict

  Both functions are feed to the MCP ai server using the @mcp.tool
  • \[x\] 接下来,将您的mcpserver脚本连接到Claude ai
Run the command "claude mcp add mcp_network_automation -s user -- ./mcp/bin/python MCPServer.py"
Note: mcp_network_automation is name of FastMCP that was imported in McpServer.py script

Run the command "claude mcp list" -> Connected showing that your mcp server is connected to Claude

🔧 使用连接到MCP的claude AI运行show命令的示例

  • \[x\] 让Claude检查R2的接口ip地址。
As you can see it will use the run_show function and logs into the router and runs the show ip interface brief to get the  ip address

https://github.com/user-attachments/assets/6d31d2fd-8353-4548-ae28-f88283dc8a67

  • \[x\] 让Claude显示当前在拓扑中运行的路由协议。
It will use the run_show function to fetch and display OSPF running in your topolgogy

https://github.com/user-attachments/assets/d76d5936-c92b-4448-bc2f-66781b184cb0

  • \[x\] 接下来让Claude在界面上配置描述
This will make Claude to us the push_config function to configure the description the interface

https://github.com/user-attachments/assets/4306df42-9108-4add-a96b-89f8fa1755ae

🔥 故障排除

三种故障排除方案位于\[troubleshoot.md\]中

工具与能力

工具数量

2

资源数量

0

提示词数量

0

能力标签

网络自动化Python本地部署AI驱动Arista路由器Ansible集成MCP协议

支持客户端

Claude

数量来自来源目录的标注,具体工具清单以官方文档为准。

典型使用场景

多步任务编排

把拆解、检索、执行串成一条链,模型按步骤调用工具。

长期上下文

把会话、笔记和知识放到外部存储,换个会话还能接着做。

接自有流程

把内部系统和模型连起来,让助手调用已有的工作流。

选择建议

值得选的地方

  • 只提供 2 个工具,职责集中,接入后不容易误操作。
  • 公开说明写得比较完整,接入前能看清能力边界。

先想清楚的地方

  • 公开资料没有可直接复制的安装命令,第一次接入要自己找入口。
  • 需要自备会话凭据,没有凭据没法直接试。
  • 第三方目录整理,版本更新和行为细节以官方仓库为准。

更适合

  • 需要在AI代理场景里让模型直接调用外部能力的人。
  • 已经在用 Claude 的用户,接入路径最短。
  • 愿意照着官方文档一步步配环境的人。

不太适合

  • 暂时拿不到会话凭据的人。
  • 希望一条命令就装好、不想看文档的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

5 个同类
MCP Server工具数传输方式安装命令收录来源最后核验
Network AI Automation Using MCP Server

MCP World · 本页

2未说明未标注1 个2026-05-17
Everything Claude Code

MCP World

0stdio有1 个2026-05-17
Filesystem 560c4363

MCP World

13未说明未标注2 个2026-05-17
Time 7365cb6d

MCP.so

2SSE有2 个2026-05-17
Server Everything (everything)

MCP World

11stdio有1 个2026-05-17

按同分类和工具数量挑出最接近的几条,字段以各自详情页为准。

常见问题

5 条

Network AI Automation Using MCP Server 怎么安装?

公开目录没有给出可以直接复制的安装命令,需要按仓库 README里的步骤安装;装好后写进客户端的 MCP 配置再重启。

Network AI Automation Using MCP Server 怎么在 Claude Desktop、Cursor 里配置?

它是传输方式未标注,客户端配置里要写启动命令和参数,运行环境是 未标注;保存后完全退出客户端再打开,配置才会生效。

Network AI Automation Using MCP Server 收费吗?

本站只整理公开资料,不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Network AI Automation Using MCP Server 需要 API Key 吗?

公开资料标注的认证方式是会话凭据,也就是要先拿到凭据才能连上;凭据只填在自己本地的配置里,不要写进公开仓库。

Network AI Automation Using MCP Server 支持哪些客户端?

公开资料标注支持 Claude;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

来源信息

继续浏览同类 MCP