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

Function getMcpServerBuckets

src/components/agents/ToolSelector.tsx:77–96  ·  view source on GitHub ↗
(tools: Tools)

Source from the content-addressed store, hash-verified

75
76// Helper to get MCP server buckets dynamically
77function getMcpServerBuckets(tools: Tools): Array<{
78 serverName: string;
79 tools: Tools;
80}> {
81 const serverMap = new Map<string, Tool[]>();
82 tools.forEach(tool => {
83 if (isMcpTool(tool)) {
84 const mcpInfo = mcpInfoFromString(tool.name);
85 if (mcpInfo?.serverName) {
86 const existing = serverMap.get(mcpInfo.serverName) || [];
87 existing.push(tool);
88 serverMap.set(mcpInfo.serverName, existing);
89 }
90 }
91 });
92 return Array.from(serverMap.entries()).map(([serverName, tools]) => ({
93 serverName,
94 tools
95 })).sort((a, b) => a.serverName.localeCompare(b.serverName));
96}
97export function ToolSelector(t0) {
98 const $ = _c(69);
99 const {

Callers 1

ToolSelectorFunction · 0.85

Calls 7

isMcpToolFunction · 0.85
mcpInfoFromStringFunction · 0.85
forEachMethod · 0.80
entriesMethod · 0.80
getMethod · 0.65
pushMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected