{"record":{"id":"b2f08876730984df","repo":"mantinedev/mantine","slug":"failed-to-fetch-url-response-status","errorCode":null,"errorMessage":"Failed to fetch ${url}: ${response.status}","messagePattern":"Failed to fetch (.+?): (.+?)","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@mantine/mcp-server/src/data-client.ts","lineNumber":35,"sourceCode":"  private readonly timeoutMs: number;\n  private indexCache: IndexItem[] | null = null;\n  private itemCache = new Map<string, ItemData>();\n\n  constructor(baseUrl = 'https://mantine.dev/mcp', timeoutMs = 10000) {\n    this.baseUrl = baseUrl.replace(/\\/+$/, '');\n    this.timeoutMs = timeoutMs;\n  }\n\n  private async fetchJson<T>(relativePath: string): Promise<T> {\n    const controller = new AbortController();\n    const timer = setTimeout(() => controller.abort(), this.timeoutMs);\n\n    try {\n      const url = `${this.baseUrl}/${relativePath.replace(/^\\/+/, '')}`;\n      const response = await fetch(url, { signal: controller.signal });\n\n      if (!response.ok) {\n        throw new Error(`Failed to fetch ${url}: ${response.status}`);\n      }\n\n      return (await response.json()) as T;\n    } finally {\n      clearTimeout(timer);\n    }\n  }\n\n  async getIndex() {\n    if (this.indexCache) {\n      return this.indexCache;\n    }\n\n    this.indexCache = await this.fetchJson<IndexItem[]>('index.json');\n    return this.indexCache;\n  }\n\n  async listItems(args: ListItemsArgs = {}) {","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/mantinedev/mantine/blob/8a284e2c2c53a9cb6f39f5dc389bf41b7a2073f8/packages/@mantine/mcp-server/src/data-client.ts#L17-L53","documentation":"The @mantine/mcp-server data client fetches JSON from a configured base URL with a timeout. When the HTTP response is not ok, it throws an error including the URL and status code. This is infrastructure-level: the MCP data server (Mantine docs data) is unreachable or erroring.","triggerScenarios":"The MCP server cannot reach its data host (network blocked, proxy interference); base URL misconfigured; data endpoint returns 404/500; DNS or corporate firewall blocking the request.","commonSituations":"Running the MCP server behind a corporate proxy that strips requests; stale base URL after a data source migration; the remote data service being temporarily down; local offline development.","solutions":["Verify the base URL configuration points to a reachable host","Test connectivity directly: curl the URL from the same environment","Configure proxy/CA settings so Node's fetch can traverse the corporate network","Retry after transient failures or run the data source locally"],"exampleFix":"// before\nnew DataClient({ baseUrl: 'https://data.mantine.dev' }); // 500/404 from host\n\n// after\n// verify with curl, then point at a healthy mirror\nnew DataClient({ baseUrl: 'https://your-mirror.example.com' });","handlingStrategy":"retry","validationCode":"// Smoke-check reachability before starting the server\nawait fetch(`${baseUrl}/index.json`, { method: 'HEAD' }).catch(() => {\n  console.error('MCP data host unreachable — check network/proxy');\n});","typeGuard":null,"tryCatchPattern":"try {\n  const index = await client.getIndex();\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Failed to fetch')) {\n    // retry with backoff or switch baseUrl\n  }\n}","preventionTips":["Pin the data host in config and monitor it","Configure proxy env vars (HTTPS_PROXY) in corporate networks","Add retries with exponential backoff around fetchJson calls"],"tags":["network","http","mcp-server","fetch"],"backgroundTag":"http-request-failed","analyzedSha":"8a284e2c2c53a9cb6f39f5dc389bf41b7a2073f8","analyzedAt":"2026-08-28T10:25:51.087Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}