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(integrations): show sender verification in mcp integrations-list (#127297)

Michael Reichenbach2e95d12db951
diff --git a/products/integrations/mcp/tools.yaml b/products/integrations/mcp/tools.yaml
index dda17165884f..1f275257338b 100644
--- a/products/integrations/mcp/tools.yaml
+++ b/products/integrations/mcp/tools.yaml
@@ -155,7 +155,9 @@ tools:
List all third-party integrations configured in the current project. Returns each integration's type (kind),
display name, non-sensitive configuration, error status, and creation metadata. Common kinds include slack,
github, hubspot, salesforce, and various ad platforms. Sensitive credentials (access tokens, secrets) are
- never serialized.
+ never serialized. For native email senders, filter kind=email and inspect config.verified: true means
+ verified, false means unverified, and a missing flag means unknown. An empty result means no visible sender;
+ check all pages before concluding none is configured. Other raw configuration is excluded.
response:
include:
- id
@@ -164,6 +166,7 @@ tools:
- errors
- created_at
- created_by
+ - config.verified
integrations-users-retrieve:
operation: integrations_users_retrieve
enabled: true
diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.json
index cc2d7b0aed00..96200b0bce72 100644
--- a/services/mcp/schema/generated-tool-definitions.json
+++ b/services/mcp/schema/generated-tool-definitions.json
@@ -8607,7 +8607,7 @@
}
},
"integrations-list": {
- "description": "List all third-party integrations configured in the current project. Returns each integration's type (kind), display name, non-sensitive configuration, error status, and creation metadata. Common kinds include slack, github, hubspot, salesforce, and various ad platforms. Sensitive credentials (access tokens, secrets) are never serialized.",
+ "description": "List all third-party integrations configured in the current project. Returns each integration's type (kind), display name, non-sensitive configuration, error status, and creation metadata. Common kinds include slack, github, hubspot, salesforce, and various ad platforms. Sensitive credentials (access tokens, secrets) are never serialized. For native email senders, filter kind=email and inspect config.verified: true means verified, false means unverified, and a missing flag means unknown. An empty result means no visible sender; check all pages before concluding none is configured. Other raw configuration is excluded.",
"category": "Integrations",
"feature": "integrations",
"summary": "List integrations",
diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.json
index fc4e7fa9bb65..d5050c244280 100644
--- a/services/mcp/schema/tool-definitions-all.json
+++ b/services/mcp/schema/tool-definitions-all.json
@@ -8873,7 +8873,7 @@
}
},
"integrations-list": {
- "description": "List all third-party integrations configured in the current project. Returns each integration's type (kind), display name, non-sensitive configuration, error status, and creation metadata. Common kinds include slack, github, hubspot, salesforce, and various ad platforms. Sensitive credentials (access tokens, secrets) are never serialized.",
+ "description": "List all third-party integrations configured in the current project. Returns each integration's type (kind), display name, non-sensitive configuration, error status, and creation metadata. Common kinds include slack, github, hubspot, salesforce, and various ad platforms. Sensitive credentials (access tokens, secrets) are never serialized. For native email senders, filter kind=email and inspect config.verified: true means verified, false means unverified, and a missing flag means unknown. An empty result means no visible sender; check all pages before concluding none is configured. Other raw configuration is excluded.",
"category": "Integrations",
"feature": "integrations",
"summary": "List integrations",
diff --git a/services/mcp/src/tools/generated/integrations.ts b/services/mcp/src/tools/generated/integrations.ts
index e2a01775dede..3df3230d8dac 100644
--- a/services/mcp/src/tools/generated/integrations.ts
+++ b/services/mcp/src/tools/generated/integrations.ts
@@ -226,7 +226,15 @@ const integrationsList = (): ToolBase<
const filtered = {
...result,
results: (result.results ?? []).map((item: any) =>
- pickResponseFields(item, ['id', 'kind', 'display_name', 'errors', 'created_at', 'created_by'])
+ pickResponseFields(item, [
+ 'id',
+ 'kind',
+ 'display_name',
+ 'errors',
+ 'created_at',
+ 'created_by',
+ 'config.verified',
+ ])
),
} as typeof result
return await withPostHogUrl(context, filtered, '/settings/environment-integrations')
diff --git a/services/mcp/tests/unit/integrations-list.test.ts b/services/mcp/tests/unit/integrations-list.test.ts
new file mode 100644
index 000000000000..b41938c95a9e
--- /dev/null
+++ b/services/mcp/tests/unit/integrations-list.test.ts
@@ -0,0 +1,58 @@
+import { describe, expect, it, vi } from 'vitest'
+
+import { getToolsFromContext } from '@/tools'
+import type { Context } from '@/tools/types'
+
+describe('integrations-list', () => {
+ it.each([true, false, undefined])('reads sender verification without other config: %s', async (verified) => {
+ const request = vi.fn().mockResolvedValue({
+ count: 1,
+ next: null,
+ previous: null,
+ results: [
+ {
+ id: 7,
+ kind: 'email',
+ display_name: '[email protected]',
+ errors: '',
+ config: { ...(verified === undefined ? {} : { verified }), secret: 'synthetic-test-secret' },
+ },
+ ],
+ })
+ const context = {
+ api: { request, getProjectBaseUrl: () => 'https://example.com/project/42' },
+ stateManager: {
+ getApiKey: async () => ({ scopes: ['integration:read'] }),
+ getAiConsentGiven: async () => true,
+ getProjectId: async () => '42',
+ },
+ } as unknown as Context
+
+ const tools = await getToolsFromContext(context)
+ const tool = tools.find((candidate) => candidate.name === 'integrations-list')
+ expect(tool, 'integrations-list should be available').not.toBeUndefined()
+ const result = await tool!.handler(context, tool!.schema.parse({ kind: 'email' }))
+
+ expect(result).toEqual({
+ count: 1,
+ next: null,
+ previous: null,
+ _posthogUrl: 'https://example.com/project/42/settings/environment-integrations',
+ results: [
+ {
+ id: 7,
+ kind: 'email',
+ display_name: '[email protected]',
+ errors: '',
+ config: verified === undefined ? {} : { verified },
+ },
+ ],
+ })
+ expect(JSON.stringify(result)).not.toContain('synthetic-test-secret')
+ expect(request).toHaveBeenCalledExactlyOnceWith({
+ method: 'GET',
+ path: '/api/projects/42/integrations/',
+ query: { kind: 'email', limit: undefined, offset: undefined },
+ })
+ })
+})