Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(mcp-analytics): expose intent-clustering and intent-generation via MCP (#63419)

Sam Pennington632567f7384d
diff --git a/frontend/src/lib/scopes.tsx b/frontend/src/lib/scopes.tsx
index 72afaf2e3c1e..73155ac7edaa 100644
--- a/frontend/src/lib/scopes.tsx
+++ b/frontend/src/lib/scopes.tsx
@@ -70,6 +70,7 @@ export const API_SCOPES: APIScope[] = [
{ key: 'llm_skill', objectName: 'LLM skill', objectPlural: 'LLM skills' },
{ key: 'logs', objectName: 'Logs', objectPlural: 'logs' },
{ key: 'marketing_analytics', objectName: 'Marketing analytics', objectPlural: 'marketing analytics' },
+ { key: 'mcp_analytics', objectName: 'MCP analytics', objectPlural: 'MCP analytics' },
{ key: 'metrics', objectName: 'Metrics', objectPlural: 'metrics' },
{ key: 'notebook', objectName: 'Notebook', objectPlural: 'notebooks' },
{ key: 'organization', objectName: 'Organization', objectPlural: 'organizations', disabledWhenProjectScoped: true },
diff --git a/frontend/src/types.ts b/frontend/src/types.ts
index 53a62d94ae0d..4d5a9637884d 100644
--- a/frontend/src/types.ts
+++ b/frontend/src/types.ts
@@ -5533,6 +5533,7 @@ export type APIScopeObject =
| 'llm_skill'
| 'logs'
| 'marketing_analytics'
+ | 'mcp_analytics'
| 'metrics'
| 'notebook'
| 'organization'
diff --git a/posthog/scopes.py b/posthog/scopes.py
index 5074f02132e9..be1dc5ac8fd5 100644
--- a/posthog/scopes.py
+++ b/posthog/scopes.py
@@ -71,6 +71,7 @@ APIScopeObject = Literal[
"llm_skill",
"logs",
"marketing_analytics",
+ "mcp_analytics",
"metrics",
"notebook",
"organization",
diff --git a/products/mcp_analytics/backend/presentation/views.py b/products/mcp_analytics/backend/presentation/views.py
index 97eb15bf62df..525c2bfc6119 100644
--- a/products/mcp_analytics/backend/presentation/views.py
+++ b/products/mcp_analytics/backend/presentation/views.py
@@ -15,7 +15,7 @@ from posthog.api.mixins import ValidatedRequest, validated_request
from posthog.api.routing import TeamAndOrgViewSetMixin
from posthog.event_usage import report_user_action
from posthog.models.user import User
-from posthog.permissions import SingleTenancyOrAdmin
+from posthog.permissions import PostHogFeatureFlagPermission, SingleTenancyOrAdmin
from products.mcp_analytics.backend import logic
from products.mcp_analytics.backend.facade import api, contracts, enums
@@ -139,8 +139,14 @@ class MCPFeedbackViewSet(BaseMCPAnalyticsSubmissionViewSet):
class MCPSessionViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
serializer_class = MCPSessionSerializer
- permission_classes = [IsAuthenticated, SingleTenancyOrAdmin]
- scope_object = "INTERNAL"
+ scope_object = "mcp_analytics"
+ # tool_calls is a detail GET (read); generate_intent is a POST that computes + persists the
+ # intent summary, so it maps to the write scope. The default read/write action lists don't
+ # cover custom @action names, so APIScopePermission would otherwise reject token access.
+ scope_object_read_actions = ["list", "retrieve", "tool_calls"]
+ scope_object_write_actions = ["generate_intent"]
+ posthog_feature_flag = "mcp-analytics"
+ permission_classes = [PostHogFeatureFlagPermission]
pagination_class = MCPSessionPagination
def dangerously_get_queryset(self) -> QuerySet:
@@ -227,8 +233,13 @@ class MCPSessionViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
class MCPIntentClusterViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
serializer_class = MCPIntentClusterSnapshotSerializer
- permission_classes = [IsAuthenticated, SingleTenancyOrAdmin]
- scope_object = "INTERNAL"
+ scope_object = "mcp_analytics"
+ # recompute is a POST that kicks off the async clustering task (a state change), so it maps to
+ # the write scope; the snapshot read stays on the read scope.
+ scope_object_read_actions = ["list", "retrieve"]
+ scope_object_write_actions = ["recompute"]
+ posthog_feature_flag = "mcp-analytics"
+ permission_classes = [PostHogFeatureFlagPermission]
pagination_class = None
def dangerously_get_queryset(self) -> QuerySet:
diff --git a/products/mcp_analytics/backend/tests/test_presentation.py b/products/mcp_analytics/backend/tests/test_presentation.py
index dc21e9619113..aca58f8b975a 100644
--- a/products/mcp_analytics/backend/tests/test_presentation.py
+++ b/products/mcp_analytics/backend/tests/test_presentation.py
@@ -134,7 +134,8 @@ class TestMCPAnalyticsPresentation(_MCPAnalyticsTeamScopedTestMixin, APIBaseTest
assert response.json()["attr"] == field
def test_intent_clusters_returns_empty_idle_when_no_snapshot(self) -> None:
- response = self.client.get(f"/api/environments/{self.team.id}/mcp_analytics/intent_clusters/")
+ with patch("posthoganalytics.feature_enabled", return_value=True):
+ response = self.client.get(f"/api/environments/{self.team.id}/mcp_analytics/intent_clusters/")
assert response.status_code == status.HTTP_200_OK
data = response.json()
@@ -172,7 +173,8 @@ class TestMCPAnalyticsPresentation(_MCPAnalyticsTeamScopedTestMixin, APIBaseTest
},
)
- response = self.client.get(f"/api/environments/{self.team.id}/mcp_analytics/intent_clusters/")
+ with patch("posthoganalytics.feature_enabled", return_value=True):
+ response = self.client.get(f"/api/environments/{self.team.id}/mcp_analytics/intent_clusters/")
assert response.status_code == status.HTTP_200_OK
data = response.json()
@@ -185,7 +187,10 @@ class TestMCPAnalyticsPresentation(_MCPAnalyticsTeamScopedTestMixin, APIBaseTest
# Mock only the Celery dispatch so the synchronous COMPUTING write
# still runs. The 202 body should reflect the new state, not the
# stale pre-trigger state.
- with patch("products.mcp_analytics.backend.tasks.tasks.compute_intent_clusters.delay") as mock_delay:
+ with (
+ patch("products.mcp_analytics.backend.tasks.tasks.compute_intent_clusters.delay") as mock_delay,
+ patch("posthoganalytics.feature_enabled", return_value=True),
+ ):
response = self.client.post(
f"/api/environments/{self.team.id}/mcp_analytics/intent_clusters/recompute/", {}, format="json"
)
@@ -286,7 +291,8 @@ class TestMCPSessionIntentEndpoint(_MCPAnalyticsTeamScopedTestMixin, APIBaseTest
session_id = "session-123"
MCPSession.objects.create(team=self.team, session_id=session_id, intent="A persisted summary.")
- response = self.client.post(self._url(session_id))
+ with patch("posthoganalytics.feature_enabled", return_value=True):
+ response = self.client.post(self._url(session_id))
assert response.status_code == status.HTTP_200_OK
assert response.json() == {"session_id": session_id, "intent": "A persisted summary."}
@@ -295,6 +301,7 @@ class TestMCPSessionIntentEndpoint(_MCPAnalyticsTeamScopedTestMixin, APIBaseTest
session_id = "session-fresh"
# Mock the two primitives so the endpoint path runs without ClickHouse or a real LLM call.
with (
+ patch("posthoganalytics.feature_enabled", return_value=True),
patch.object(intent_generation, "fetch_session_intents", return_value=["check the funnel"]),
patch.object(intent_generation, "summarize_intents", return_value="Generated summary."),
):
@@ -307,6 +314,7 @@ class TestMCPSessionIntentEndpoint(_MCPAnalyticsTeamScopedTestMixin, APIBaseTest
def test_returns_503_when_generation_unavailable(self) -> None:
session_id = "session-unavailable"
with (
+ patch("posthoganalytics.feature_enabled", return_value=True),
patch.object(intent_generation, "fetch_session_intents", return_value=["check the funnel"]),
patch.object(
intent_generation,
diff --git a/products/mcp_analytics/mcp/tools.yaml b/products/mcp_analytics/mcp/tools.yaml
index 45ccbd0fbea2..fa34d72b72f5 100644
--- a/products/mcp_analytics/mcp/tools.yaml
+++ b/products/mcp_analytics/mcp/tools.yaml
@@ -11,13 +11,51 @@ ui_apps: {}
tools:
mcp-analytics-intent-clusters-recompute:
operation: mcp_analytics_intent_clusters_recompute
- enabled: false
+ enabled: true
+ scopes:
+ - mcp_analytics:write
+ annotations:
+ readOnly: false
+ destructive: false
+ idempotent: false
+ title: Recompute intent clusters
+ description: >
+ Trigger an asynchronous recompute of the intent-cluster snapshot: embed the project's recorded agent intents
+ and re-cluster them. Returns immediately with status 'computing'; poll
+ mcp-analytics-intent-clusters-retrieve for progress (status becomes 'idle' or 'error').
+ requires_ai_consent: true
+ feature_flag: mcp-analytics
mcp-analytics-intent-clusters-retrieve:
operation: mcp_analytics_intent_clusters_retrieve
- enabled: false
+ enabled: true
+ scopes:
+ - mcp_analytics:read
+ annotations:
+ readOnly: true
+ destructive: false
+ idempotent: true
+ title: Get intent cluster snapshot
+ description: >
+ Return the most recent intent-clustering snapshot for the project: clusters of similar agent intents, each
+ with its tool distribution, error rate, routing entropy, and journey paths. Returns an empty idle snapshot
+ when no clustering run has happened yet — trigger one with mcp-analytics-intent-clusters-recompute.
+ feature_flag: mcp-analytics
mcp-analytics-sessions-generate-intent:
operation: mcp_analytics_sessions_generate_intent
- enabled: false
+ enabled: true
+ scopes:
+ - mcp_analytics:write
+ annotations:
+ readOnly: false
+ destructive: false
+ idempotent: true
+ title: Generate session intent summary
+ description: >
+ Generate (or return the cached) LLM summary of the agent's goal for a session, derived from the session's
+ recorded intents. The first call summarises and persists the result; subsequent calls return the stored
+ summary.
+ requires_ai_consent: true
+ feature_flag: mcp-analytics
mcp-analytics-sessions-list:
operation: mcp_analytics_sessions_list
enabled: false
diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.json
index 12dfab2bb9a1..f3f77284ecc4 100644
--- a/services/mcp/schema/generated-tool-definitions.json
+++ b/services/mcp/schema/generated-tool-definitions.json
@@ -4806,6 +4806,53 @@
},
"feature_flag": "marketing-analytics-mcp"
},
+ "mcp-analytics-intent-clusters-recompute": {
+ "description": "Trigger an asynchronous recompute of the intent-cluster snapshot: embed the project's recorded agent intents and re-cluster them. Returns immediately with status 'computing'; poll mcp-analytics-intent-clusters-retrieve for progress (status becomes 'idle' or 'error').",
+ "category": "MCP analytics",
+ "feature": "mcp_analytics",
+ "summary": "Recompute intent clusters",
+ "title": "Recompute intent clusters",
+ "required_scopes": ["mcp_analytics:write"],
+ "annotations": {
+ "destructiveHint": false,
+ "idempotentHint": false,
+ "openWorldHint": true,
+ "readOnlyHint": false
+ },
+ "requires_ai_consent": true,
+ "feature_flag": "mcp-analytics"
+ },
+ "mcp-analytics-intent-clusters-retrieve": {
+ "description": "Return the most recent intent-clustering snapshot for the project: clusters of similar agent intents, each with its tool distribution, error rate, routing entropy, and journey paths. Returns an empty idle snapshot when no clustering run has happened yet — trigger one with mcp-analytics-intent-clusters-recompute.",
+ "category": "MCP analytics",
+ "feature": "mcp_analytics",
+ "summary": "Get intent cluster snapshot",
+ "title": "Get intent cluster snapshot",
+ "required_scopes": ["mcp_analytics:read"],
+ "annotations": {
+ "destructiveHint": false,
+ "idempotentHint": true,
+ "openWorldHint": true,
+ "readOnlyHint": true
+ },
+ "feature_flag": "mcp-analytics"
+ },
+ "mcp-analytics-sessions-generate-intent": {
+ "description": "Generate (or return the cached) LLM summary of the agent's goal for a session, derived from the session's recorded intents. The first call summarises and persists the result; subsequent calls return the stored summary.",
+ "category": "MCP analytics",
+ "feature": "mcp_analytics",
+ "summary": "Generate session intent summary",
+ "title": "Generate session intent summary",
+ "required_scopes": ["mcp_analytics:write"],
+ "annotations": {
+ "destructiveHint": false,
+ "idempotentHint": true,
+ "openWorldHint": true,
+ "readOnlyHint": false
+ },
+ "requires_ai_consent": true,
+ "feature_flag": "mcp-analytics"
+ },
"notebooks-create": {
"description": "Create a new notebook. Provide a title and content. Content is a JSON object representing the notebook's rich text document structure (ProseMirror-based). Returns the created notebook with its short_id.\nEmbedded charts use `{type: \"ph-query\", attrs: {nodeId, query}}` nodes. The `query` object must be one of: (a) `{kind: \"DataVisualizationNode\", source: {kind: \"HogQLQuery\", query: \"SELECT ...\"}, display: \"ActionsBar\", chartSettings: {...}}` for SQL charts — do NOT wrap this in an InsightVizNode; (b) `{kind: \"InsightVizNode\", source: <TrendsQuery | FunnelsQuery | RetentionQuery | PathsQuery | StickinessQuery | LifecycleQuery>}` for product-analytics insights; or (c) `{kind: \"SavedInsightNode\", shortId: \"...\"}` to embed a saved insight. The server rejects other shapes and auto-corrects the common `InsightVizNode` wrapping a SQL chart.",
"category": "Notebooks",
diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.json
index 77e3e51cf011..d66e41a437cf 100644
--- a/services/mcp/schema/tool-definitions-all.json
+++ b/services/mcp/schema/tool-definitions-all.json
@@ -5214,6 +5214,53 @@
},
"feature_flag": "marketing-analytics-mcp"
},
+ "mcp-analytics-intent-clusters-recompute": {
+ "description": "Trigger an asynchronous recompute of the intent-cluster snapshot: embed the project's recorded agent intents and re-cluster them. Returns immediately with status 'computing'; poll mcp-analytics-intent-clusters-retrieve for progress (status becomes 'idle' or 'error').",
+ "category": "MCP analytics",
+ "feature": "mcp_analytics",
+ "summary": "Recompute intent clusters",
+ "title": "Recompute intent clusters",
+ "required_scopes": ["mcp_analytics:write"],
+ "annotations": {
+ "destructiveHint": false,
+ "idempotentHint": false,
+ "openWorldHint": true,
+ "readOnlyHint": false
+ },
+ "requires_ai_consent": true,
+ "feature_flag": "mcp-analytics"
+ },
+ "mcp-analytics-intent-clusters-retrieve": {
+ "description": "Return the most recent intent-clustering snapshot for the project: clusters of similar agent intents, each with its tool distribution, error rate, routing entropy, and journey paths. Returns an empty idle snapshot when no clustering run has happened yet — trigger one with mcp-analytics-intent-clusters-recompute.",
+ "category": "MCP analytics",
+ "feature": "mcp_analytics",
+ "summary": "Get intent cluster snapshot",
+ "title": "Get intent cluster snapshot",
+ "required_scopes": ["mcp_analytics:read"],
+ "annotations": {
+ "destructiveHint": false,
+ "idempotentHint": true,
+ "openWorldHint": true,
+ "readOnlyHint": true
+ },
+ "feature_flag": "mcp-analytics"
+ },
+ "mcp-analytics-sessions-generate-intent": {
+ "description": "Generate (or return the cached) LLM summary of the agent's goal for a session, derived from the session's recorded intents. The first call summarises and persists the result; subsequent calls return the stored summary.",
+ "category": "MCP analytics",
+ "feature": "mcp_analytics",
+ "summary": "Generate session intent summary",
+ "title": "Generate session intent summary",
+ "required_scopes": ["mcp_analytics:write"],
+ "annotations": {
+ "destructiveHint": false,
+ "idempotentHint": true,
+ "openWorldHint": true,
+ "readOnlyHint": false
+ },
+ "requires_ai_consent": true,
+ "feature_flag": "mcp-analytics"
+ },
"notebook-edit": {
"description": "Edit part of a notebook's content. Use this for any change inside a notebook — text, headings, attributes, whole paragraphs. Call `notebooks-retrieve` first to see what to target.\n\nMatching is by content. The tool finds `old_value` anywhere in the notebook and swaps it for `new_value` in place.\n\nOn success, returns the updated notebook with the new content and bumped version. On a 409 or 410 error, the notebook has changed since you loaded it — call `notebooks-retrieve` and re-apply your edit against the latest content.",
"category": "Notebooks",
diff --git a/services/mcp/src/generated/mcp_analytics/api.ts b/services/mcp/src/generated/mcp_analytics/api.ts
new file mode 100644
index 000000000000..6de2a61fb888
--- /dev/null
+++ b/services/mcp/src/generated/mcp_analytics/api.ts
@@ -0,0 +1,43 @@
+/**
+ * Auto-generated from the Django backend OpenAPI schema.
+ * MCP service uses these Zod schemas for generated tool handlers.
+ * To regenerate: hogli build:openapi
+ *
+ * PostHog API - MCP 3 enabled ops
+ * OpenAPI spec version: 1.0.0
+ */
+import * as zod from 'zod'
+
+/**
+ * Return the most recent intent cluster snapshot for the current project. Returns an empty IDLE snapshot when no clustering run has happened yet.
+ */
+export const McpAnalyticsIntentClustersRetrieveParams = /* @__PURE__ */ zod.object({
+ project_id: zod
+ .string()
+ .describe(
+ "Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/."
+ ),
+})
+
+/**
+ * Trigger an asynchronous recompute of the intent cluster snapshot. The task runs in the background; poll the GET endpoint for progress (status transitions to 'idle' or 'error').
+ */
+export const McpAnalyticsIntentClustersRecomputeParams = /* @__PURE__ */ zod.object({
+ project_id: zod
+ .string()
+ .describe(
+ "Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/."
+ ),
+})
+
+/**
+ * Generate (or return the cached) LLM summary of the agent's goal for a session, derived from its recorded $mcp_intents. The first call summarises and persists the result; subsequent calls return the stored summary.
+ */
+export const McpAnalyticsSessionsGenerateIntentParams = /* @__PURE__ */ zod.object({
+ id: zod.string().describe('A UUID string identifying this mcp analytics submission.'),
+ project_id: zod
+ .string()
+ .describe(
+ "Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/."
+ ),
+})
diff --git a/services/mcp/src/lib/oauth-scopes.generated.ts b/services/mcp/src/lib/oauth-scopes.generated.ts
index 516b54e61fc6..33bab491b8c6 100644
--- a/services/mcp/src/lib/oauth-scopes.generated.ts
+++ b/services/mcp/src/lib/oauth-scopes.generated.ts
@@ -119,6 +119,8 @@ export const OAUTH_SCOPES_SUPPORTED = [
'logs:write',
'marketing_analytics:read',
'marketing_analytics:write',
+ 'mcp_analytics:read',
+ 'mcp_analytics:write',
'notebook:read',
'notebook:write',
'organization:read',
diff --git a/services/mcp/src/tools/generated/index.ts b/services/mcp/src/tools/generated/index.ts
index ceabbe93486a..e4b038a5ffec 100644
--- a/services/mcp/src/tools/generated/index.ts
+++ b/services/mcp/src/tools/generated/index.ts
@@ -29,6 +29,7 @@ import { GENERATED_TOOLS as health_issues } from './health_issues'
import { GENERATED_TOOLS as integrations } from './integrations'
import { GENERATED_TOOLS as logs } from './logs'
import { GENERATED_TOOLS as marketing_analytics } from './marketing_analytics'
+import { GENERATED_TOOLS as mcp_analytics } from './mcp_analytics'
import { GENERATED_TOOLS as notebooks } from './notebooks'
import { GENERATED_TOOLS as persons } from './persons'
import { GENERATED_TOOLS as platform_features } from './platform_features'
@@ -77,6 +78,7 @@ export const GENERATED_TOOL_MAP: Record<string, () => ToolBase<ZodObjectAny>> =
...integrations,
...logs,
...marketing_analytics,
+ ...mcp_analytics,
...notebooks,
...persons,
...platform_features,
diff --git a/services/mcp/src/tools/generated/mcp_analytics.ts b/services/mcp/src/tools/generated/mcp_analytics.ts
new file mode 100644
index 000000000000..fe556c04be48
--- /dev/null
+++ b/services/mcp/src/tools/generated/mcp_analytics.ts
@@ -0,0 +1,68 @@
+// AUTO-GENERATED from products/mcp_analytics/mcp/tools.yaml + OpenAPI — do not edit
+import { z } from 'zod'
+
+import type { Schemas } from '@/api/generated'
+import { McpAnalyticsSessionsGenerateIntentParams } from '@/generated/mcp_analytics/api'
+import type { Context, ToolBase, ZodObjectAny } from '@/tools/types'
+
+const McpAnalyticsIntentClustersRecomputeSchema = z.object({})
+
+const mcpAnalyticsIntentClustersRecompute = (): ToolBase<
+ typeof McpAnalyticsIntentClustersRecomputeSchema,
+ unknown
+> => ({
+ name: 'mcp-analytics-intent-clusters-recompute',
+ schema: McpAnalyticsIntentClustersRecomputeSchema,
+ // eslint-disable-next-line no-unused-vars
+ handler: async (context: Context, params: z.infer<typeof McpAnalyticsIntentClustersRecomputeSchema>) => {
+ const projectId = await context.stateManager.getProjectId()
+ const result = await context.api.request<unknown>({
+ method: 'POST',
+ path: `/api/projects/${encodeURIComponent(String(projectId))}/mcp_analytics/intent_clusters/recompute/`,
+ })
+ return result
+ },
+})
+
+const McpAnalyticsIntentClustersRetrieveSchema = z.object({})
+
+const mcpAnalyticsIntentClustersRetrieve = (): ToolBase<
+ typeof McpAnalyticsIntentClustersRetrieveSchema,
+ Schemas.MCPIntentClusterSnapshot[]
+> => ({
+ name: 'mcp-analytics-intent-clusters-retrieve',
+ schema: McpAnalyticsIntentClustersRetrieveSchema,
+ // eslint-disable-next-line no-unused-vars
+ handler: async (context: Context, params: z.infer<typeof McpAnalyticsIntentClustersRetrieveSchema>) => {
+ const projectId = await context.stateManager.getProjectId()
+ const result = await context.api.request<Schemas.MCPIntentClusterSnapshot[]>({
+ method: 'GET',
+ path: `/api/projects/${encodeURIComponent(String(projectId))}/mcp_analytics/intent_clusters/`,
+ })
+ return result
+ },
+})
+
+const McpAnalyticsSessionsGenerateIntentSchema = McpAnalyticsSessionsGenerateIntentParams.omit({ project_id: true })
+
+const mcpAnalyticsSessionsGenerateIntent = (): ToolBase<
+ typeof McpAnalyticsSessionsGenerateIntentSchema,
+ Schemas.MCPSessionIntent
+> => ({
+ name: 'mcp-analytics-sessions-generate-intent',
+ schema: McpAnalyticsSessionsGenerateIntentSchema,
+ handler: async (context: Context, params: z.infer<typeof McpAnalyticsSessionsGenerateIntentSchema>) => {
+ const projectId = await context.stateManager.getProjectId()
+ const result = await context.api.request<Schemas.MCPSessionIntent>({
+ method: 'POST',
+ path: `/api/projects/${encodeURIComponent(String(projectId))}/mcp_analytics/sessions/${encodeURIComponent(String(params.id))}/generate_intent/`,
+ })
+ return result
+ },
+})
+
+export const GENERATED_TOOLS: Record<string, () => ToolBase<ZodObjectAny>> = {
+ 'mcp-analytics-intent-clusters-recompute': mcpAnalyticsIntentClustersRecompute,
+ 'mcp-analytics-intent-clusters-retrieve': mcpAnalyticsIntentClustersRetrieve,
+ 'mcp-analytics-sessions-generate-intent': mcpAnalyticsSessionsGenerateIntent,
+}
diff --git a/services/mcp/tests/unit/tool-filtering.test.ts b/services/mcp/tests/unit/tool-filtering.test.ts
index 0df3495faae0..5b25b16af848 100644
--- a/services/mcp/tests/unit/tool-filtering.test.ts
+++ b/services/mcp/tests/unit/tool-filtering.test.ts
@@ -749,9 +749,10 @@ describe('Tool Filtering - Feature Flags', () => {
'marketing-analytics-mcp',
'product-business-knowledge',
'field-notes',
+ 'mcp-analytics',
])
)
- expect(flags).toHaveLength(17)
+ expect(flags).toHaveLength(18)
})
// Exercise the real predicate (toolPassesFlagGate) over hand-rolled entries