Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,19 @@ server.setRequestHandler(InitializeRequestSchema, async (request: InitializeRequ
name: clientInfo.name || 'unknown',
version: clientInfo.version || 'unknown'
};

// Configure transport for client-specific behavior
const transport = (global as any).mcpTransport;
if (transport && typeof transport.configureForClient === 'function') {
transport.configureForClient(currentClient.name);
}

// Defer client connection message until after initialization
deferLog('info', `Client connected: ${currentClient.name} v${currentClient.version}`);
}

capture('mcp_client_initialized');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Include the current client name/version when emitting the initialization analytics event. [enhancement]

Severity Level: Minor ⚠️

Suggested change
capture('mcp_client_initialized');
capture('mcp_client_initialized', {
client: {
name: currentClient?.name || 'unknown',
version: currentClient?.version || 'unknown'
}
});
Why it matters? ⭐

The suggestion is valid and low-risk: adding client name/version to the initialization event gives richer analytics and is straightforward to implement.
Note: src/utils/capture.ts already already enriches events with client context (it reads and injects currentClient -> client_name/client_version), so this change will duplicate that data in the event payload rather than fix a bug. Duplication isn't harmful because captureBase sanitizes and filters properties before sending, but it means the improvement is mainly cosmetic/analytics-related (better explicitness) rather than required to make telemetry work.

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** src/server.ts
**Line:** 134:134
**Comment:**
	*Enhancement: Include the current client name/version when emitting the initialization analytics event.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.


// Return standard initialization response
return {
protocolVersion: "2024-11-05",
Expand Down