network_services
List configured network services on macOS systems using networksetup command to view current network configurations and settings.
Instructions
List configured network services as reported by networksetup.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- macos_tools_mcp/server.py:35-38 (registration)Registers the MCP tool 'network_services' with FastMCP @app.tool decorator, providing name and description.@app.tool( name="network_services", description="List configured network services as reported by `networksetup`.", )
- macos_tools_mcp/server.py:39-40 (handler)MCP tool handler for 'network_services', converts output of tools.available_network_services() to list.def network_services(_: Context | None = None) -> list[str]: return list(tools.available_network_services())
- macos_tools_mcp/tools.py:76-79 (helper)Helper function that executes the shell command 'networksetup -listallnetworkservices' to list all network services.def network_services() -> str: """Return all configured network services via ``networksetup``.""" return _run_command(["networksetup", "-listallnetworkservices"])
- macos_tools_mcp/tools.py:110-120 (helper)Helper function that parses 'network_services()' output to yield clean list of available network service names.def available_network_services() -> Iterable[str]: """Helper that returns the list of network services, skipping blank lines.""" output = network_services() for line in output.splitlines(): line = line.strip() if not line or line.startswith("An asterisk"): continue sanitized = line.lstrip('* ').strip() if sanitized: yield sanitized