A Model Context Protocol (MCP) server that provides detailed host machine information.
mcp-python-host_info/
├── src/
│ ├── host_info/ # Main package
│ │ ├── __init__.py # Package exports
│ │ ├── main.py # MCP server setup
│ │ └── tools.py # Host info implementation
│ └── main.py # Entry point
├── tests/
│ ├── host_info/ # Test package
│ │ ├── test_main.py # MCP server tests
│ │ └── test_tools.py # Host info tests
│ └── conftest.py # Test configuration
└── pyproject.toml # Project configuration
Use uv to manage the dependencies:
git clone ...
cd mcp-python-host_info
uv sync
For development, install test dependencies:
uv pip install -e ".[dev]"
# install the pacakge in development mode
uv pip install -e .
Run the test suite with coverage report:
pytest
This will:
- Run all tests in the
tests/
directory - Generate a coverage report for the
host_info
package - Show missing lines in the coverage report
Test files are organized to mirror the package structure:
test_tools.py
: Tests for host information gathering functionalitytest_main.py
: Tests for MCP server setup and configuration
Run the MCP server:
uv run python src/main.py
Debug the MCP server:
uv add "mcp[cli]"
uv run mcp dev src/main.py
get_host_info
: Returns detailed system information in JSON format including:- Platform details
- CPU information
- Memory size
- Python environment
- System-specific details (e.g., macOS system profiler)