{"record":{"id":"b451f6b7eacca5e9","repo":"mastra-ai/mastra","slug":"storage-is-not-configured-b451f6","errorCode":null,"errorMessage":"Storage is not configured","messagePattern":"Storage is not configured","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"critical","filePath":"packages/server/src/server/handlers/stored-mcp-clients.ts","lineNumber":43,"sourceCode":"/**\n * GET /stored/mcp-clients - List all stored MCP clients\n */\nexport const LIST_STORED_MCP_CLIENTS_ROUTE = createRoute({\n  method: 'GET',\n  path: '/stored/mcp-clients',\n  responseType: 'json',\n  queryParamSchema: listStoredMCPClientsQuerySchema,\n  responseSchema: listStoredMCPClientsResponseSchema,\n  summary: 'List stored MCP clients',\n  description: 'Returns a paginated list of all MCP client configurations stored in the database',\n  tags: ['Stored MCP Clients'],\n  requiresAuth: true,\n  handler: async ({ mastra, page, perPage, orderBy, status, authorId, metadata, 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 scope = await getStoredResourceScope(mastra, requestContext);\n      const result = await mcpClientStore.listResolved({\n        page,\n        perPage,\n        orderBy,\n        status,\n        authorId,\n        metadata: scopeStoredResourceMetadata(metadata, scope),\n      });\n\n      return result;","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/handlers/stored-mcp-clients.ts#L25-L61","documentation":"The stored MCP clients list handler calls mastra.getStorage() and throws a 500 HTTPException when storage is not configured. Resolved MCP client records are persisted, so listing them requires a storage backend. Mastra has no implicit default storage.","triggerScenarios":"GET /api/mcp/clients/stored (listStoredMCPClients, with page/perPage/orderBy/status/authorId/metadata filters) against a Mastra server built without a storage option.","commonSituations":"New projects missing storage config; storage option dropped during a refactor of the Mastra constructor; missing DATABASE_URL in a deployment causing storage to be skipped; minimal dev server used with full Studio UI.","solutions":["Add storage to the Mastra instance, e.g. new LibSQLStore({ url: 'file:./mastra.db' }).","Install the appropriate storage adapter package for your deployment.","Verify env vars for the storage connection exist in the server environment.","Gate MCP client management UI behind a storage-configured check."],"exampleFix":"// before\nconst mastra = new Mastra({ server });\n\n// after\nconst mastra = new Mastra({ server, storage: new PostgresStore({ connectionString: process.env.DATABASE_URL }) });","handlingStrategy":"validation","validationCode":"if (!mastra.getStorage()) throw new Error('Storage is not configured; stored MCP client listing will fail.');","typeGuard":"const storageReady = (m: Mastra) => m.getStorage() != null;","tryCatchPattern":"try {\n  const clients = await client.listStoredMCPClients({ page: 1, perPage: 20 });\n} catch (e) {\n  if (isMastraServerError(e) && e.status === 500 && e.message.includes('Storage is not configured')) {\n    // surface setup instructions for storage\n  } else throw e;\n}","preventionTips":["Configure storage before enabling MCP client management features.","Validate storage presence in a deployment readiness check.","Ensure DATABASE_URL-like variables exist in all environments."],"tags":["storage","configuration","mcp","server"],"backgroundTag":"storage-not-configured","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}