* Extracts the MCP server transport type from a tool name. * Returns the server type (stdio, sse, http, ws, sdk, etc.) for MCP tools, * or undefined for built-in tools.
( toolName: string, mcpClients: MCPServerConnection[], )
| 306 | * or undefined for built-in tools. |
| 307 | */ |
| 308 | function getMcpServerType( |
| 309 | toolName: string, |
| 310 | mcpClients: MCPServerConnection[], |
| 311 | ): McpServerType { |
| 312 | const serverConnection = findMcpServerConnection(toolName, mcpClients) |
| 313 | |
| 314 | if (serverConnection?.type === 'connected') { |
| 315 | // Handle stdio configs where type field is optional (defaults to 'stdio') |
| 316 | return serverConnection.config.type ?? 'stdio' |
| 317 | } |
| 318 | |
| 319 | return undefined |
| 320 | } |
| 321 | |
| 322 | /** |
| 323 | * Extracts the MCP server base URL for a tool by looking up its server connection. |
no test coverage detected