Model Context Protocol server for phpIPAM IP address management and network infrastructure.
- Python 3.10+
- phpIPAM instance with API access
- App configured in phpIPAM with "SSL with App Code token" security
pip install phpipam-mcp-server
git clone https://github.com/InfraMCP/phpipam-mcp-server.git
cd phpipam-mcp-server
pip install -e .
pip install -e ".[dev]"
Add to your MCP client configuration:
{
"mcpServers": {
"phpipam": {
"command": "phpipam-mcp-server",
"env": {
"PHPIPAM_URL": "https://ipam.example.com/",
"PHPIPAM_APP_ID": "your_app_id",
"PHPIPAM_APP_CODE": "your_app_code_token"
}
}
}
}
List all IP sections from phpIPAM.
include_fields
: Comma-separated fields or "all" for complete data
Get subnets within a specific section.
section_id
: Section ID to queryinclude_usage
: Include usage statistics (default: True)include_fields
: Field filtering optionslimit
: Maximum results to return (default: 20, max: 100)
Search for IP addresses or hostnames.
ip_or_hostname
: IP address or hostname to search forlimit
: Maximum results to return (default: 10, max: 50)
Get detailed subnet information.
subnet_id
: Subnet ID to queryinclude_addresses
: Include IP addresses in subnet (default: False)address_limit
: Maximum addresses to show (default: 10, max: 50)
List VLANs from phpIPAM.
domain_id
: Optional domain ID filterlimit
: Maximum results to return (default: 20, max: 100)
List VRF instances from phpIPAM.
limit
: Maximum results to return (default: 20, max: 100)
List physical locations for network infrastructure.
limit
: Maximum results to return (default: 20, max: 100)
List DNS nameservers with configuration details.
limit
: Maximum results to return (default: 20, max: 100)
Search subnets by CIDR, description, or other criteria.
query
: Search term (CIDR, description, etc.)limit
: Maximum results to return (default: 10, max: 50)
Create a new subnet in phpIPAM.
section_id
: Section ID where subnet will be createdsubnet
: Network address (e.g., "192.168.1.0")mask
: Subnet mask (e.g., "24")description
: Optional description for the subnetvlan_id
: Optional VLAN ID
Reserve an IP address in a subnet.
subnet_id
: Subnet ID where IP will be reservedip
: Specific IP address to reserve (optional - will find first available)hostname
: Hostname for the IP addressdescription
: Description for the IP addressowner
: Owner of the IP address
Update an existing IP address record.
address_id
: ID of the IP address to updatehostname
: New hostname (optional)description
: New description (optional)owner
: New owner (optional)
Delete/release an IP address reservation.
address_id
: ID of the IP address to delete
Update an existing subnet.
subnet_id
: ID of the subnet to updatedescription
: New description (optional)vlan_id
: New VLAN ID (optional)vrf_id
: New VRF ID (optional)
Delete a subnet (WARNING: This will delete all IP addresses in the subnet).
subnet_id
: ID of the subnet to delete
- Create an API application in phpIPAM admin interface
- Set security to "SSL with App Code token"
- Note the App ID and App Code
- Set appropriate permissions for the application
This server uses static app code token authentication:
- No token expiration
- Simple configuration
- Secure over HTTPS
# Run pylint
python -m pylint src/phpipam_mcp_server/
# Run tests (when available)
python -m pytest
# Format code
python -m black src/
python -m isort src/
src/phpipam_mcp_server/
├── __init__.py # Package initialization
└── server.py # Main MCP server implementation
See the docs/
directory for detailed API documentation:
api-overview.md
- General API informationcontrollers.md
- Available endpoints and data structuresexamples.md
- Request/response examplesmcp-design.md
- MCP server design and architecture
MIT License - see LICENSE file for details.
- Fork the repository
- Create a feature branch
- Make changes with tests
- Run code quality checks
- Submit a pull request
- GitHub Issues: https://github.com/InfraMCP/phpipam-mcp-server/issues
- Documentation: https://github.com/InfraMCP/phpipam-mcp-server#readme