mcp-cuc-tjx 0.1.0
A cross-platform hardware information collection tool
License: MIT
Requires Python: >=3.6
Keywords: hardware, system, monitoring, cross-platform, cpu, gpu, memory, disk

# MCP - Multi-Platform Hardware Information Collection Tool

MCP is a cross-platform tool for collecting comprehensive hardware and system information, including CPU, GPU, memory, disk, operating system, and network configuration details.

## Features

- **Cross-platform support**: Works on Windows, macOS, and Linux
- **Comprehensive information collection**:
  - CPU: Brand, physical cores, logical cores, frequency, architecture
  - GPU: Model, driver version, memory size (platform-specific implementation)
  - Memory: Total, available, used, usage percentage
  - Disk: Device, mount point, file system type, total space, used space, free space, usage percentage
  - Operating System: Type, release, version, hostname
  - Network: Interface names and IP addresses
- **Error handling**: Gracefully handles exceptions and returns error messages when information collection fails
- **Structured data output**: Returns information in structured dictionary format, easily convertible to JSON

## Installation

You can install MCP using pip:

```bash
pip install mcp-hardware-info
```

## Usage

### Command Line

After installation, you can use the `mcp` command to get hardware information:

```bash
mcp
```

This will output all hardware information in JSON format.

### Python API

You can also use MCP as a Python library:

```python
from mcp.server import get_all_hardware_info, get_cpu_info, get_gpu_info, get_memory_info, get_disk_info, get_os_info, get_network_info

# Get all hardware information
hardware_info = get_all_hardware_info()
print(hardware_info)

# Get specific hardware information
cpu_info = get_cpu_info()
gpu_info = get_gpu_info()
memory_info = get_memory_info()
disk_info = get_disk_info()
os_info = get_os_info()
network_info = get_network_info()
```

## Examples

### Example Output

```json
{
  "cpu": {
    "brand": "Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz",
    "physical_cores": 8,
    "logical_cores": 16,
    "frequency_ghz": 4.7,
    "architecture": "x86_64"
  },
  "gpu": {
    "gpus": [
      {
        "name": "NVIDIA GeForce RTX 3080",
        "memory_mb": 10240
      }
    ]
  },
  "memory": {
    "total_gb": 32.0,
    "available_gb": 20.5,
    "used_gb": 11.5,
    "usage_percent": 35.9
  },
  "disk": {
    "disks": [
      {
        "device": "/dev/sda1",
        "mountpoint": "/",
        "fstype": "ext4",
        "total_gb": 500.0,
        "used_gb": 200.0,
        "free_gb": 300.0,
        "usage_percent": 40.0
      }
    ]
  },
  "os": {
    "system": "Linux",
    "release": "5.15.0-48-generic",
    "version": "#54-Ubuntu SMP Fri Aug 26 13:26:29 UTC 2022",
    "hostname": "my-computer",
    "platform": "Linux-5.15.0-48-generic-x86_64-with-glibc2.35",
    "processor": "x86_64"
  },
  "network": {
    "interfaces": [
      {
        "name": "eth0",
        "addresses": [
          {
            "type": "IPv4",
            "address": "192.168.1.100",
            "netmask": "255.255.255.0"
          }
        ]
      }
    ]
  }
}
```

## Requirements

- Python 3.6+
- psutil >= 5.9.0
- py-cpuinfo >= 9.0.0

## License

This project is licensed under the MIT License - see the LICENSE file for details.

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## Acknowledgments

- [psutil](https://github.com/giampaolo/psutil): Cross-platform library for retrieving information on running processes and system utilization
- [py-cpuinfo](https://github.com/workhorsy/py-cpuinfo): Python module to get CPU info