Skip to content

Commit 8b5d3b1

Browse files
committed
Remove mcp server name entirely from post hog events (url remains)
1 parent 4be401f commit 8b5d3b1

9 files changed

Lines changed: 0 additions & 47 deletions

File tree

packages/web/src/app/api/(server)/ee/askmcp/callback/route.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ describe('GET /api/ee/askmcp/callback', () => {
110110
orgId: true,
111111
name: true,
112112
serverUrl: true,
113-
sanitizedName: true,
114113
clientInfoSource: true,
115114
},
116115
},
@@ -163,7 +162,6 @@ describe('GET /api/ee/askmcp/callback', () => {
163162
orgId: true,
164163
name: true,
165164
serverUrl: true,
166-
sanitizedName: true,
167165
clientInfoSource: true,
168166
},
169167
},

packages/web/src/app/api/(server)/ee/askmcp/callback/route.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ export const GET = apiHandler(async (request: NextRequest) => {
7979
orgId: true,
8080
name: true,
8181
serverUrl: true,
82-
sanitizedName: true,
8382
clientInfoSource: true,
8483
},
8584
},
@@ -90,9 +89,7 @@ export const GET = apiHandler(async (request: NextRequest) => {
9089
source: 'sourcebot-web-client' as const,
9190
entryPoint,
9291
serverId: userServer.serverId,
93-
serverName: userServer.server.name,
9492
serverUrl: userServer.server.serverUrl,
95-
sanitizedName: userServer.server.sanitizedName,
9693
authMode: getMcpAuthMode(userServer.server.clientInfoSource),
9794
});
9895
const getEventProperties = async () => {

packages/web/src/app/api/(server)/ee/askmcp/connect/route.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,7 @@ describe('POST /api/ee/askmcp/connect', () => {
160160
source: 'sourcebot-web-client',
161161
entryPoint: 'unknown',
162162
serverId: 'server-1',
163-
serverName: 'Linear',
164163
serverUrl: 'https://mcp.linear.app/mcp',
165-
sanitizedName: 'linear',
166164
authMode: 'dynamic',
167165
});
168166
expect(prisma.userMcpServer.upsert).toHaveBeenCalledWith({
@@ -304,9 +302,7 @@ describe('POST /api/ee/askmcp/connect', () => {
304302
source: 'sourcebot-web-client',
305303
entryPoint: 'unknown',
306304
serverId: 'server-1',
307-
serverName: 'Linear',
308305
serverUrl: 'https://mcp.linear.app/mcp',
309-
sanitizedName: 'linear',
310306
authMode: 'dynamic',
311307
failureReason: 'invalid_client',
312308
});

packages/web/src/app/api/(server)/ee/askmcp/connect/route.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ export const POST = apiHandler(async (request: NextRequest) => {
7474
where: { id: parsed.data.serverId, orgId: org.id },
7575
select: {
7676
id: true,
77-
name: true,
78-
sanitizedName: true,
7977
serverUrl: true,
8078
clientInfoSource: true,
8179
},
@@ -94,9 +92,7 @@ export const POST = apiHandler(async (request: NextRequest) => {
9492
source: 'sourcebot-web-client' as const,
9593
entryPoint,
9694
serverId: mcpServer.id,
97-
serverName: mcpServer.name,
9895
serverUrl: mcpServer.serverUrl,
99-
sanitizedName: mcpServer.sanitizedName,
10096
authMode: getMcpAuthMode(mcpServer.clientInfoSource),
10197
};
10298

packages/web/src/ee/features/chat/mcp/actions.test.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,7 @@ describe('createMcpServer', () => {
122122
source: 'sourcebot-web-client',
123123
entryPoint: 'workspace_settings',
124124
serverId: 'server-1',
125-
serverName: 'Linear',
126125
serverUrl: 'https://mcp.linear.app/mcp',
127-
sanitizedName: 'linear',
128126
authMode: 'dynamic',
129127
});
130128
});
@@ -190,9 +188,7 @@ describe('createStaticOAuthMcpServer', () => {
190188
source: 'sourcebot-web-client',
191189
entryPoint: 'workspace_settings',
192190
serverId: 'server-1',
193-
serverName: 'Slack',
194191
serverUrl: 'https://mcp.slack.com/mcp',
195-
sanitizedName: 'slack',
196192
authMode: 'static',
197193
});
198194
});
@@ -411,9 +407,7 @@ describe('disconnectMcpServer', () => {
411407
},
412408
select: {
413409
id: true,
414-
name: true,
415410
serverUrl: true,
416-
sanitizedName: true,
417411
clientInfoSource: true,
418412
},
419413
});
@@ -429,9 +423,7 @@ describe('disconnectMcpServer', () => {
429423
source: 'sourcebot-web-client',
430424
entryPoint: 'account_settings',
431425
serverId: 'server-1',
432-
serverName: 'Linear',
433426
serverUrl: 'https://mcp.linear.app/mcp',
434-
sanitizedName: 'linear',
435427
authMode: 'dynamic',
436428
});
437429
});

packages/web/src/ee/features/chat/mcp/actions.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,7 @@ export const createStaticOAuthMcpServer = async (
231231
source: 'sourcebot-web-client',
232232
entryPoint: 'workspace_settings',
233233
serverId: mcpServer.id,
234-
serverName: preparedServer.displayName,
235234
serverUrl: mcpServer.serverUrl,
236-
sanitizedName: preparedServer.sanitizedName,
237235
authMode: 'static',
238236
});
239237

@@ -278,9 +276,7 @@ export const createMcpServer = async (name: string, serverUrl: string) => sew(()
278276
source: 'sourcebot-web-client',
279277
entryPoint: 'workspace_settings',
280278
serverId: mcpServer.id,
281-
serverName: preparedServer.displayName,
282279
serverUrl: mcpServer.serverUrl,
283-
sanitizedName: preparedServer.sanitizedName,
284280
authMode: getMcpAuthMode(McpServerClientInfoSource.DYNAMIC),
285281
});
286282

@@ -322,9 +318,7 @@ export const disconnectMcpServer = async (serverId: string, entryPoint: McpConne
322318
},
323319
select: {
324320
id: true,
325-
name: true,
326321
serverUrl: true,
327-
sanitizedName: true,
328322
clientInfoSource: true,
329323
},
330324
});
@@ -356,9 +350,7 @@ export const disconnectMcpServer = async (serverId: string, entryPoint: McpConne
356350
source: 'sourcebot-web-client',
357351
entryPoint,
358352
serverId: server.id,
359-
serverName: server.name,
360353
serverUrl: server.serverUrl,
361-
sanitizedName: server.sanitizedName,
362354
authMode: getMcpAuthMode(server.clientInfoSource),
363355
});
364356

packages/web/src/ee/features/chat/mcp/mcpToolSets.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,8 @@ describe('getMcpTools', () => {
322322
expect(mockToolCallCountUpsert).not.toHaveBeenCalled();
323323
expect(mockToolCallCountUpdate).not.toHaveBeenCalled();
324324
expect(mockCaptureEvent).toHaveBeenCalledWith('ask_mcp_tool_call_completed', expect.objectContaining({
325-
serverName: 'Linear',
326325
serverUrl: 'https://linear.example.com/mcp',
327326
toolName: 'create_issue',
328-
qualifiedToolName: 'mcp_linear__create_issue',
329327
success: false,
330328
failureReason: 'Error',
331329
}));
@@ -366,10 +364,8 @@ describe('getMcpTools', () => {
366364
expect(mockCaptureEvent).toHaveBeenCalledWith('ask_mcp_tool_call_completed', expect.objectContaining({
367365
source: 'sourcebot-ask-agent',
368366
serverId: 'server-linear',
369-
serverName: 'Linear',
370367
serverUrl: 'https://linear.example.com/mcp',
371368
toolName: 'create_issue',
372-
qualifiedToolName: 'mcp_linear__create_issue',
373369
success: true,
374370
}));
375371
});

packages/web/src/ee/features/chat/mcp/mcpToolSets.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,8 @@ export async function getMcpTools(clients: McpToolSet[], analyticsContext?: McpT
202202
traceId: analyticsContext?.traceId,
203203
source: analyticsContext?.source ?? 'sourcebot-ask-agent',
204204
serverId,
205-
serverName,
206205
serverUrl,
207206
toolName,
208-
qualifiedToolName: qualifiedName,
209207
success,
210208
durationMs: Date.now() - startTime,
211209
...(failureReason ? { failureReason } : {}),

packages/web/src/lib/posthogEvents.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,8 @@ export type PosthogEventMap = {
211211
traceId?: string,
212212
source: AskMcpAnalyticsSource,
213213
serverId: string,
214-
serverName: string,
215214
serverUrl: string,
216215
toolName: string,
217-
qualifiedToolName: string,
218216
success: boolean,
219217
durationMs: number,
220218
failureReason?: string,
@@ -223,47 +221,37 @@ export type PosthogEventMap = {
223221
source: SourcebotWebClientSource,
224222
entryPoint: 'workspace_settings',
225223
serverId: string,
226-
serverName: string,
227224
serverUrl: string,
228-
sanitizedName: string,
229225
authMode: McpConnectorAuthMode,
230226
},
231227
ask_mcp_connector_connection_started: {
232228
source: SourcebotWebClientSource,
233229
entryPoint: McpConnectorEntryPoint,
234230
serverId: string,
235-
serverName: string,
236231
serverUrl: string,
237-
sanitizedName: string,
238232
authMode: McpConnectorAuthMode,
239233
},
240234
ask_mcp_connector_connection_completed: {
241235
source: SourcebotWebClientSource,
242236
entryPoint: McpConnectorEntryPoint,
243237
serverId: string,
244-
serverName: string,
245238
serverUrl: string,
246-
sanitizedName: string,
247239
authMode: McpConnectorAuthMode,
248240
alreadyAuthorized: boolean,
249241
},
250242
ask_mcp_connector_connection_failed: {
251243
source: SourcebotWebClientSource,
252244
entryPoint: McpConnectorEntryPoint,
253245
serverId?: string,
254-
serverName?: string,
255246
serverUrl?: string,
256-
sanitizedName?: string,
257247
authMode?: McpConnectorAuthMode,
258248
failureReason: string,
259249
},
260250
ask_mcp_connector_disconnected: {
261251
source: SourcebotWebClientSource,
262252
entryPoint: McpConnectorEntryPoint,
263253
serverId: string,
264-
serverName: string,
265254
serverUrl: string,
266-
sanitizedName: string,
267255
authMode: McpConnectorAuthMode,
268256
},
269257
tool_used: {

0 commit comments

Comments
 (0)