{"record":{"id":"b737e6218a199557","repo":"BerriAI/litellm","slug":"database-not-connected-connect-a-database-to-your-b737e6","errorCode":null,"errorMessage":"Database not connected. Connect a database to your proxy","messagePattern":"Database not connected\\. Connect a database to your proxy","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"litellm/proxy/management_endpoints/mcp_management_endpoints.py","lineNumber":851,"sourceCode":"            static_headers=payload.static_headers,\n            command=payload.command,\n            args=payload.args,\n            env=payload.env,\n            issuer=payload.issuer,\n            authorization_url=payload.authorization_url,\n            token_url=payload.token_url,\n            registration_url=payload.registration_url,\n            allow_all_keys=payload.allow_all_keys,\n            available_on_public_internet=payload.available_on_public_internet,\n            timeout=payload.timeout,\n            max_concurrent_requests=payload.max_concurrent_requests,\n        )\n\n    def get_prisma_client_or_throw(message: str):\n        from litellm.proxy.proxy_server import prisma_client\n\n        if prisma_client is None:\n            raise HTTPException(\n                status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,\n                detail={\"error\": message},\n            )\n        return prisma_client\n\n    # Router to fetch all MCP tools available for the current key\n\n    @router.get(\n        \"/tools\",\n        tags=[\"mcp\"],\n        dependencies=[Depends(user_api_key_auth)],\n    )\n    async def get_mcp_tools(\n        user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),\n    ):\n        \"\"\"\n        Get all MCP tools available for the current key, including those from access groups\n        \"\"\"","sourceCodeStart":833,"sourceCodeEnd":869,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/mcp_management_endpoints.py#L833-L869","documentation":"Sentinel guard thrown by get_prisma_client_or_throw: an MCP management endpoint that must persist to the LiteLLM database was called while no Prisma client exists, i.e. the proxy is running without DATABASE_URL configured. The input at fault is the deployment configuration (missing DB), not the request body.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/mcp_management_endpoints.py:851 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set DATABASE_URL to a valid PostgreSQL connection string and restart the proxy.","Check proxy startup logs for database connection errors."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}