MCPcopy
hub / github.com/claude-code-best/claude-code / createTimeoutPromise

Function createTimeoutPromise

packages/mcp-client/src/execution.ts:158–173  ·  view source on GitHub ↗
(
  serverName: string,
  tool: string,
  timeoutMs: number,
)

Source from the content-addressed store, hash-verified

156}
157
158function createTimeoutPromise(
159 serverName: string,
160 tool: string,
161 timeoutMs: number,
162): Promise<never> {
163 return new Promise((_, reject) => {
164 const timeoutId = setTimeout(() => {
165 reject(
166 new Error(
167 `MCP server "${serverName}" tool "${tool}" timed out after ${Math.floor(timeoutMs / 1000)}s`,
168 ),
169 )
170 }, timeoutMs)
171 timeoutId.unref?.()
172 })
173}

Callers 1

callMcpToolFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected