MCPcopy Index your code
hub / github.com/codeaashu/claude-code / mcpInfoFromString

Function mcpInfoFromString

src/services/mcp/mcpStringUtils.ts:19–32  ·  view source on GitHub ↗
(toolString: string)

Source from the content-addressed store, hash-verified

17 * names typically don't contain double underscores.
18 */
19export function mcpInfoFromString(toolString: string): {
20 serverName: string
21 toolName: string | undefined
22} | null {
23 const parts = toolString.split('__')
24 const [mcpPart, serverName, ...toolNameParts] = parts
25 if (mcpPart !== 'mcp' || !serverName) {
26 return null
27 }
28 // Join all parts after server name to preserve double underscores in tool names
29 const toolName =
30 toolNameParts.length > 0 ? toolNameParts.join('__') : undefined
31 return { serverName, toolName }
32}
33
34/**
35 * Generates the MCP tool/command name prefix for a given server

Callers 8

getMcpServerBucketsFunction · 0.85
ToolSelectorFunction · 0.85
toolMatchesRuleFunction · 0.85
validatePermissionRuleFunction · 0.85
findMcpServerConnectionFunction · 0.85
isToolFromMcpServerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected