# {{ server_name }}

{{ description }}

## Quick Start

```bash
# Install dependencies
uv sync

# Set your API credentials
export {{ service_name | upper }}_API_URL="https://api.example.com"
export {{ service_name | upper }}_API_KEY="your-api-key"

# Run the server (stdio transport)
{{ server_name }}
```

## Configuration

| Environment Variable | Description | Default |
|---|---|---|
| `{{ service_name | upper }}_API_URL` | Base URL for the API | `https://api.example.com` |
| `{{ service_name | upper }}_API_KEY` | API key for authentication | (none) |

## Testing

```bash
# Run tests with hdx
hdx server test
```

> **Note**: The default test fixtures expect the API to be reachable.
> Update `tests/fixtures/test_tools.yaml` with valid test data for your API.

## Project Structure

```
{{ server_name }}/
├── src/
│   └── {{ python_package }}/
│       ├── __init__.py
│       └── server.py      # MCP server, API client, and tool definitions
├── tests/
│   └── fixtures/
│       └── test_tools.yaml # Test fixtures for hdx server test
├── pyproject.toml
└── README.md
```

## Adding Tools

Add new tools in `src/{{ python_package }}/server.py`:

```python
@mcp.tool(
    annotations={
        "title": "Create Resource",
        "readOnlyHint": False,
        "idempotentHint": False,
        "openWorldHint": True,
    }
)
def {{ tool_prefix }}_create(name: str, data: str) -> str:
    """Create a new resource via the API.

    Args:
        name: Name for the new resource.
        data: JSON payload for the resource.
    """
    with _get_client() as client:
        response = client.post("/resources", json={"name": name, "data": data})
        response.raise_for_status()
        result = response.json()
    return f"Created resource: {result}"
```

## MCP Configuration

To use this server with Claude Desktop, add to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "{{ service_name }}": {
      "command": "{{ server_name }}",
      "args": [],
      "env": {
        "{{ service_name | upper }}_API_URL": "https://api.example.com",
        "{{ service_name | upper }}_API_KEY": "your-api-key"
      }
    }
  }
}
```
