Skip to main content

A Model Context Protocol (MCP) server for DataHub

Project description

DataHub MCP Server

A Model Context Protocol server implementation for DataHub.

What is DataHub?

DataHub is an open-source context platform that gives organizations a single pane of glass across their entire data supply chain. DataHub unifies data discovery, governance, and observability under one roof for every table, column, dashboard pipeline, document, and ML Model.

With powerful features for data profiling, data quality monitoring, data lineage, data ownership, and data classification, DataHub brings together both technical and organizational context, allowing teams to find, create, use, and maintain trustworthy data.

Use Cases

The DataHub MCP Server enables AI agents to:

  • Find trustworthy data: Search across the entire data landscape using natural language to find the tables, columns, dashboards, & metrics that can answer your most mission-critical questions. Leverage trust signals like data popularity, quality, lineage, and query history to get it right, every time.

  • Explore data lineage & plan for data changes: Understand the impact of important data changes before they impact your downstream users through rich data lineage at the asset & column level.

  • Understand your business: Navigate important organizational context like business glossaries, data domains, data products products, and data assets. Understand how key metrics, business processes, and data relate to one another.

  • Explain & generate SQL queries: Generate accurate SQL queries to answer your most important questions with the help of critical context like data documentation, data lineage, and popular queries across the organization.

Why DataHub MCP Server?

With DataHub MCP Server, you can instantly give AI agents visibility into of your entire data ecosystem. Find and understand data stored in your databases, data lake, data warehouse, and BI visualization tools. Explore data lineage, understand usage & use cases, identify the data experts, and generate SQL - all through natural language.

Structured Search with Context Filtering

Go beyond keyword matching with powerful query & filtering syntax:

  • Wildcard matching: /q revenue_* finds revenue_kpis, revenue_daily, revenue_forecast
  • Field searches: /q tag:PII finds all PII-tagged data
  • Boolean logic: /q (sales OR revenue) AND quarterly for complex queries

SQL Intelligence & Query Generation

Access popular SQL queries, and generate new ones with accuracy:

  • See how analysts query tables (perfect for SQL generation)
  • Understand join patterns and common filters
  • Learn from production query patterns

Table & Column-Level Lineage

Trace data flow at both the table and column level:

  • Track how user_id becomes customer_key downstream
  • Understand transformation logic
  • Upstream and downstream exploration (1-3+ hops)
  • Handle enterprise-scale lineage graphs

Understands Your Data Ecosystem

Understand how your data is organized before searching:

  • Discover relevant data domains, owners, tags and glossary terms
  • Browse across data platforms and environments
  • Navigate the complexities of your data landscape without guessing

Usage

See instructions in the DataHub MCP server docs.

Demo

Check out the demo video, done in collaboration with the team at Block.

Tools

The DataHub MCP Server provides the following tools:

search

Search DataHub using structured keyword search (/q syntax) with boolean logic, filters, pagination, and optional sorting by usage metrics.

get_lineage

Retrieve upstream or downstream lineage for any entity (datasets, columns, dashboards, etc.) with filtering, query-within-lineage, pagination, and hop control.

get_dataset_queries

Fetch real SQL queries referencing a dataset or column—manual or system-generated—to understand usage patterns, joins, filters, and aggregation behavior.

get_entities

Fetch detailed metadata for one or more entities by URN; supports batch retrieval for efficient inspection of search results.

list_schema_fields

List schema fields for a dataset with keyword filtering and pagination, useful when search results truncate fields or when exploring large schemas.

get_lineage_paths_between

Retrieve the exact lineage paths between two assets or columns, including intermediate transformations and SQL query information.

Example: Data Discovery & Understanding Flow (for Agents Using DataHub Tools)

This example illustrates how an AI agent could orchestrate DataHub MCP tools to answer a user's data question. It demonstrates the decision-making flow, which tools are called, and how responses are used.

1. User Asks a Question

Example:

"How can I find out how many pets were adopted last month?"

The agent recognizes this as a data discovery → query construction workflow. It needs to (a) find relevant datasets, (b) inspect metadata, (c) construct a correct SQL query.

2. Search for Relevant Datasets

The agent begins with the search tool (semantic or keyword depending on configuration).

Tool: search
Input: natural-language query

Example Call:

{
  "query": "pet adoptions"
}

Purpose: Identify datasets like adoptions, pet_profiles, pet_details.

3. Inspect Candidate Datasets

For each dataset returned by search, the agent may fetch metadata.

3.1 List Schema Fields

Tool: list_schema_fields
Input: URN of dataset
Purpose: Understand schema, datatype, candidate fields for querying.

Example:

{
  "urn": "urn:li:dataset:(urn:li:dataPlatform:snowflake,mydb.public.adoptions,PROD)"
}

3.2 Fetch Lineage (optional)

Tool: get_lineage
Purpose: Determine whether dataset is derived or authoritative.

3.3 Get Example Queries

Tool: get_dataset_queries
Purpose: Learn typical usage patterns and query templates for the dataset.

4. Understand Entity Relationships

If the question requires joining or entity navigation (e.g., connecting pets → adoptions):

get_entities

To retrieve entities related to a given URN, such as upstream/downstream tables.

get_lineage_paths_between

To calculate exact lineage paths between datasets if needed (e.g., between pet_profiles and adoptions).

5. Construct a Query

The agent now has:

  • The correct dataset
  • Its schema
  • Key fields
  • Sample queries
  • Relationship and lineage context

The agent constructs an accurate SQL query.

Example:

SELECT COUNT(*)
FROM mydb.public.adoptions
WHERE adoption_date >= DATE_TRUNC('month', CURRENT_DATE - INTERVAL '1' MONTH)
  AND adoption_date < DATE_TRUNC('month', CURRENT_DATE);

6. Return the Final Answer

The agent may either:

  • return the SQL directly,
  • run it (if in an environment where query execution is allowed), or
  • provide a natural-language answer based on query output.

Summary of Tools Used

Tool Name Purpose
search Find relevant datasets for the question.
list_schema_fields Understand dataset structure.
get_lineage Assess data authority and provenance.
get_dataset_queries Learn how the dataset is typically queried.
get_entities Retrieve related entities for context.
get_lineage_paths_between Understand deeper relationships between datasets.

Developing

See DEVELOPING.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_server_datahub_shemreader-1.0.0.tar.gz (202.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_server_datahub_shemreader-1.0.0-py3-none-any.whl (48.2 kB view details)

Uploaded Python 3

File details

Details for the file mcp_server_datahub_shemreader-1.0.0.tar.gz.

File metadata

File hashes

Hashes for mcp_server_datahub_shemreader-1.0.0.tar.gz
Algorithm Hash digest
SHA256 600ba90cac87304672641f5233ca3a5691a8f47f78459352e800bab1647245fb
MD5 ea198fe7bd36880180daded464614f7a
BLAKE2b-256 88ec47aa45331ece7c9695fad4e7ec5baa460b261301af4601e37cd105830907

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_server_datahub_shemreader-1.0.0.tar.gz:

Publisher: wheels.yml on shemreader/mcp-server-datahub

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcp_server_datahub_shemreader-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_server_datahub_shemreader-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c8f2d3d1a30661a4b64fa6336a32ae1b146e98a36acf527406e70d5ab51c1045
MD5 c378c3a741eaf2ba046fe1f927d8ee71
BLAKE2b-256 76c9d909dbdfc4c97237c539c7887dbf52978599f155d077a2265e84b6fca343

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_server_datahub_shemreader-1.0.0-py3-none-any.whl:

Publisher: wheels.yml on shemreader/mcp-server-datahub

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page