productmetrics
v0.1.0PostHog projects, insights, flags and experiments as MCP tools.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_projects
List PostHog projects the API key can access.
get_project
Retrieve a PostHog project by ID, or the configured default project.
| Parameter | Type | Description |
|---|---|---|
project_id | string | Optional ID of the PostHog project to retrieve; when omitted, the POSTHOG_PROJECT_ID environment fallback is used. |
list_insights
List insights in a PostHog project.
| Parameter | Type | Description |
|---|---|---|
limit | number | Optional maximum number of insights to return, sent as the limit query parameter. |
project_id | string | Optional ID of the PostHog project to list insights from; when omitted, the POSTHOG_PROJECT_ID environment fallback is used. |
get_insight
Retrieve a single PostHog insight by ID.
| Parameter | Type | Description |
|---|---|---|
insight_id * | string | The ID of the PostHog insight to retrieve. |
project_id | string | Optional ID of the PostHog project the insight belongs to; when omitted, the POSTHOG_PROJECT_ID environment fallback is used. |
query_insight
Run a PostHog insight and return its query results.
| Parameter | Type | Description |
|---|---|---|
insight_id * | string | The ID of the PostHog insight to run; the request forces a refresh with refresh=true. |
project_id | string | Optional ID of the PostHog project the insight belongs to; when omitted, the POSTHOG_PROJECT_ID environment fallback is used. |
run_hogql_query
Run a HogQL query against a PostHog project.
| Parameter | Type | Description |
|---|---|---|
query * | string | The HogQL query text to run against the project. |
project_id | string | Optional ID of the PostHog project to run the query against; when omitted, the POSTHOG_PROJECT_ID environment fallback is used. |
list_feature_flags
List feature flags in a PostHog project.
| Parameter | Type | Description |
|---|---|---|
limit | number | Optional maximum number of feature flags to return, sent as the limit query parameter. |
project_id | string | Optional ID of the PostHog project to list feature flags from; when omitted, the POSTHOG_PROJECT_ID environment fallback is used. |
get_feature_flag
Retrieve a single PostHog feature flag by ID.
| Parameter | Type | Description |
|---|---|---|
flag_id * | string | The ID of the PostHog feature flag to retrieve. |
project_id | string | Optional ID of the PostHog project the flag belongs to; when omitted, the POSTHOG_PROJECT_ID environment fallback is used. |
create_feature_flag
Create a feature flag in a PostHog project.
| Parameter | Type | Description |
|---|---|---|
key * | string | The unique key of the new feature flag. |
active | boolean | Optional initial active state of the new feature flag. |
name | string | Optional human-readable name for the new feature flag. |
project_id | string | Optional ID of the PostHog project to create the flag in; when omitted, the POSTHOG_PROJECT_ID environment fallback is used. |
update_feature_flag
Update a PostHog feature flag by ID.
| Parameter | Type | Description |
|---|---|---|
flag_id * | string | The ID of the PostHog feature flag to update. |
active | boolean | Optional new active state: true activates the flag, false deactivates it. |
name | string | Optional new human-readable name for the flag; omitted fields are left unchanged. |
project_id | string | Optional ID of the PostHog project the flag belongs to; when omitted, the POSTHOG_PROJECT_ID environment fallback is used. |
list_experiments
List experiments in a PostHog project.
| Parameter | Type | Description |
|---|---|---|
limit | number | Optional maximum number of experiments to return, sent as the limit query parameter. |
project_id | string | Optional ID of the PostHog project to list experiments from; when omitted, the POSTHOG_PROJECT_ID environment fallback is used. |
get_experiment
Retrieve a single PostHog experiment by ID.
| Parameter | Type | Description |
|---|---|---|
experiment_id * | string | The ID of the PostHog experiment to retrieve. |
project_id | string | Optional ID of the PostHog project the experiment belongs to; when omitted, the POSTHOG_PROJECT_ID environment fallback is used. |