The Model Context Protocol (MCP) server for DataHub allows AI agents to query DataHub for metadata and context about your data ecosystem. It enables AI assistants to search, fetch metadata, traverse lineage graphs, and access SQL queries associated with datasets in your DataHub instance.
You'll need to install uv
, a Python package manager and installer:
# On macOS and Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
Before using the MCP server, you need to prepare your DataHub authentication details:
https://tenant.acryl.io/gms
)Alternatively, you can use a ~/.datahubenv
file by running:
uvx --from acryl-datahub datahub init
This command will guide you through creating the necessary configuration file.
Once you have your authentication details, you'll need to configure your MCP client to connect to DataHub. The configuration process varies depending on which AI agent you're using.
First, find the full path to the uvx
command:
which uvx
Then update your claude_desktop_config.json
file with:
{
"mcpServers": {
"datahub": {
"command": "<full-path-to-uvx>",
"args": ["mcp-server-datahub"],
"env": {
"DATAHUB_GMS_URL": "<your-datahub-url>",
"DATAHUB_GMS_TOKEN": "<your-datahub-token>"
}
}
}
}
Add the following to your .cursor/mcp.json
file:
{
"mcpServers": {
"datahub": {
"command": "uvx",
"args": ["mcp-server-datahub"],
"env": {
"DATAHUB_GMS_URL": "<your-datahub-url>",
"DATAHUB_GMS_TOKEN": "<your-datahub-token>"
}
}
}
}
For other MCP clients, use this generic configuration:
command: uvx
args:
- mcp-server-datahub
env:
DATAHUB_GMS_URL: <your-datahub-url>
DATAHUB_GMS_TOKEN: <your-datahub-token>
If you encounter an error like this:
2025-04-08T19:58:16.593Z [datahub] [error] spawn uvx ENOENT {"stack":"Error: spawn uvx ENOENT\n at ChildProcess._handle.onexit (node:internal/child_process:285:19)\n at onErrorNT (node:internal/child_process:483:16)\n at process.processTicksAndRejections (node:internal/process/task_queues:82:21)"}
Solution: Replace uvx
in your configuration with the full path to the uvx
executable, which you can find using which uvx
.
The MCP server for DataHub supports:
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.