File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -1859,11 +1859,13 @@ class CopilotTokenTracker implements vscode.Disposable {
18591859 /**
18601860 * Extract server name from an MCP tool name.
18611861 * MCP tool names follow the format: mcp.server.tool or mcp_server_tool
1862+ * For example: "mcp.io.github.git" → "io", "mcp_io_github_git" → "io"
1863+ * Note: Splits on both '.' and '_' to handle various naming conventions
18621864 */
18631865 private extractMcpServerName ( toolName : string ) : string {
18641866 // Remove the mcp. or mcp_ prefix
18651867 const withoutPrefix = toolName . replace ( / ^ m c p [ . _ ] / , '' ) ;
1866- // Split on . or _ and take the first part
1868+ // Split on . or _ and take the first part (server identifier)
18671869 const parts = withoutPrefix . split ( / [ . _ ] / ) ;
18681870 // Return the first non-empty part, or 'unknown' if none exist
18691871 return parts [ 0 ] || 'unknown' ;
You can’t perform that action at this time.
0 commit comments