Metadata-Version: 2.4
Name: system-info-mcp
Version: 0.0.2
Summary: MCP server provide system information tools
Author-email: jayeliu <jayeliu@example.com>
License: MIT
Keywords: mcp,system-info,tools
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.12
Requires-Dist: fastmcp>=2.0
Description-Content-Type: text/markdown

# System Info MCP Server

A Model Context Protocol (MCP) server that provides system information tools.

## Features

- Cross-platform support (Windows, macOS, Linux)
- Basic system information: OS, architecture, shell
- FastMCP-based implementation
- Comprehensive error handling

## Installation

```bash
uv sync
```

## Usage

### Run with stdio (default)

```bash
uv run python -m system_info_mcp.server
```

### Run with HTTP transport

```bash
uv run python -m system_info_mcp.server --transport http --port 8000
```

Or modify `server.py`:

```python
if __name__ == "__main__":
    mcp.run(transport="http", port=8000)
```

## MCP Client Configuration

### Claude Desktop

Add to `claude_desktop_config.json`:

<CodeGroup>
  ```json (stdio)
  {
    "mcpServers": {
      "system-info": {
        "command": "uv",
        "args": ["run", "python", "-m", "system_info_mcp.server"]
      }
    }
  }
  ```

  ```json (HTTP)
  {
    "mcpServers": {
      "system-info": {
        "url": "http://localhost:8000/mcp",
        "transport": "http"
      }
    }
  }
  ```
</CodeGroup>

### VS Code (MCP Extension)

Add to `.vscode/mcp.json`:

```json
{
  "servers": [
    {
      "name": "system-info",
      "command": "uv",
      "args": ["run", "python", "-m", "system_info_mcp.server"],
      "transport": "stdio"
    }
  ]
}
```

### Programmatic Client

```python
import asyncio
from fastmcp import Client

async def main():
    # Connect via HTTP
    async with Client("http://localhost:8000/mcp") as client:
        result = await client.call_tool("get_system_info", {})
        print(result)

    # Or connect via stdio
    async with Client("python -m system_info_mcp.server") as client:
        result = await client.call_tool("get_system_info", {})
        print(result)

asyncio.run(main())
```

## Supported Transports

| Transport | Description | Use Case |
|-----------|-------------|----------|
| **stdio** | Standard input/output | Local development, Claude Desktop, VS Code |
| **HTTP** | HTTP server with SSE | Remote servers, web deployments |
| **SSE** | Server-Sent Events | Streaming responses, real-time updates |

## Development

```bash
# Install dependencies
uv sync

# Run tests
pytest tests/ -v

# Format code
ruff format src/ tests/
```

## Tool Specification

**Tool Name:** `get_system_info`

**Description:** 获取系统基本信息并返回JSON

**Response Format:**
```json
{
  "os": "Darwin",
  "os_version": "Darwin Kernel Version 23.4.0",
  "os_release": "23.4.0",
  "architecture": "arm64",
  "processor": "arm",
  "shell": "/bin/zsh"
}
```