Installation Guide¶
This guide will walk you through installing the Nautobot MCP Server on your system.
Prerequisites¶
Before installing, ensure you have:
- Python 3.11 (< 3.12) - Required for compatibility with all dependencies
- Git - For cloning the repository and managing knowledge base repositories
- Access to a Nautobot instance - Either local or remote
- GitHub Personal Access Token (optional but recommended) - For accessing private repositories
System Requirements¶
- OS: Linux, macOS, or Windows (WSL2 recommended for Windows)
- RAM: Minimum 4GB (8GB+ recommended for better performance)
- Disk Space: 5GB+ for models and cached repositories
- Network: Internet access for downloading dependencies and cloning repositories
Installation Methods¶
Method 1: Using uv (Recommended)¶
uv is a fast Python package installer and resolver.
Step 1: Install uv¶
Step 2: Clone the Repository¶
Step 3: Install Dependencies¶
This command will:
- Create a virtual environment
- Install all dependencies from
pyproject.toml - Set up the project for development
Method 2: Using pip¶
If you prefer traditional pip installation:
Step 1: Clone the Repository¶
Step 2: Create Virtual Environment¶
Step 3: Install Dependencies¶
For development with additional tools:
Configuration¶
Step 1: Create Environment File¶
Copy the example environment file:
Step 2: Configure Environment Variables¶
Edit .env with your settings:
# Nautobot Configuration
NAUTOBOT_TOKEN=your_nautobot_api_token_here
NAUTOBOT_ENV=local # Options: local, nonprod, prod
# Environment-specific URLs
NAUTOBOT_URL_LOCAL=http://localhost:8000
NAUTOBOT_URL_NONPROD=https://nautobot-nonprod.example.com
NAUTOBOT_URL_PROD=https://nautobot.example.com
# GitHub Configuration (optional but recommended)
GITHUB_TOKEN=your_github_personal_access_token
# Server Configuration
API_PREFIX=nautobot_openapi
SERVER_NAME=nautobot_mcp
SERVER_VERSION=0.2.0
LOG_LEVEL=INFO
# Database Configuration
EMBEDDING_MODEL=all-MiniLM-L6-v2
DEFAULT_SEARCH_RESULTS=5
# Advanced Configuration
API_TIMEOUT=10
SSL_VERIFY=True
POSTHOG_API_KEY=disable
Step 3: Obtain Required Tokens¶
Nautobot API Token¶
- Log in to your Nautobot instance
- Navigate to your profile → API Tokens
- Click "Add Token"
- Set appropriate permissions (read access at minimum)
- Copy the generated token to
NAUTOBOT_TOKENin.env
GitHub Personal Access Token (Optional)¶
For accessing private repositories or to avoid rate limits:
- Go to GitHub Settings → Developer settings → Personal access tokens
- Click "Generate new token (classic)"
- Select scopes:
repo- For private repositoriespublic_repo- For public repositories only
- Copy the token to
GITHUB_TOKENin.env
Token Security
Never commit your .env file to version control. The .gitignore file is configured to exclude it by default.
Verify Installation¶
Test Basic Functionality¶
Run the server:
You should see output similar to:
2024-10-14 20:30:01 [INFO] nautobot_mcp: Initializing Nautobot MCP Server...
2024-10-14 20:30:02 [INFO] nautobot_mcp: ChromaDB collections initialized
2024-10-14 20:30:03 [INFO] nautobot_mcp: API endpoint index refreshed
2024-10-14 20:30:04 [INFO] nautobot_mcp: Server ready to accept requests
Run Tests¶
Verify the installation by running tests:
Check Embedding Model¶
The first run will download the sentence-transformers model (~90MB):
python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('all-MiniLM-L6-v2')"
Post-Installation Steps¶
Initialize Knowledge Base¶
On first run, the server will automatically:
- Create ChromaDB collections
- Fetch and index the OpenAPI schema from your Nautobot instance
- Clone configured repositories
- Index documentation and code files
This process may take 5-10 minutes depending on:
- Number of configured repositories
- Size of repositories
- Network speed
Configure VS Code Integration¶
See the Quick Start Guide for VS Code Copilot integration.
Troubleshooting Installation¶
Python Version Issues¶
Ensure you're using Python 3.11:
If you have multiple Python versions:
SSL Certificate Errors¶
If you encounter SSL errors with self-signed certificates:
Production Warning
Only disable SSL verification in development environments.
ChromaDB Permission Issues¶
If you see permission errors:
GitHub Rate Limits¶
Without a GitHub token, you may hit rate limits:
Solution: Add a GitHub token to your .env file.
Port Conflicts¶
If port 8000 is in use, modify your Nautobot URL or check for other services:
Updating¶
To update to the latest version:
Uninstalling¶
To completely remove the installation:
# Remove virtual environment
rm -rf venv/
# Remove cached data
rm -rf backend/
# Remove cloned repositories
rm -rf config/user_repositories.json
# Remove the project directory
cd ..
rm -rf nautobot_mcp/
Next Steps¶
- Quick Start Guide - Get started with your first query
- Configuration Guide - Advanced configuration options
- Architecture Overview - Understand how it works