# Pier Cloud MCP Server

A scalable Model Context Protocol server with clean architecture.

## Installation

```bash
# Install via pip
pip install piercloud-mcp

# Or via pipx (recommended for CLI tools)
pipx install piercloud-mcp
```

## Quick Start

```bash
# Local mode (stdio)
piercloud-mcp

# Production mode (HTTP/SSE)
piercloud-mcp --sse --port 8000
```

## Setup for Claude Desktop

1. Install the package:

```bash
pipx install piercloud-mcp
```

2. Add to Claude config:

**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
**Linux**: `~/.config/Claude/claude_desktop_config.json`

```json
{
  "mcpServers": {
    "piercloud": {
      "command": "piercloud-mcp",
      "env": {
        "PIERCLOUD_CLIENT_ID": "your-client-id",
        "PIERCLOUD_CLIENT_SECRET": "your-client-secret"
      }
    }
  }
}
```

3. Restart Claude Desktop

## Production Deployment

Deploy as HTTP server:

```bash
# Run server
piercloud-mcp --sse --port 8000

# With custom host
piercloud-mcp --sse --host 0.0.0.0 --port 8000
```

### Remote MCP Server (Claude, Cline, etc)

```json
{
  "mcpServers": {
    "pier": {
      "url": "https://mcp.piercloud.io/mcp/sse"
    }
  }
}
```

## Adding Tools

Create a new file in `src/pier_mcp/tools/` and register:

```python
from pydantic import BaseModel, Field

class MyToolInput(BaseModel):
    param: str = Field(description="Parameter description")

def register_my_tools(mcp):
    @mcp.tool("my_tool", "Tool description", MyToolInput)
    async def my_tool(args: MyToolInput) -> str:
        return f"Result: {args.param}"
```

Then import in `main.py`:

```python
from pier_mcp.tools.my_tools import register_my_tools
register_my_tools(mcp)
```

## Architecture

- `server.py` - Core MCP server with tool registry
- `tools/` - Tool implementations (one file per domain)
- `main.py` - Entry point and tool registration

Clean, minimal, scalable.
