Skip to main content
Glama

mcp-mdns — MCP server for mDNS service discovery

PyPI Python Ruff

MCP server that exposes mDNS (Multicast DNS) service discovery functionality via the Model Context Protocol. Enables LLMs to discover and query zero-configuration network services on the local network.

mcp-name: io.github.daedalus/mcp-mdns

Install

pip install mcp-mdns

Related MCP server: @lex-tools/codebase-context-dumper

Usage

# Run the MCP server
mcp-mdns

Or run directly with Python:

python -m mcp_mdns

MCP Server Configuration

Configure your MCP client with:

{
  "mcpServers": {
    "mdns": {
      "command": "mcp-mdns",
      "env": {}
    }
  }
}

Available Tools

  • mdns_list_service_types — List all service types advertised on the local network

  • mdns_browse_services — Browse for services of a specific type (e.g., _http._tcp, _printer._tcp)

  • mdns_get_service_info — Get detailed information about a specific service (host, port, TXT records)

  • mdns_resolve_hostname — Resolve a .local hostname to IP addresses

  • mdns_register_service — Register a new service on the local network

  • mdns_unregister_service — Unregister a previously registered service

Development

git clone https://github.com/daedalus/mcp-mdns.git
cd mcp-mdns
pip install -e ".[test]"

# run tests
pytest

# format
ruff format src/ tests/

# lint
ruff check src/ tests/

# type check
mypy src/

License

MIT

Available Tools

6 tools
mdns_browse_servicesA
Read-onlyIdempotent

Browse for services of a specific type on the local network.

This tool searches for all services matching a given type (e.g., _http._tcp, _printer._tcp). It returns the names of all discovered services that can be used with mdns_get_service_info to retrieve detailed information.

Args: params (BrowseServicesInput): Validated input parameters containing: - service_type (str): Service type to search for (e.g., '_http._tcp') - timeout (Optional[float]): Query timeout in seconds (default: 5.0) - response_format (ResponseFormat): Output format preference

Returns: str: List of discovered services or error message

Example: >>> mdns_browse_services(BrowseServicesInput(service_type="_http._tcp", timeout=5.0)) "# Services of Type: _http._tcp\n\nFound 1 service(s):\n\n- My Server._http._tcp.local."

Inputs: params (required). Returns: result

mdns_get_service_infoA
Read-onlyIdempotent

Get detailed information about a specific mDNS service.

This tool retrieves complete information about a discovered service including:

  • Hostname and IP addresses

  • Port number

  • TXT records (metadata)

  • Service type and name

Args: params (ServiceInfoInput): Validated input parameters containing: - service_type (str): Service type (e.g., '_http._tcp.local.') - service_name (str): Full service name from browse results - timeout (Optional[float]): Query timeout in seconds (default: 10.0) - response_format (ResponseFormat): Output format preference

Returns: str: Detailed service information or error message

Example: >>> mdns_get_service_info(ServiceInfoInput(service_type="_http._tcp", service_name="My Server._http._tcp.local.")) "# Service: My Server._http._tcp.local.\n\nType: _http._tcp.local.\nServer: myserver.local\nPort: 8080\nAddresses: 192.168.1.100"

Inputs: params (required). Returns: result

mdns_list_service_typesA
Read-onlyIdempotent

List all service types advertised on the local network via mDNS.

This tool queries the local network for all advertised mDNS service types. Common service types include _http._tcp (web servers), _printer._tcp (printers), _airplay._tcp (Apple TV), _smb._tcp (SMB shares), and many others.

Args: params (ServiceTypeInput): Validated input parameters containing: - timeout (Optional[float]): Query timeout in seconds (default: 5.0) - response_format (ResponseFormat): Output format preference

Returns: str: Formatted list of discovered service types or error message

Example: >>> mdns_list_service_types(ServiceTypeInput(timeout=5.0, response_format=ResponseFormat.MARKDOWN)) "# mDNS Service Types\n\nFound 3 service type(s):\n\n- _http._tcp\n- _printer._tcp\n- _airplay._tcp"

Inputs: params (required). Returns: result

mdns_register_serviceA

Register a new service on the local network via mDNS.

This tool registers a service so other devices on the network can discover it. The service will be advertised with the specified type, port, and optional TXT records.

Args: params (RegisterServiceInput): Validated input parameters containing: - name (str): Service name (e.g., 'My Web Server') - service_type (str): Service type (e.g., '_http._tcp') - port (int): Port number - host (Optional[str]): Host IP (auto-detected if not provided) - text_records (Optional[Dict[str, str]]): TXT record key-value pairs

Returns: str: Registration result or error message

Example: >>> mdns_register_service(RegisterServiceInput(name="MyServer", service_type="_http._tcp", port=8080)) "Successfully registered service: MyServer._http._tcp.local. on port 8080"

Inputs: params (required). Returns: result

mdns_resolve_hostnameA
Read-onlyIdempotent

Resolve an mDNS hostname (.local) to IP addresses.

This tool resolves a local network hostname (ending in .local) to its IP address(es). This is useful for finding the IP address of devices that don't have static IPs but have registered with mDNS/Bonjour.

Args: params (ResolveHostnameInput): Validated input parameters containing: - hostname (str): Hostname to resolve (e.g., 'mydevice.local') - timeout (Optional[float]): Query timeout in seconds (default: 5.0) - response_format (ResponseFormat): Output format preference

Returns: str: Resolved IP addresses or error message

Example: >>> mdns_resolve_hostname(ResolveHostnameInput(hostname="raspberrypi.local", timeout=5.0)) "# Resolution: raspberrypi.local\n\nIP Address: 192.168.1.50"

Inputs: params (required). Returns: result

mdns_unregister_serviceA
DestructiveIdempotent

Unregister a previously registered mDNS service.

This tool removes a service from the local network, stopping its advertisement.

Args: params (UnregisterServiceInput): Validated input parameters containing: - service_name (str): Service name to unregister

Returns: str: Unregistration result or error message

Example: >>> mdns_unregister_service(UnregisterServiceInput(service_name="MyServer._http._tcp.local.")) "Successfully unregistered service: MyServer._http._tcp.local."

Inputs: params (required). Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.3/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool has a distinct purpose: browsing services, getting service info, listing service types, registering, unregistering, and resolving hostnames. No two tools overlap in functionality.

    Naming Consistency5/5

    All tools follow the consistent pattern 'mdns_verb_noun' (e.g., mdns_browse_services, mdns_register_service). The naming is perfectly uniform and predictable.

    Tool Count5/5

    With 6 tools, the server covers the core mDNS operations without being too few or too many. Each tool earns its place for a focused networking utility.

    Completeness4/5

    The tool set covers browsing, querying, registration, and hostname resolution. Missing an update tool for registered services, but this is a minor gap; core workflows are well-supported.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that bridges MCP clients with local LLM services, enabling seamless integration with MCP-compatible applications through standard tools like chat completion, model listing, and health checks.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that publishes CLI tools on your machine for discoverability by LLMs
      7 npm
      1
      MIT