> [!WARNING]
>
> **Preview**
>
>
> This feature is
>
> subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the
> [Service Specific
> Terms](https://docs.cloud.google.com/terms/service-terms#1), and the
> [Additional Terms for Generative AI
> Preview Products](https://cloud.google.com/trustedtester/aitos).
>
> Pre-GA features are available "as is" and might have limited support.
>
> For more information, see the
> [launch stage descriptions](https://cloud.google.com/products/#product-launch-stages).

> [!NOTE]
> **Note:** To get support or provide feedback for this feature, contact [data-lineage-preview@google.com](mailto:data-lineage-preview@google.com).


This document shows you how to use the data lineage remote Model
Context Protocol (MCP) server to connect with AI applications including
Gemini CLI, ChatGPT, Claude, and custom applications you are
developing. The data lineage remote MCP
server lets you interact with data lineage to query data
lineage graphs, discover upstream data provenance, and analyze downstream impact.


The Data Lineage API remote MCP server is enabled
when you enable Data Lineage API.


[Model Context Protocol](https://modelcontextprotocol.io/docs/getting-started/intro)
(MCP) standardizes how large language models (LLMs) and AI applications or
agents connect to external data sources. MCP servers let you use their tools,
resources, and prompts to take actions and get updated data from their backend
service.

## What's the difference between local and remote MCP servers?

Local MCP servers
:   Typically run on your local machine and use the standard input
    and output streams (stdio) for communication between services on the same
    device.

Remote MCP servers
:   Run on the service's infrastructure and offer an HTTP
    endpoint to AI applications for communication between the AI MCP client and
    the MCP server. For more information about MCP architecture, see
    [MCP architecture](https://modelcontextprotocol.io/docs/learn/architecture).

## Google and Google Cloud remote MCP servers

Google and Google Cloud remote MCP servers have the following features and benefits:

<br />

- Simplified, centralized discovery
- Managed global or regional HTTP endpoints
- Fine-grained authorization
- Optional prompt and response security with Model Armor protection
- Centralized audit logging

For information about other MCP servers and information about security
and governance controls available for Google Cloud MCP servers,
see [Google Cloud MCP servers overview](https://docs.cloud.google.com/mcp/overview).

## Before you begin

<br />

### Required roles


To get the permissions that
you need to use the data lineage MCP server,

ask your administrator to grant you the
following IAM roles on the project where you want to use the data lineage MCP server:

- Make MCP tool calls: [MCP Tool User](https://docs.cloud.google.com/iam/docs/roles-permissions/mcp#mcp.toolUser) (`roles/mcp.toolUser`)
- View data lineage information: [Data Lineage Viewer](https://docs.cloud.google.com/iam/docs/roles-permissions/datalineage#datalineage.viewer) (`roles/datalineage.viewer`)


For more information about granting roles, see [Manage access to projects, folders, and organizations](https://docs.cloud.google.com/iam/docs/granting-changing-revoking-access).


These predefined roles contain

the permissions required to use the data lineage MCP server. To see the exact permissions that are
required, expand the **Required permissions** section:


#### Required permissions

The following permissions are required to use the data lineage MCP server:

- Make MCP tool calls: `mcp.tools.call`
- Query data lineage in search for links: `datalineage.locations.searchLinks`


You might also be able to get
these permissions
with [custom roles](https://docs.cloud.google.com/iam/docs/creating-custom-roles) or
other [predefined roles](https://docs.cloud.google.com/iam/docs/roles-overview#predefined).

## Authentication and authorization

The Data Lineage API remote MCP server uses the [OAuth 2.0](https://developers.google.com/identity/protocols/oauth2) protocol with [Identity and Access Management (IAM)](https://docs.cloud.google.com/iam/docs/overview) for authentication and authorization. All [Google Cloud identities](https://docs.cloud.google.com/docs/authentication/identity-products) are supported for authentication to MCP servers.

We recommend that you create a separate identity for agents that are using MCP
tools so that access to resources can be controlled and monitored. For more information about
authentication, see [Authenticate to MCP servers](https://docs.cloud.google.com/mcp/authenticate-mcp).

### What MCP OAuth scopes do I need for data lineage?

OAuth 2.0 uses scopes and credentials to determine if an authenticated
principal is authorized to take a specific action on a resource. For more
information about OAuth 2.0 scopes at Google, read
[Using OAuth 2.0 to access Google APIs](https://developers.google.com/identity/protocols/oauth2).

Data lineage has the following MCP tool OAuth scopes:

| Scope URI for gcloud CLI | Description |
|---|---|
| `https://www.googleapis.com/auth/datalineage.readonly` | Only allows access to read data. |
| `https://www.googleapis.com/auth/datalineage.read-write` | Allows access to read and modify data. |

Additional scopes might be required on the resources accessed during a tool
call. To view a list of scopes required for
data lineage, see
[Data Lineage API](https://developers.google.com/identity/protocols/oauth2/scopes#datalineage).

## Configure an MCP client to use the data lineage MCP server

AI applications and agents, such as Claude or Antigravity, can instantiate an
MCP client that connects to a single MCP server. An AI application can have
multiple clients that connect to different MCP servers.
If your application isn't listed in the
[client-specific guidance](https://docs.cloud.google.com/mcp/configure-mcp-ai-application#client-specific-guidance), then you can use
the following information to connect from most applications.

In your AI application, look for a way to add or connect to a remote MCP server.
For the data lineage MCP server, enter the following
information as required:

- **Server name**: data lineage MCP server
- **Server URL** or **Endpoint** :
  - Global endpoint: `https://datalineage.googleapis.com/mcp`
  - Regional endpoints: `https://REGION-datalineage.googleapis.com/mcp`. Replace <var translate="no">REGION</var> with the one of the [supported regions](https://docs.cloud.google.com/dataplex/docs/locations).
- **Transport**: HTTP
- **Authentication details** : Depending on how you want to authenticate, you can enter your Google Cloud credentials, your OAuth Client ID and secret, or an agent identity and credentials. For more information about authentication, see [Authenticate to MCP servers](https://docs.cloud.google.com/mcp/authenticate-mcp).
- **OAuth scope** : the [OAuth 2.0 scope](https://developers.google.com/identity/protocols/oauth2/scopes) that you want to use when connecting to the data lineage MCP server.

For application-specific guidance about setting up and connecting to MCP server,
see [Client-specific guidance](https://docs.cloud.google.com/mcp/configure-mcp-ai-application#client-specific-guidance).

For more general guidance, see the following resources:

- [Connect to remote MCP servers](https://modelcontextprotocol.io/docs/develop/connect-remote-servers).
- [Configure MCP in an AI application](https://docs.cloud.google.com/mcp/configure-mcp-ai-application).

## What MCP tools does data lineage provide?

To view details of available MCP tools and their descriptions for the
data lineage MCP server, see the
[data lineage MCP reference](https://docs.cloud.google.com/dataplex/docs/reference/data-lineage/mcp).

### List the available MCP tools

Use the [MCP inspector](https://modelcontextprotocol.io/docs/tools/inspector) to list tools, or send a
`tools/list` HTTP request directly to the data lineage
remote MCP server. The `tools/list` method doesn't require authentication.

    POST /mcp HTTP/1.1
    Host: datalineage.googleapis.com
    Content-Type: application/json

    {
      "method": "tools/list",
      "jsonrpc": "2.0",
      "id": 1
    }

## Example use cases

Example use cases for the data lineage MCP server include:

- Discovering all upstream data sources and transformation processes that feed into a specific data asset to verify data origin and accuracy.
- Analyzing the impact of broken, stalled, or delayed data pipelines on downstream data consumers.

## Sample prompts

- "In my project `my-analytics-project`, I have a dataset `sales_data` with a table called `monthly_reports`. Tell me all the data assets and transformation processes that feed data into this table."
- "I have a BigQuery job that writes into the `hr_dataset.salary` table. I see the job has been failing to run for 12 hours now. Can you tell me which downstream assets will have stale data because of this issue?"
- "Go through the `monthly_reports` table in `sales_data` dataset and `my-analytics-project` project to find all the columns that have upstream data sources, and give me all the processes that feed into these columns."
- "Search for lineage links connected to table `finance.employment_costs` to understand its upstream dependencies."

## Optional security and safety configurations

MCP introduces new security risks and considerations due to the wide variety of
actions that you can do with the MCP tools. To minimize and manage these risks,
Google Cloud offers default settings and customizable
policies to control the use of MCP tools in your Google Cloud
organization or project.

For more information about MCP security and governance, see
[AI security and safety](https://docs.cloud.google.com/mcp/ai-security-safety).

### Control MCP use with IAM deny policies

[Identity and Access Management (IAM) deny policies](https://docs.cloud.google.com/iam/docs/deny-overview)
help you secure Google Cloud remote MCP servers. Configure these policies to
block unwanted MCP tool access.

For example, you can deny or allow access based on:

- The principal
- Tool properties like read-only
- The application's OAuth client ID

For more information, see [Control MCP use with Identity and Access Management](https://docs.cloud.google.com/mcp/control-mcp-use-iam).

## What's next

- Read the [data lineage MCP tools reference](https://docs.cloud.google.com/dataplex/docs/reference/data-lineage/mcp).
- Learn more about [Google Cloud MCP servers](https://docs.cloud.google.com/mcp/overview).