{"record":{"id":"315a9e02d972ab80","repo":"mastra-ai/mastra","slug":"storage-is-not-configured-315a9e","errorCode":null,"errorMessage":"Storage is not configured","messagePattern":"Storage is not configured","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"packages/server/src/server/handlers/mcp-client-versions.ts","lineNumber":49,"sourceCode":" * GET /stored/mcp-clients/:mcpClientId/versions - List all versions for an MCP client\n */\nexport const LIST_MCP_CLIENT_VERSIONS_ROUTE = createRoute({\n  method: 'GET',\n  path: '/stored/mcp-clients/:mcpClientId/versions',\n  requiresAuth: true,\n  responseType: 'json',\n  pathParamSchema: mcpClientVersionPathParams,\n  queryParamSchema: listMCPClientVersionsQuerySchema,\n  responseSchema: listMCPClientVersionsResponseSchema,\n  summary: 'List MCP client versions',\n  description: 'Returns a paginated list of all versions for a stored MCP client',\n  tags: ['MCP Client Versions'],\n  handler: async ({ mastra, mcpClientId, page, perPage, orderBy, requestContext }) => {\n    try {\n      const storage = mastra.getStorage();\n\n      if (!storage) {\n        throw new HTTPException(500, { message: 'Storage is not configured' });\n      }\n\n      const mcpClientStore = await storage.getStore('mcpClients');\n      if (!mcpClientStore) {\n        throw new HTTPException(500, { message: 'MCP clients storage domain is not available' });\n      }\n\n      const mcpClient = await mcpClientStore.getById(mcpClientId);\n      if (!mcpClient) {\n        throw new HTTPException(404, { message: `MCP client with id ${mcpClientId} not found` });\n      }\n      assertStoredResourceScope(mcpClient, await getStoredResourceScope(mastra, requestContext));\n\n      const result = await mcpClientStore.listVersions({\n        mcpClientId,\n        page,\n        perPage,\n        orderBy,","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/handlers/mcp-client-versions.ts#L31-L67","documentation":"The MCP client versions list handler calls mastra.getStorage() and, if no storage is configured on the Mastra instance, throws HTTPException 500 with 'Storage is not configured'. Listing MCP client version history requires a persistent storage backend, so the endpoint cannot function without one. This is a server configuration error, not a client mistake.","triggerScenarios":"GET the MCP client versions endpoint for a Mastra server instance that was constructed without a storage configuration (no storage passed to Mastra / no storage in server config).","commonSituations":"A dev server started without storage options; storage removed or never added when upgrading to a server that now requires it for MCP client version endpoints; environment-based storage config (e.g. database URL) missing so storage silently isn't set up.","solutions":["Configure storage on the Mastra instance (pass a storage adapter in the Mastra/server config, e.g. LibSQL/Postgres storage).","Set the required storage environment variables (e.g. database connection URL) and restart the server.","If storage is intentionally absent, avoid calling the MCP client versions endpoints or guard the UI behind a storage-available check.","Confirm the configured storage adapter is registered so getStorage() returns a non-null value."],"exampleFix":"// before\nnew Mastra({});\n// after\nimport { Mastra } from '@mastra/core';\nnew Mastra({\n  storage: new LibSQLStore({ url: process.env.DATABASE_URL }),\n});","handlingStrategy":"fallback","validationCode":"const storage = mastra.getStorage();\nif (!storage) {\n  console.warn('Storage not configured; MCP client version features disabled');\n}","typeGuard":"function hasStorage(mastra: Mastra): boolean {\n  return mastra.getStorage() != null;\n}","tryCatchPattern":"try {\n  const versions = await fetch(`/api/mcp-clients/${id}/versions`).then(r => {\n    if (r.status === 500) throw new Error('storage-unavailable');\n    return r.json();\n  });\n} catch (e) {\n  if (e.message === 'storage-unavailable') {\n    return showStorageRequiredNotice(); // degrade gracefully\n  }\n  throw e;\n}","preventionTips":["Always pass a storage adapter when constructing Mastra in any deployment that serves MCP endpoints.","Add a startup check that logs when getStorage() returns null so misconfigurations are caught at boot.","Validate storage env vars (e.g. DATABASE_URL) in CI/deploy config."],"tags":["storage","configuration","mcp","http-500"],"backgroundTag":"storage-not-configured","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}