mastra-ai/mastra · error · Error
Registry "${registry.name}" does not have a servers endpoint
Error message
Registry "${registry.name}" does not have a servers endpoint. What it means
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.
Source
Thrown at packages/mcp-registry-registry/src/registry/fetch-servers.ts:17
import { registryData } from './registry';
import type { ServerEntry } from './types';
/**
* Fetches servers from a registry's servers_url endpoint
*/
export async function fetchServersFromRegistry(registryId: string): Promise<ServerEntry[]> {
try {
// Find the registry in our registry data
const registry = registryData.registries.find(r => r.id === registryId);
if (!registry) {
throw new Error(`Registry with ID "${registryId}" not found.`);
}
if (!registry.servers_url) {
throw new Error(`Registry "${registry.name}" does not have a servers endpoint.`);
}
console.info(`Fetching servers from ${registry.name} at ${registry.servers_url}`);
// Fetch the servers from the registry's servers_url
const response = await fetch(registry.servers_url);
if (!response.ok) {
throw new Error(`Failed to fetch servers from ${registry.servers_url}: ${response.statusText}`);
}
const data = (await response.json()) as unknown;
// If the registry has a custom post-processing function, use it
if (registry.postProcessServers) {
console.info(`Using custom post-processor for ${registry.name}`);
return registry.postProcessServers(data);
}View on GitHub (pinned to 75dd419e61)
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
Example fix
// before
await registryManager.fetchServersFromRegistry({ registryId: 'my-registry' });
// after
const registry = await registryManager.getRegistry('my-registry');
if (!registry?.servers_url) throw new Error('Registry is missing servers_url');
await registryManager.fetchServersFromRegistry({ registryId: 'my-registry' }); Defensive patterns
Strategy: validation
Validate before calling
const registry = await registryManager.getRegistry(registryId);
if (!registry) throw new Error(`Registry "${registryId}" not found`);
if (typeof registry.servers_url !== 'string' || registry.servers_url.length === 0) {
throw new Error(`Registry "${registry.name}" has no servers_url; fix config before fetching`);
}
await registryManager.fetchServersFromRegistry({ registryId }); Type guard
function hasServersUrl(registry): registry is typeof registry & { servers_url: string } {
return typeof (registry as any)?.servers_url === 'string' && (registry as any).servers_url.length > 0;
} Try / catch
try {
await registryManager.fetchServersFromRegistry({ registryId });
} catch (err) {
if (err instanceof Error && err.message.includes('does not have a servers endpoint')) {
// fall back to another registry or surface a config error
} else throw err;
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Google RBAC roleMapping is required.
- Cookie password must be at least 32 characters. Set OKTA_COO
- heartbeatMs must be a finite number no greater than ${MAX_TI
- Expected a PEM-encoded public key or certificate string for
- terminationGraceMs must be greater than zero.
AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30).
Data as JSON: /api/errors/ff21df510d52da40.
Report an issue: GitHub.