Nautobot MCP Server

Integrations

  • Mentioned as a planned feature to containerize the MCP server for easier deployment and management.

  • Provides integration with GitHub demonstrated through video examples of connecting Librechat to the Nautobot MCP server.

  • Enables AI agents to interact with network data through custom Python tools, allowing for automation tasks and network management operations within Nautobot.

Nautobot MCP

该 Nautobot 应用程序将 MCP(模型上下文协议)服务器与 Nautobot 集成,为网络自动化和管理提供 AI 就绪工具和接口。

概述

Nautobot MCP 使 AI 助手或应用程序能够通过标准化协议与您的网络数据交互。该应用与 Nautobot 一起运行 MCP 服务器,该服务器提供 AI 系统可以使用的工具。

https://modelcontextprotocol.io/introduction

使用 Librechat 进行演示 - 连接到 Nautobot MCP

https://github.com/user-attachments/assets/283d68c2-d35f-4506-b909-45c1850e7281

安装

1. 安装软件包

pip install nautobot-mcp

2. 在你的 Nautobot 配置中添加 INSTALLED_APPS

# In your nautobot_config.py PLUGINS = [ "nautobot_mcp", # ... other plugins ]

3.配置

通过 Nautobot 的配置系统配置应用程序:

# In your nautobot_config.py PLUGINS_CONFIG = { "nautobot_mcp": { "MCP_PORT": 8005, # MCP server port "MCP_HOST": "0.0.0.0", # Default is 0.0.0.0 "MCP_CUSTOM_TOOLS_DIR": "/path/to/your/custom/tools", # Directory for custom tools "MCP_LOAD_CORE_TOOLS": False, # Load built-in tools }, }

4. 升级后运行 naautobot

nautobot-server post_upgrade

自定义工具

您可以通过在MCP_CUSTOM_TOOLS_DIR指定的目录中定义 Python 函数来创建自己的自定义工具。

自定义工具示例:

# In /path/to/your/custom/tools/my_tools.py def some_tool(param1: str, param2: str) -> dict: """Some tool description""" # Your implementation here return {"result": f"Tool result for {param1} and {param2}"}

MCP 服务器将自动发现并注册指定目录中所有基于功能的工具。

部署选项

方法一:手动启动

您可以手动启动 MCP 服务器:

nautobot-server start_mcp_server

方法 2:Systemd 服务(推荐用于生产)

/etc/systemd/system/nautobot-mcp.service创建一个 systemd 服务文件:

[Unit] Description=Nautobot MCP Server After=network-online.target Wants=network-online.target [Service] User=nautobot Group=nautobot WorkingDirectory=/opt/nautobot ExecStart=/opt/nautobot/venv/bin/nautobot-server start_mcp_server Restart=on-failure RestartSec=30 PrivateTmp=true [Install] WantedBy=multi-user.target

然后启用并启动服务:

sudo systemctl daemon-reload sudo systemctl enable --now nautobot-mcp.service

查看可用工具

您可以在 Nautobot 网络界面中查看所有已注册的工具:

https://your-nautobot-server/plugins/nautobot-mcp/tools/

此页面显示所有可用的工具、其描述、模块路径和参数规范。

待办事项

  • [ ] 添加一种将工具执行路由到特定 Nautobot 工作者的方法。
  • [ ] 增强 Nautobot 网络界面中的工具视图,以显示工具使用情况统计数据。
  • [ ] 创建一个 docker 容器来运行 MCP 服务器。
  • [ ] 添加测试。

执照

该项目根据 Apache License 2.0 获得许可 - 有关详细信息,请参阅 LICENSE 文件。

-
security - not tested
F
license - not found
-
quality - not tested

这种集成使人工智能助手能够通过标准化协议与网络数据交互,为网络自动化和管理提供人工智能就绪工具和接口。

  1. Overview
    1. Demo using Librechat - Connected to Nautobot MCP
      1. Installation
        1. 1. Install the package
        2. 2. Add to INSTALLED_APPS in your Nautobot configuration
        3. 3. Configuration
        4. 4. Run nautobot post upgrade
      2. Custom Tools
        1. Deployment Options
          1. Method 1: Manual Start
          2. Method 2: Systemd Service (Recommended for Production)
        2. Viewing Available Tools
          1. TODO
            1. License
              ID: e5ji08oq31