Windows-network-info
Retrieve Windows network information including IP addresses, connection status, and adapter details.
Instructions
Get network information of the Windows system.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "Windows-network-info"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- main.py:154-157 (registration)Registration of the Windows-network-info tool using the @mcp.tool decorator, assigning its name and description.
@mcp.tool( name="Windows-network-info", description="Get network information of the Windows system." ) - main.py:158-169 (handler)Handler function that collects network interface IPv4 addresses using psutil.net_if_addrs() and filters by socket.AF_INET family.
def get_network_info() -> dict[str, str]: """Get network information of the Windows system.""" import psutil import socket net_info = psutil.net_if_addrs() result = {} for interface, addresses in net_info.items(): for address in addresses: if address.family == socket.AF_INET: result[interface] = address.address return result if result else {"error": "No network interfaces found."}