Complete Model Context Protocol server for phpIPAM - Professional IP address management and network infrastructure automation through AI assistants.
Manage your entire IP infrastructure through natural language conversations with Claude or other MCP-compatible AI assistants.
- 63 Comprehensive Tools - Complete phpIPAM API coverage
- 10 Core Modules - Sections, Subnets, Addresses, VLANs, VRFs, Devices, Locations, and more
- Natural Language Interface - Interact with your network through AI assistants
- Production Ready - Docker deployment, health checks, comprehensive logging
- Advanced Search - Find resources by IP, hostname, MAC address, or tags
- Real-time Usage Stats - Monitor subnet utilization and capacity
- Network Planning - Plan allocations, find free IPs, manage hierarchies
# Clone repository
git clone https://github.com/0xEkho/phpIPAM-MCP.git
cd phpIPAM-MCP/deploy
# Configure credentials
cp .env.example .env
nano .env # Add your phpIPAM URL and credentials
# Start server
docker-compose up -d
# Verify health
curl http://localhost:8081/healthz# Install
pip install -e .
# Set environment variables
export PHPIPAM_URL="https://ipam.example.com"
export PHPIPAM_APP_ID="mcp-server"
export PHPIPAM_APP_CODE="your_app_code_token"
# Run server
phpipam-mcp-server- Python 3.11+ or Docker
- phpIPAM instance with API access
- API application configured with "SSL with App Code token" security
- Login to phpIPAM as administrator
- Navigate to Administration β phpIPAM settings β API
- Click Create API application
- Configure:
- App ID:
mcp-server(or your choice) - App permissions: Read/Write as needed
- App security:
SSL with App code token
- App ID:
- Save and copy the App Code token
git clone https://github.com/0xEkho/phpIPAM-MCP.git
cd phpIPAM-MCP
pip install -r requirements.txt
pip install -e .Browse practical examples in the examples/ directory:
- List Sections - Explore network organization
- Subnet Management - Manage subnets and usage
- IP Address Search - Find IPs by various criteria
- VLAN Management - Audit and manage VLANs
- IP Reservation - Reserve and allocate IPs
Natural language (with Claude):
"Find all information about IP address 192.168.1.100"
MCP Tool Call:
{
"tool": "phpipam.addresses.search",
"args": {
"search_term": "192.168.1.100"
}
}Natural language (with Claude):
"Reserve IP 10.0.1.50 with hostname web-server-01 for the production web server"
MCP Tool Call:
{
"tool": "phpipam.addresses.create",
"args": {
"subnet_id": "42",
"ip": "10.0.1.50",
"hostname": "web-server-01",
"description": "Production web server",
"owner": "IT Team"
}
}| Module | Tools | Description |
|---|---|---|
| Sections | 6 | Organize IP address space into sections |
| Subnets | 11 | Complete subnet lifecycle management |
| Addresses | 11 | IP address allocation and tracking |
| VLANs | 10 | VLAN and L2 domain management |
| VRFs | 7 | Virtual routing and forwarding |
| Devices | 8 | Network device inventory |
| Locations | 6 | Physical location tracking |
| Nameservers | 2 | DNS nameserver management |
| Tools | 2 | Global search and utilities |
Sections
phpipam.sections.list- List all sectionsphpipam.sections.get- Get section detailsphpipam.sections.get_subnets- List subnets in sectionphpipam.sections.create/update/delete- Manage sections
Subnets
phpipam.subnets.list- List all subnetsphpipam.subnets.get- Get subnet with usage statsphpipam.subnets.search- Search by CIDRphpipam.subnets.get_first_free- Find next available IPphpipam.subnets.get_slaves- List child subnetsphpipam.subnets.create/update/delete- Manage subnets
Addresses
phpipam.addresses.search- Search by IP or hostnamephpipam.addresses.search_mac- Search by MAC addressphpipam.addresses.create- Reserve IP addressesphpipam.addresses.update/delete- Manage addressesphpipam.addresses.ping- Ping an IP addressphpipam.addresses.tags.*- Manage address tags
VLANs
phpipam.vlans.list- List all VLANsphpipam.vlans.get_subnets- Subnets in VLANphpipam.vlans.domains.*- Manage L2 domainsphpipam.vlans.create/update/delete- Manage VLANs
VRFs, Devices, Locations
- Complete CRUD operations for each resource type
- Search and filtering capabilities
- Relationship tracking (devices β addresses, locations β subnets)
See examples/ for detailed usage of each tool.
# Required
PHPIPAM_URL=https://ipam.example.com
PHPIPAM_APP_ID=mcp-server
PHPIPAM_APP_CODE=your_app_code_token
# Optional
PHPIPAM_VERIFY_SSL=true
PHPIPAM_TIMEOUT=30
LOG_LEVEL=INFOAlternatively, use config.yaml:
phpipam:
url: "https://ipam.example.com"
app_id: "mcp-server"
app_code: "your_app_code_token"
verify_ssl: true
timeout: 30
server:
host: "0.0.0.0"
port: 8081
log_level: "INFO"Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"phpipam": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "PHPIPAM_URL=https://ipam.example.com",
"-e", "PHPIPAM_APP_ID=mcp-server",
"-e", "PHPIPAM_APP_CODE=your_token",
"phpipam-mcp-server"
]
}
}
}Or with Python:
{
"mcpServers": {
"phpipam": {
"command": "python",
"args": ["-m", "phpipam_server.main"],
"env": {
"PHPIPAM_URL": "https://ipam.example.com",
"PHPIPAM_APP_ID": "mcp-server",
"PHPIPAM_APP_CODE": "your_token"
}
}
}
}Complete deployment guide available in deploy/README.md.
cd deploy
docker-compose up -ddocker build -t phpipam-mcp-server -f deploy/Dockerfile .
docker run -d -p 8081:8081 \
-e PHPIPAM_URL="..." \
-e PHPIPAM_APP_ID="..." \
-e PHPIPAM_APP_CODE="..." \
phpipam-mcp-servercurl http://localhost:8081/healthz# Clone and install
git clone https://github.com/0xEkho/phpIPAM-MCP.git
cd phpIPAM-MCP
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
pip install -e ".[dev]"pytest tests/
pytest --cov=phpipam_server tests/# Format
black phpipam_server/
isort phpipam_server/
# Lint
ruff check phpipam_server/
mypy phpipam_server/phpIPAM-MCP/
βββ phpipam_server/ # Main application code
β βββ main.py # FastAPI server
β βββ api_client.py # phpIPAM API client
β βββ config.py # Configuration management
β βββ tools.py # MCP tools implementation
β βββ tool_definitions.py # Tool metadata
β βββ modules/ # API modules (10 modules)
βββ deploy/ # Docker deployment
β βββ Dockerfile
β βββ docker-compose.yml
β βββ README.md
βββ examples/ # Usage examples (.md files)
βββ tests/ # Test suite
βββ requirements.txt # Python dependencies
βββ pyproject.toml # Package configuration
βββ README.md # This file
- Authentication: App code token-based (static, no expiration)
- Transport: HTTPS required for production
- Permissions: Configure appropriate API permissions in phpIPAM
- Environment: Store credentials securely, never commit secrets
- Docker: Runs as non-root user
- SSL Verification: Enabled by default
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built for Model Context Protocol by Anthropic
- Inspired by ALE OmniSwitch MCP
- Based on phpIPAM API
- Issues: GitHub Issues
- Examples: Usage Examples
- Deployment: Deploy Guide
- phpIPAM API: Official Documentation
Made with β€οΈ for network automation and AI-assisted IPAM operations