MCPcopy Create free account
hub / github.com/simstudioai/sim / fetchMcpServers

Function fetchMcpServers

apps/sim/hooks/queries/mcp.ts:73–86  ·  view source on GitHub ↗
(workspaceId: string, signal?: AbortSignal)

Source from the content-addressed store, hash-verified

71}
72
73async function fetchMcpServers(workspaceId: string, signal?: AbortSignal): Promise<McpServer[]> {
74 try {
75 const data = await requestJson(listMcpServersContract, {
76 query: { workspaceId },
77 signal,
78 })
79 return data.data.servers
80 } catch (error) {
81 if (error instanceof ApiClientError && error.status === 404) {
82 return []
83 }
84 throw error
85 }
86}
87
88export function useMcpServers(workspaceId: string) {
89 return useQuery({

Callers 1

useMcpServersFunction · 0.85

Calls 1

requestJsonFunction · 0.90

Tested by

no test coverage detected