MCPcopy Create free account
hub / github.com/github/copilot-sdk / waitForMcpServerStatus

Function waitForMcpServerStatus

nodejs/test/e2e/mcp_oauth.e2e.test.ts:206–225  ·  view source on GitHub ↗
(
    session: CopilotSession,
    serverName: string,
    expectedStatus = "connected"
)

Source from the content-addressed store, hash-verified

204});
205
206async function waitForMcpServerStatus(
207 session: CopilotSession,
208 serverName: string,
209 expectedStatus = "connected"
210): Promise<void> {
211 let lastStatus = "<not listed>";
212 await waitForCondition(
213 async () => {
214 const result = await session.rpc.mcp.list();
215 const server = result.servers.find((entry) => entry.name === serverName);
216 lastStatus = server?.status ?? "<not listed>";
217 return server?.status === expectedStatus;
218 },
219 {
220 timeoutMs: 60_000,
221 intervalMs: 200,
222 timeoutMessage: `${serverName} did not reach ${expectedStatus}; last status was ${lastStatus}`,
223 }
224 );
225}
226
227async function callWhoami(
228 session: CopilotSession,

Callers 1

Calls 2

waitForConditionFunction · 0.90
listMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…