docs/en/integrations/databaseinsights/source.md
The databaseinsights source provides a client to interact with the Google Cloud Database Insights API (databaseinsights.googleapis.com). This source supports the Advanced Query Insights tools that are available via the remote Database Insights MCP Server, allowing tools to retrieve query performance statistics, wait event metrics, time-series trends, and index recommendations for Google Cloud databases like AlloyDB.
Authentication is handled via Application Default Credentials (ADC) using OAuth 2.0 access tokens.
{{< list-tools >}}
Enable the required Google Cloud APIs on your target project:
alloydb.googleapis.com)databaseinsights.googleapis.com)Roles required to enable APIs:
To enable APIs, you need the serviceusage.services.enable permission. If you created the project, you likely already have this permission through the Owner role (roles/owner). Otherwise, you can obtain this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin).
To query performance metrics, wait events, and index recommendations, grant the appropriate IAM roles on the target project or database location:
roles/monitoring.viewer)roles/databaseinsights.viewer)Fine-grained Database Insights permissions:
databaseinsights.queryStats.fetchdatabaseinsights.queryTimeSeries.fetchdatabaseinsights.waitEventStats.fetchdatabaseinsights.waitEventTimeSeries.fetchdatabaseinsights.indexRecommendations.batchQuery, databaseinsights.recommendations.query, databaseinsights.resourceRecommendations.querykind: source
name: database-insights-source
type: databaseinsights
---
kind: source
name: custom-project-database-insights
type: databaseinsights
project: my-quota-project
| field | type | required | description |
|---|---|---|---|
| type | string | true | Must be "databaseinsights". |
| project | string | false | The Google Cloud project ID to use as a fallback billing/quota project for API calls if not extracted from the resource path. |
| endpoint | string | false | Override API endpoint URL (e.g., for staging or testing environments). Defaults to https://databaseinsights.googleapis.com. |