Skip to content
This repository was archived by the owner on Jan 19, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.test.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Test environment configuration
TEST_API_BASE_URL=http://localhost:8010
TEST_API_TOKEN=your_posthog_api_token_here
2 changes: 0 additions & 2 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ jobs:

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Setup Node.js
uses: actions/setup-node@v4
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ node_modules
.wrangler
.dev.vars*
.mcp.json
.env.test

# Editor-specific files
.cursor/
3 changes: 2 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ This is a PostHog MCP (Model Context Protocol) server built on Cloudflare Worker
### Key Components

- **Main MCP Class (`src/index.ts`)**: `MyMCP` extends `McpAgent` and defines all available tools for interacting with PostHog
- **API Layer (`src/posthogApi.ts`)**: Functions for making requests to PostHog's REST API
- **Unified API Client (`src/api/client.ts`)**: `ApiClient` class provides type-safe methods for all PostHog API interactions with proper error handling and schema validation
- **Schema Validation (`src/schema/`)**: Zod schemas for validating API requests and responses
- **Caching (`src/lib/utils/cache/`)**: User-scoped memory cache for storing project/org state
- **Documentation Search (`src/inkeepApi.ts`)**: Integration with Inkeep for PostHog docs search
- **Utility Functions (`src/lib/utils/api.ts`)**: Helper functions for pagination and URL generation

### Authentication & State Management

Expand Down
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,27 @@
"dev": "wrangler dev",
"format": "biome format --write",
"lint:fix": "biome lint --fix",
"test": "vitest",
"test:watch": "vitest watch",
"start": "wrangler dev",
"cf-typegen": "wrangler types",
"prepare": "husky"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@types/node": "^22.15.18",
"@types/node": "^22.15.34",
"dotenv": "^16.4.7",
"husky": "^9.1.7",
"typescript": "^5.8.3",
"vitest": "^3.2.4",
"wrangler": "^4.14.4"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.11.1",
"@types/dotenv": "^6.1.1",
"agents": "^0.0.80",
"posthog-node": "^4.18.0",
"zod": "^3.24.4"
}
},
"packageManager": "pnpm@9.15.5+sha256.8472168c3e1fd0bff287e694b053fccbbf20579a3ff9526b6333beab8df65a8d"
}
Loading