Metadata-Version: 2.4
Name: posthog-agent-toolkit
Version: 0.1.0
Summary: PostHog Agent Toolkit for LangChain and other AI frameworks
Author-email: PostHog <hey@posthog.com>
Requires-Python: >=3.11
Requires-Dist: httpx>=0.25.0
Requires-Dist: langchain-core>=0.1.0
Requires-Dist: langchain-mcp-adapters>=0.1.0
Requires-Dist: pydantic>=2.5.0
Requires-Dist: python-dateutil>=2.8.2
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: typing-extensions>=4.8.0
Description-Content-Type: text/markdown

# PostHog MCP Server - Python Implementation

Python wrapper of the MCP server tools to make using PostHog easier in agents.

## Setup

### 1. Install Dependencies with uv

For production:

```bash
uv sync
```

For development (includes schema generation tools):

```bash
uv sync --dev
```

### 2. Alternative: Create Virtual Environment Manually

If you prefer to use pip:

```bash
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -e .
```

## Development

### Schema Generation

The Python implementation uses Pydantic models generated from the TypeScript Zod schemas:

```bash
# From the root directory
pnpm run schema:build          # Generate both JSON schema and Python models
```

This generates type-safe Pydantic models in `schema/tool_inputs.py` based on the shared JSON schema.

### Project Structure

```
python/
├── pyproject.toml           # Project configuration and dependencies
├── uv.lock                 # Locked dependency versions (generated by uv)
├── schema/
│   └── tool_inputs.py      # Generated Pydantic models
└── scripts/
    └── generate-pydantic-models.sh  # Schema generation script
```

### Running Commands

All Python commands should be run through uv:

```bash
# Run tests
uv run pytest

# Format code
uv run ruff format .

# Lint code
uv run ruff check --fix .
```

### Dependencies

Dependencies are managed in `pyproject.toml`.