Metadata-Version: 2.4
Name: mcpwatch
Version: 1.0.0
Summary: MCPWatch SDK for MCP server observability
Project-URL: Homepage, https://mcpwatch.dev/docs
Project-URL: Repository, https://github.com/Lucid-Mobile/mcpwatch-sdk-python
Author: Lucid Mobile LLC
License-Expression: MIT
License-File: LICENSE
Keywords: mcp,mcpwatch,model-context-protocol,observability,sdk
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Requires-Dist: httpx>=0.28
Requires-Dist: pydantic>=2.10
Provides-Extra: dev
Requires-Dist: mcp>=1.6; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.25; extra == 'dev'
Requires-Dist: pytest>=8.3; extra == 'dev'
Description-Content-Type: text/markdown

# mcpwatch

Observability SDK for MCP servers. Captures tool calls, resource reads, prompts, and lifecycle events with zero configuration.

## Installation

```bash
pip install mcpwatch
```

## Quick Start

```python
import os
from mcp.server import Server
from mcpwatch import instrument

server = instrument(
    Server("my-server"),
    api_key=os.environ["MCPWATCH_API_KEY"],
    endpoint="https://api.mcpwatch.dev",
)

# Define tools as usual — they're automatically instrumented
@server.tool("get_weather")
async def get_weather(city: str) -> str:
    return f"Weather in {city}: 72°F"
```

## Configuration

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `api_key` | `str` | — | **Required.** Your MCPWatch API key |
| `endpoint` | `str` | `https://api.mcpwatch.dev` | Ingestion endpoint URL |
| `debug` | `bool` | `False` | Enable debug logging |
| `sample_rate` | `float` | `1.0` | Event sampling rate (0.0–1.0) |
| `max_batch_size` | `int` | `50` | Max events per batch |
| `flush_interval` | `float` | `1.0` | Flush interval in seconds |
| `on_quota_warning` | `Callable` | `None` | Callback when quota is approaching limits |

## Examples

See the [examples/](./examples/) directory for complete working examples.

## Requirements

- Python 3.10+

## License

[MIT License](./LICENSE)
