Skip to content
This repository was archived by the owner on Aug 6, 2026. It is now read-only.

Commit 73a0aef

Browse files
refactor(core): extract portability contracts
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
1 parent e87018b commit 73a0aef

2 files changed

Lines changed: 43 additions & 0 deletions

File tree

‎packages/api-client/src/types.ts‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,33 @@ export type McpAuthType = Schemas.MCPAuthTypeEnum;
88
export type McpRecommendedServer = Schemas.MCPServerTemplate;
99
export type McpServerInstallation = Schemas.MCPServerInstallation;
1010
export type McpInstallationTool = Schemas.MCPServerInstallationTool;
11+
export type McpOAuthRedirectResponse = Schemas.OAuthRedirectResponse;
12+
export type McpInstallSource = "posthog" | "posthog-code" | "posthog-mobile";
13+
export type McpInstallResponse =
14+
| McpServerInstallation
15+
| McpOAuthRedirectResponse;
16+
17+
export interface InstallCustomMcpServerOptions {
18+
name: string;
19+
url: string;
20+
auth_type: McpAuthType;
21+
api_key?: string;
22+
description?: string;
23+
client_id?: string;
24+
client_secret?: string;
25+
install_source?: McpInstallSource;
26+
posthog_code_callback_url?: string;
27+
}
28+
29+
export interface InstallMcpTemplateOptions {
30+
template_id: string;
31+
api_key?: string;
32+
install_source?: McpInstallSource;
33+
posthog_code_callback_url?: string;
34+
}
35+
36+
export interface UpdateMcpServerInstallationOptions {
37+
display_name?: string;
38+
description?: string;
39+
is_enabled?: boolean;
40+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export function isMcpOAuthRedirect(
2+
response: object,
3+
): response is { redirect_url: string } {
4+
return (
5+
"redirect_url" in response && typeof response.redirect_url === "string"
6+
);
7+
}
8+
9+
export function isStdioMcpServer(server: {
10+
transport_type?: string | null;
11+
}): boolean {
12+
return server.transport_type === "stdio";
13+
}

0 commit comments

Comments
 (0)