This page explains how to connect data lineage to developer tools such as the Gemini CLI and other Model Context Protocol (MCP) clients. Connecting data lineage to these tools enables AI-driven lineage tracking and data provenance analysis directly within your development environment.
You can connect IDEs and developer tools that support MCP by using a local MCP Toolbox for Databases. You can then use AI agents in your existing IDE to query data lineage graphs, discover upstream data provenance, and analyze downstream impact across your assets.
For more information about MCP, see Introduction to Model Context Protocol.
This guide demonstrates the connection process for the following tools:
- Gemini CLI
- Gemini Code Assist
- Claude Code
- Claude desktop
- Codex
- Cline (VS Code extension)
- Cursor
- Visual Studio Code (Copilot)
- Windsurf (formerly Codeium)
What MCP tools does data lineage provide?
The data lineage integration allows AI agents to query and analyze data lineage, representing the flow of data between source (upstream) and target (downstream) assets. It supports both entity-level lineage (tracking data flow between entire assets such as tables and files) and column-level lineage (tracking data flow between specific fields or columns within assets).
Data lineage provides the datalineage-search-lineage tool,
which retrieves a streaming response of lineage links connected to requested
assets.
For more information about the data lineage source and its available tools, see the Data Lineage Source documentation.
Required roles
To get the permissions that you need to connect to data lineage using MCP Toolbox, ask your administrator to grant you the following IAM roles on your project:
-
To enable APIs:
Service Usage Admin (
roles/serviceusage.serviceUsageAdmin) -
To use data lineage skills:
Data Lineage Viewer (
roles/datalineage.viewer)
For more information about granting roles, see Manage access to projects, folders, and organizations.
These predefined roles contain the permissions required to connect to data lineage using MCP Toolbox. To see the exact permissions that are required, expand the Required permissions section:
Required permissions
The following permissions are required to connect to data lineage using MCP Toolbox:
-
To enable APIs:
serviceusage.services.enable -
To use data lineage skills:
-
datalineage.lineage.searchLinks -
datalineage.processes.get -
datalineage.runs.get
-
You might also be able to get these permissions with custom roles or other predefined roles.
Enable the required APIs
-
In the Google Cloud console, go to the project selector page.
-
Select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Data lineage API.
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.-
If you're using a local shell, then create local authentication credentials for your user account:
gcloud auth application-default login
You don't need to do this if you're using Cloud Shell.
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
Install MCP Toolbox
You don't need to install MCP Toolbox if you only plan to use Gemini Code Assist, as it bundles the required server capabilities. For other IDEs and tools, follow the steps in this section to install MCP Toolbox.
Download the latest version of MCP Toolbox as a binary. Select the MCP Toolbox binary release that corresponds to your (OS) and CPU architecture. You must use MCP Toolbox
v0.31.0or later.Linux/amd64
curl -O https://storage.googleapis.com/mcp-toolbox-for-databases/VERSION/linux/amd64/toolbox
Replace
VERSIONwith MCP Toolbox version—for example,v0.31.0.macOS (Darwin)/arm64
curl -O https://storage.googleapis.com/mcp-toolbox-for-databases/VERSION/darwin/arm64/toolbox
Replace
VERSIONwith MCP Toolbox version—for example,v0.31.0.macOS (Darwin)/amd64
curl -O https://storage.googleapis.com/mcp-toolbox-for-databases/VERSION/darwin/amd64/toolbox
Replace
VERSIONwith MCP Toolbox version—for example,v0.31.0.Windows/amd64
curl -O https://storage.googleapis.com/mcp-toolbox-for-databases/VERSION/windows/amd64/toolbox
Replace
VERSIONwith MCP Toolbox version—for example,v0.31.0.Make the binary executable:
chmod +x toolboxVerify the installation:
./toolbox --versionA successful installation returns the version number, for example,
0.15.0.
Set up clients and connections for data lineage
This section explains how to connect data lineage to your tools.
To connect your MCP-compatible IDEs and tools to data lineage, you must first install MCP Toolbox and create a custom configuration file for your lineage source and tools.
In your project root or configuration directory, create a YAML file named
lineage-config.yamlwith the following configuration:kind: source name: lineage-source type: datalineage project: ${DATALINEAGE_PROJECT} --- kind: tool name: search_lineage type: datalineage-search-lineage source: lineage-source description: Retrieves a streaming response of lineage links connected to requested assets.Set the environment variable for your Google Cloud project:
export DATALINEAGE_PROJECT=PROJECT_IDReplace
PROJECT_IDwith the Google Cloud project ID.Configure your specific client using the
--configflag instead of a prebuilt configuration, as shown in the following sections.
Gemini CLI
You can use data lineage in the
Gemini CLI by configuring it as a local MCP server using
MCP Toolbox and your custom lineage-config.yaml file.
- In your project's working directory, create a folder named
.gemini(or open your global~/.geminidirectory). - Within that directory, create or open the
settings.jsonfile. Add the following configuration:
{ "mcpServers": { "dataLineage": { "command": "./PATH/TO/toolbox", "args": ["--config","/PATH/TO/lineage-config.yaml","--stdio"], "env": { "DATALINEAGE_PROJECT": "PROJECT_ID" } } } }Replace
PROJECT_IDwith the Google Cloud project ID.Save the configuration.
Start the Gemini CLI in interactive mode:
geminiIn the Gemini CLI, use the
/mcpcommand to verify that thedataLineageserver is connected.
Gemini Code Assist
Gemini Code Assist bundles the required MCP server capabilities, so you don't need to install MCP Toolbox separately.
- In VS Code, install the Gemini Code Assist extension.
- Enable Agent Mode in Gemini Code Assist chat.
- In your working directory, create a folder named
.gemini. Within that, create asettings.jsonfile. Add the following configuration:
{ "mcpServers": { "dataLineage": { "command": "./PATH/TO/toolbox", "args": ["--config","/PATH/TO/lineage-config.yaml","--stdio"], "env": { "DATALINEAGE_PROJECT": "PROJECT_ID" } } } }Replace
PROJECT_IDwith the Google Cloud project ID.Save the configuration.
Claude Code
While the official plugin provides tools for Knowledge Catalog, you can use data lineage in Claude Code by configuring a local MCP Toolbox server with your custom configuration file.
Set the environment variable to connect to your data lineage project:
export DATALINEAGE_PROJECT=PROJECT_IDReplace
PROJECT_IDwith the Google Cloud project ID.Configure Claude Code to use the MCP Toolbox server:
claude mcp add datalineage -- /PATH/TO/toolbox --config=/PATH/TO/lineage-config.yaml --stdioStart the agent:
claude
Codex
To use data lineage in Codex, configure an MCP server connection
in your Codex configuration to run MCP Toolbox with your custom
lineage-config.yaml file:
Set the environment variable to connect to your data lineage project:
export DATALINEAGE_PROJECT="PROJECT_ID"Replace
PROJECT_IDwith the Google Cloud project ID.In your Codex MCP configuration, add the server using MCP Toolbox:
{ "mcpServers": { "dataLineage": { "command": "./PATH/TO/toolbox", "args": ["--config","/PATH/TO/lineage-config.yaml","--stdio"], "env": { "DATALINEAGE_PROJECT": "PROJECT_ID" } } } }Replace
PROJECT_IDwith the Google Cloud project ID.
Claude desktop
- Open Claude Desktop and navigate to Settings.
- To open the configuration file, in the Developer tab, click Edit config.
Add the configuration:
{ "mcpServers": { "dataLineage": { "command": "./PATH/TO/toolbox", "args": ["--config","/PATH/TO/lineage-config.yaml","--stdio"], "env": { "DATALINEAGE_PROJECT": "PROJECT_ID" } } } }Replace
PROJECT_IDwith the Google Cloud project ID.Save the configuration.
Restart Claude desktop. The new chat screen displays an MCP icon representing the new MCP server.
Cline
- In VS Code, open the Cline extension and then click the MCP Servers icon.
- To open the configuration file, tap Configure MCP Servers.
Add the following configuration:
{ "mcpServers": { "dataLineage": { "command": "./PATH/TO/toolbox", "args": ["--config","/PATH/TO/lineage-config.yaml","--stdio"], "env": { "DATALINEAGE_PROJECT": "PROJECT_ID" } } } }Replace
PROJECT_IDwith the Google Cloud project ID.Save the configuration. A green active status appears after the server connects successfully.
Cursor
- Create the
.cursordirectory in your project root if it doesn't exist. - Create the
.cursor/mcp.jsonfile if it doesn't exist and open it. Add the following configuration:
{ "mcpServers": { "dataLineage": { "command": "./PATH/TO/toolbox", "args": ["--config","/PATH/TO/lineage-config.yaml","--stdio"], "env": { "DATALINEAGE_PROJECT": "PROJECT_ID" } } } }Replace
PROJECT_IDwith the Google Cloud project ID.Save the configuration.
Open Cursor and navigate to Settings > Cursor Settings > MCP. A green active status appears when the server connects.
VS Code (Copilot)
- Open VS Code
and create
.vscodedirectory in your project root if it doesn't exist. - Create the
.vscode/mcp.jsonfile if it doesn't exist, and open it. Add the following configuration:
{ "servers": { "dataLineage": { "command": "./PATH/TO/toolbox", "args": ["--config","/PATH/TO/lineage-config.yaml","--stdio"], "env": { "DATALINEAGE_PROJECT": "PROJECT_ID" } } } }Replace
PROJECT_IDwith the Google Cloud project ID.Save the configuration.
Windsurf
- Open Windsurf and navigate to Cascade assistant.
- To open the configuration file, click the MCP icon, then click Configure.
Add the following configuration:
{ "mcpServers": { "dataLineage": { "command": "./PATH/TO/toolbox", "args": ["--config","/PATH/TO/lineage-config.yaml","--stdio"], "env": { "DATALINEAGE_PROJECT": "PROJECT_ID" } } } }Replace
PROJECT_IDwith the Google Cloud project ID.Save the configuration.
Use the skills
Your AI assistant is now connected to data lineage. Try asking your AI assistant to trace upstream and downstream data lineage between your assets.
For example, you can ask your AI assistant to:
- Trace where a BigQuery table's data originates (upstream lineage).
- Discover which downstream tables or reports depend on a specific data asset (downstream lineage).
- Inspect column-level lineage between specific fields across assets.
Optional: Add system instructions
System instructions are a way to provide specific guidelines to the LLM, helping it to understand the context and respond more accurately. Set up system instructions based on the Data Lineage recommended system prompt.
For example, you can add instructions to guide the LLM on how to use the data lineage skills:
- When asked to trace upstream or downstream data flow between assets or columns, use the
search_lineageskill ordatalineage-search-lineagetool.
For more information about how to configure instructions, see Use instructions to get AI edits that follow your coding style.
What's next
- Review the difference between local and remote MCP servers.
- Learn how to use the local MCP Toolbox server for Knowledge Catalog.
- Read the Data Lineage MCP tools reference.
- Learn more about data lineage.
- Search for resources in Knowledge Catalog.