MCP server for phpIPAM IP address management and network infrastructure
Project description
phpIPAM MCP Server
Model Context Protocol server for phpIPAM IP address management and network infrastructure.
Installation
Prerequisites
- Python 3.10+
- phpIPAM instance with API access
- App configured in phpIPAM with "SSL with App Code token" security
From PyPI (when published)
pip install phpipam-mcp-server
From Source
git clone https://github.com/InfraMCP/phpipam-mcp-server.git
cd phpipam-mcp-server
pip install -e .
Development Installation
pip install -e ".[dev]"
Usage
As MCP Server
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"
}
}
}
}
Available Tools
list_sections(include_fields="")
List all IP sections from phpIPAM.
include_fields: Comma-separated fields or "all" for complete data
get_section_subnets(section_id, include_usage=True, include_fields="", limit=20)
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_addresses(ip_or_hostname, limit=10)
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_subnet_details(subnet_id, include_addresses=False, address_limit=10)
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(domain_id=None, limit=20)
List VLANs from phpIPAM.
domain_id: Optional domain ID filterlimit: Maximum results to return (default: 20, max: 100)
list_vrfs(limit=20)
List VRF instances from phpIPAM.
limit: Maximum results to return (default: 20, max: 100)
list_locations(limit=20)
List physical locations for network infrastructure.
limit: Maximum results to return (default: 20, max: 100)
list_nameservers(limit=20)
List DNS nameservers with configuration details.
limit: Maximum results to return (default: 20, max: 100)
search_subnets(query, limit=10)
Search subnets by CIDR, description, or other criteria.
query: Search term (CIDR, description, etc.)limit: Maximum results to return (default: 10, max: 50)
Write Operations
create_subnet(section_id, subnet, mask, *, description="", vlan_id=None)
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_ip_address(subnet_id, ip=None, hostname="", description="", owner="")
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_ip_address(address_id, hostname=None, description=None, owner=None)
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_ip_address(address_id)
Delete/release an IP address reservation.
address_id: ID of the IP address to delete
update_subnet(subnet_id, description=None, vlan_id=None, vrf_id=None)
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_subnet(subnet_id)
Delete a subnet (WARNING: This will delete all IP addresses in the subnet).
subnet_id: ID of the subnet to delete
Configuration
phpIPAM Setup
- 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
Authentication
This server uses static app code token authentication:
- No token expiration
- Simple configuration
- Secure over HTTPS
Development
Code Quality
# 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/
Project Structure
src/phpipam_mcp_server/
├── __init__.py # Package initialization
└── server.py # Main MCP server implementation
API Documentation
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
License
MIT License - see LICENSE file for details.
Contributing
- Fork the repository
- Create a feature branch
- Make changes with tests
- Run code quality checks
- Submit a pull request
Support
- GitHub Issues: https://github.com/InfraMCP/phpipam-mcp-server/issues
- Documentation: https://github.com/InfraMCP/phpipam-mcp-server#readme
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file phpipam_mcp_server-0.2.1.tar.gz.
File metadata
- Download URL: phpipam_mcp_server-0.2.1.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c53d7cf739bc7427d8549a5f051f300043045d3625c09634d62a89c9421392f4
|
|
| MD5 |
91d9b315862b93cc2671c7ab8a617657
|
|
| BLAKE2b-256 |
3a42c78946dc1d744f1585a04845812067fcf1db07e48063944f347fee9a3b7a
|
Provenance
The following attestation bundles were made for phpipam_mcp_server-0.2.1.tar.gz:
Publisher:
publish.yml on InfraMCP/phpipam-mcp-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
phpipam_mcp_server-0.2.1.tar.gz -
Subject digest:
c53d7cf739bc7427d8549a5f051f300043045d3625c09634d62a89c9421392f4 - Sigstore transparency entry: 582635074
- Sigstore integration time:
-
Permalink:
InfraMCP/phpipam-mcp-server@dc0ccfce309244e8e01efaa85cd2d8748caf80ee -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/InfraMCP
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dc0ccfce309244e8e01efaa85cd2d8748caf80ee -
Trigger Event:
release
-
Statement type:
File details
Details for the file phpipam_mcp_server-0.2.1-py3-none-any.whl.
File metadata
- Download URL: phpipam_mcp_server-0.2.1-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9abb64fa59df456a43edeca7295e86e7801d7a6ede3c418bdac43611dd9a4665
|
|
| MD5 |
13b2fd358aa3702a45974fba52954e4d
|
|
| BLAKE2b-256 |
e26fd90be20d013202925d8ebd91412dbb9288e66a9ce7a50f52af4b46f80e8a
|
Provenance
The following attestation bundles were made for phpipam_mcp_server-0.2.1-py3-none-any.whl:
Publisher:
publish.yml on InfraMCP/phpipam-mcp-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
phpipam_mcp_server-0.2.1-py3-none-any.whl -
Subject digest:
9abb64fa59df456a43edeca7295e86e7801d7a6ede3c418bdac43611dd9a4665 - Sigstore transparency entry: 582635076
- Sigstore integration time:
-
Permalink:
InfraMCP/phpipam-mcp-server@dc0ccfce309244e8e01efaa85cd2d8748caf80ee -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/InfraMCP
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dc0ccfce309244e8e01efaa85cd2d8748caf80ee -
Trigger Event:
release
-
Statement type: