MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / closeServerWithTimeout

Function closeServerWithTimeout

src/server/mcp-shutdown.ts:139–155  ·  view source on GitHub ↗
(
  server: Pick<McpServer, 'close'> | null | undefined,
  timeoutMs: number,
)

Source from the content-addressed store, hash-verified

137}
138
139export async function closeServerWithTimeout(
140 server: Pick<McpServer, 'close'> | null | undefined,
141 timeoutMs: number,
142): Promise<'skipped' | 'closed' | 'timed_out' | 'rejected'> {
143 if (!server) {
144 return 'skipped';
145 }
146
147 const outcome = await runStep('server.close', timeoutMs, () => server.close());
148 if (outcome.status === 'completed') {
149 return 'closed';
150 }
151 if (outcome.status === 'timed_out') {
152 return 'timed_out';
153 }
154 return 'rejected';
155}
156
157export async function runMcpShutdown(input: {
158 reason: McpShutdownReason;

Callers 1

Calls 2

runStepFunction · 0.85
closeMethod · 0.65

Tested by

no test coverage detected