Skip to main content
Glama
phpIPAM MCP Server

phpIPAM MCP Server

by greglg45

phpIPAM MCP Server

Python 3.8+ License: MIT Pylint Safety Security Scan Dependency Security Check

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]"

Related MCP server: NetBox MCP Server

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 query

  • include_usage: Include usage statistics (default: True)

  • include_fields: Field filtering options

  • limit: 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 for

  • limit: 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 query

  • include_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 filter

  • limit: 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 created

  • subnet: Network address (e.g., "192.168.1.0")

  • mask: Subnet mask (e.g., "24")

  • description: Optional description for the subnet

  • vlan_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 reserved

  • ip: Specific IP address to reserve (optional - will find first available)

  • hostname: Hostname for the IP address

  • description: Description for the IP address

  • owner: 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 update

  • hostname: 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 update

  • description: 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

  1. Create an API application in phpIPAM admin interface

  2. Set security to "SSL with App Code token"

  3. Note the App ID and App Code

  4. 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 information

  • controllers.md - Available endpoints and data structures

  • examples.md - Request/response examples

  • mcp-design.md - MCP server design and architecture

License

MIT License - see LICENSE file for details.

Contributing

  1. Fork the repository

  2. Create a feature branch

  3. Make changes with tests

  4. Run code quality checks

  5. Submit a pull request

Support

Available Tools

16 tools
create_subnetA

Create a new subnet in phpIPAM.

Args: section_id: Section ID where subnet will be created subnet: Network address (e.g., "192.168.1.0") mask: Subnet mask (e.g., "24") description: Optional description for the subnet vlan_id: Optional VLAN ID

Inputs: mask (required), subnet (required), section_id (required), vlan_id, +1 more. Returns: result

delete_ip_addressB

Delete/release an IP address reservation.

Args: address_id: ID of the IP address to delete

Inputs: address_id (required). Returns: result

delete_subnetA

Delete a subnet (WARNING: This will delete all IP addresses in the subnet).

Args: subnet_id: ID of the subnet to delete

Inputs: subnet_id (required). Returns: result

get_section_subnetsA

Get subnets within a specific section.

CONTEXT OPTIMIZATION: Limited to 20 results by default. Use limit parameter to control output size.

Args: section_id: Section ID to get subnets from include_usage: Include usage statistics (default: True) include_fields: Comma-separated fields to include (default: essential only) limit: Maximum number of subnets to return (default: 20, max: 100)

Inputs: section_id (required), limit, include_usage, include_fields. Returns: result

get_subnet_detailsA

Get detailed information about a specific subnet.

CONTEXT OPTIMIZATION: Address listing limited to 10 by default.

Args: subnet_id: Subnet ID to get details for include_addresses: Include IP addresses in the subnet (default: False) address_limit: Max addresses to show if include_addresses=True (default: 10)

Inputs: subnet_id (required), address_limit, include_addresses. Returns: result

list_locationsA

List physical locations from phpIPAM.

CONTEXT OPTIMIZATION: Limited to 20 results by default.

Args: limit: Maximum number of locations to return (default: 20, max: 100)

Inputs: limit. Returns: result

list_nameserversA

List DNS nameservers from phpIPAM.

CONTEXT OPTIMIZATION: Limited to 20 results by default.

Args: limit: Maximum number of nameservers to return (default: 20, max: 100)

Inputs: limit. Returns: result

list_sectionsA

List all IP sections from phpIPAM.

CONTEXT OPTIMIZATION: Returns essential fields only by default. Use include_fields="all" for complete data.

Args: include_fields: Comma-separated fields to include (default: essential only) Use "all" for complete data

Inputs: include_fields. Returns: result

list_vlansA

List VLANs from phpIPAM.

CONTEXT OPTIMIZATION: Limited to 20 results by default.

Args: domain_id: Optional domain ID to filter VLANs limit: Maximum number of VLANs to return (default: 20, max: 100)

Inputs: limit, domain_id. Returns: result

list_vrfsA

List VRF instances from phpIPAM.

CONTEXT OPTIMIZATION: Limited to 20 results by default.

Args: limit: Maximum number of VRFs to return (default: 20, max: 100)

Inputs: limit. Returns: result

reserve_ip_addressA

Reserve an IP address in a subnet.

Args: subnet_id: Subnet ID where IP will be reserved ip: Specific IP address to reserve (optional - will find first available) hostname: Hostname for the IP address description: Description for the IP address owner: Owner of the IP address

Inputs: subnet_id (required), ip, owner, hostname, +1 more. Returns: result

search_addressesB

Search for IP addresses or hostnames in phpIPAM.

CONTEXT OPTIMIZATION: Limited to 10 results by default.

Args: ip_or_hostname: IP address or hostname to search for limit: Maximum number of results to return (default: 10, max: 50)

Inputs: ip_or_hostname (required), limit. Returns: result

search_hostnameA

Search for IP addresses by exact or partial hostname in phpIPAM.

CONTEXT OPTIMIZATION: Limited to 10 results by default.

Args: hostname: Hostname to search for limit: Maximum number of results to return (default: 10, max: 50)

Inputs: hostname (required), limit. Returns: result

search_subnetsA

Search subnets by CIDR, description, or other criteria.

CONTEXT OPTIMIZATION: Limited to 10 results by default.

Args: query: Search term (CIDR, description, etc.) limit: Maximum number of results to return (default: 10, max: 50)

Inputs: query (required), limit. Returns: result

update_ip_addressC

Update an existing IP address record.

Args: address_id: ID of the IP address to update hostname: New hostname (optional) description: New description (optional) owner: New owner (optional)

Inputs: address_id (required), owner, hostname, description. Returns: result

update_subnetC

Update an existing subnet.

Args: subnet_id: ID of the subnet to update description: New description (optional) vlan_id: New VLAN ID (optional) vrf_id: New VRF ID (optional)

Inputs: subnet_id (required), vrf_id, vlan_id, description. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 16 tools

    Disambiguation3/5

    Most tools have clear, distinct purposes, but search_addresses and search_hostname overlap significantly—both search for addresses by hostname, with search_addresses also accepting IPs. This could cause agent misselection.

    Naming Consistency4/5

    Tool names follow a verb_noun pattern consistently (list_*, search_*, create_*, update_*, delete_*, reserve_*). Minor deviation: list_* for most listing operations but get_* for get_section_subnets and get_subnet_details.

    Tool Count4/5

    16 tools is slightly above the typical 3-15 range, but the server covers a broad IPAM domain (sections, subnets, IPs, VLANs, VRFs, locations, nameservers). The count is reasonable and not bloated.

    Completeness4/5

    The core subnet and IP address lifecycle is well covered: create, update, delete, and search for both. Minor gaps exist: no create/update/delete for sections, VLANs, VRFs, locations, or nameservers, but these appear to be read-only references.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      MCP server for managing Proxmox VE resources, VM/CT lifecycle, snapshots, backups, and clones via natural language.
      23
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A read-only MCP server that exposes NetBox IPAM data over HTTP, allowing engineers to query subnets, IPs, and VLANs using natural language through AI assistants.
      MIT