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

Function useIdeConnectionStatus

src/hooks/useIdeConnectionStatus.ts:11–33  ·  view source on GitHub ↗
(
  mcpClients?: MCPServerConnection[],
)

Source from the content-addressed store, hash-verified

9}
10
11export function useIdeConnectionStatus(
12 mcpClients?: MCPServerConnection[],
13): IdeConnectionResult {
14 return useMemo(() => {
15 const ideClient = mcpClients?.find(client => client.name === 'ide')
16 if (!ideClient) {
17 return { status: null, ideName: null }
18 }
19 // Extract IDE name from config if available
20 const config = ideClient.config
21 const ideName =
22 config.type === 'sse-ide' || config.type === 'ws-ide'
23 ? config.ideName
24 : null
25 if (ideClient.type === 'connected') {
26 return { status: 'connected', ideName }
27 }
28 if (ideClient.type === 'pending') {
29 return { status: 'pending', ideName }
30 }
31 return { status: 'disconnected', ideName }
32 }, [mcpClients])
33}
34

Callers 3

IdeStatusIndicatorFunction · 0.85
NotificationsFunction · 0.85
useIDEStatusIndicatorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected