MCPcopy
hub / github.com/codeaashu/claude-code / getMcpServerType

Function getMcpServerType

src/services/tools/toolExecution.ts:308–320  ·  view source on GitHub ↗

* 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[],
)

Source from the content-addressed store, hash-verified

306 * or undefined for built-in tools.
307 */
308function 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.

Callers 1

runToolUseFunction · 0.85

Calls 1

findMcpServerConnectionFunction · 0.85

Tested by

no test coverage detected