{"record":{"id":"ff21df510d52da40","repo":"mastra-ai/mastra","slug":"registry-registry-name-does-not-have-a-server","errorCode":null,"errorMessage":"Registry \"${registry.name}\" does not have a servers endpoint.","messagePattern":"Registry \"(.+?)\" does not have a servers endpoint\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/mcp-registry-registry/src/registry/fetch-servers.ts","lineNumber":17,"sourceCode":"import { registryData } from './registry';\nimport type { ServerEntry } from './types';\n\n/**\n * Fetches servers from a registry's servers_url endpoint\n */\nexport async function fetchServersFromRegistry(registryId: string): Promise<ServerEntry[]> {\n  try {\n    // Find the registry in our registry data\n    const registry = registryData.registries.find(r => r.id === registryId);\n\n    if (!registry) {\n      throw new Error(`Registry with ID \"${registryId}\" not found.`);\n    }\n\n    if (!registry.servers_url) {\n      throw new Error(`Registry \"${registry.name}\" does not have a servers endpoint.`);\n    }\n\n    console.info(`Fetching servers from ${registry.name} at ${registry.servers_url}`);\n\n    // Fetch the servers from the registry's servers_url\n    const response = await fetch(registry.servers_url);\n\n    if (!response.ok) {\n      throw new Error(`Failed to fetch servers from ${registry.servers_url}: ${response.statusText}`);\n    }\n\n    const data = (await response.json()) as unknown;\n\n    // If the registry has a custom post-processing function, use it\n    if (registry.postProcessServers) {\n      console.info(`Using custom post-processor for ${registry.name}`);\n      return registry.postProcessServers(data);\n    }","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/mcp-registry-registry/src/registry/fetch-servers.ts#L1-L35","documentation":"Mastra MCP registries are entries that expose a list of MCP servers via an HTTP endpoint. Before fetching, fetchServersFromRegistry validates that the registry record actually defines a `servers_url`. If the registry exists but has no servers endpoint configured, the library throws instead of attempting a fetch against an undefined URL.","triggerScenarios":"Calling fetchServersFromRegistry (or the `servers` caller) with a registryId whose loaded registry object has `servers_url` undefined/null — e.g. a registry registered without a servers_url field, or a record loaded from storage that predates the servers_url field.","commonSituations":"Manually constructed registry configs missing `servers_url`; registries synced from a remote catalog where the endpoint field is optional; typos like `serverUrl` instead of `servers_url`; older persisted registry records after a schema change.","solutions":["Set a valid `servers_url` on the registry definition before fetching","Check the registry record for field-name typos (must be `servers_url`)","Guard the call: only call fetchServersFromRegistry when registry.servers_url is truthy","Re-create/migrate the stored registry record if it was persisted by an older version without servers_url"],"exampleFix":"// before\nawait registryManager.fetchServersFromRegistry({ registryId: 'my-registry' });\n// after\nconst registry = await registryManager.getRegistry('my-registry');\nif (!registry?.servers_url) throw new Error('Registry is missing servers_url');\nawait registryManager.fetchServersFromRegistry({ registryId: 'my-registry' });","handlingStrategy":"validation","validationCode":"const registry = await registryManager.getRegistry(registryId);\nif (!registry) throw new Error(`Registry \"${registryId}\" not found`);\nif (typeof registry.servers_url !== 'string' || registry.servers_url.length === 0) {\n  throw new Error(`Registry \"${registry.name}\" has no servers_url; fix config before fetching`);\n}\nawait registryManager.fetchServersFromRegistry({ registryId });","typeGuard":"function hasServersUrl(registry): registry is typeof registry & { servers_url: string } {\n  return typeof (registry as any)?.servers_url === 'string' && (registry as any).servers_url.length > 0;\n}","tryCatchPattern":"try {\n  await registryManager.fetchServersFromRegistry({ registryId });\n} catch (err) {\n  if (err instanceof Error && err.message.includes('does not have a servers endpoint')) {\n    // fall back to another registry or surface a config error\n  } else throw err;\n}","preventionTips":["Always define servers_url when registering an MCP registry","Validate registry objects with a schema (zod) at load time","Beware field-name drift: servers_url, not serverUrl","Migrate old persisted registry records after schema upgrades"],"tags":["configuration","mcp","validation"],"backgroundTag":"missing-required-config-field","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}