Nautobot MCP服务器
FastMCP服务器将Nautobot GraphQL数据作为机器可调用工具(MCP)和简单的REST端点公开。
快速启动
本地运行(仅限API)
pip install -e ./src
nautobot-mcp-server环境变量:
export HOST=0.0.0.0
export PORT=7001
export NAUTOBOT_URL=http://nautobot:8080
export NAUTOBOT_TOKEN=replace-me使用Chainlit作为UI(本地)
打开第二个终端:
export API_BASE_URL=http://localhost:7001
# If API key auth is enabled:
# export API_KEY=supersecret
chainlit run chainlit_app/app.py -w打开 http://localhost:8000 类型:
tool:get_devices_by_location {"location_name":"NY Data Center"}码头工人
docker build -t nautobot-mcp:dev -f src/Dockerfile .
docker run --rm -p 7001:7001 \
-e NAUTOBOT_URL=http://nautobot:8080 \
-e NAUTOBOT_TOKEN=replace-me \
nautobot-mcp:dev健康检查:
curl -s http://localhost:7001/healthz列出工具:
curl -s http://localhost:7001/tools | jq调用工具:
curl -s -X POST http://localhost:7001/tools/invoke \
-H 'Content-Type: application/json' \
-d '{"tool_name": "get_devices_by_location", "args": {"location_name": "NY Data Center"}}'