feat(mcp): port the read tools to DataHub Core's MCP server
Ā
NW
2d ago+19534+19534+01234567890123456789012345678901234567890123456789-10-10-01234567890123456789
Ports DataHub's read tools to the built-in MCP server's datahub-core-mcp-tools package. It targets master, on top of #21332, and the server stays off until GMS has MCP_SERVER_ENABLED=true.
This PR started as the search port. The other read-tool PRs, #21436 to #21447, have been merged into it, so it now carries all 12 reviewed and approved tool ports. The write tools follow in #21501 (PRs 35ā46, folded the same way).
What this does
Each port has its tool, its .gql, the helpers it needs and its tests. All are registered in the read group and are read-only.
search(#21435): keyword search with/qsyntax, a SQL-likefilter(AND/OR/NOT, IN, comparisons, structured properties, WITHIN), paging, sorting and facets. Empty results getsearch_notessaying what does match. It reads throughReadBackend.search_entities.get_entities(#21436): reads entities by URN with a strictfieldsallowlist and anomittedFieldsmanifest.schema_columnspicks columns. Descriptions, tags and terms are sibling-merged. On DataHub Core, the description leaves out the Cloud-onlydocumentationfield.list_schema_fields(#21437): pages and filters a dataset's columns.search_documentsandgrep_documents(#21438, #21439): find documents, and grep their text.grep_entities(#21440): regex search over entity metadata, using RE2.get_lineageandget_lineage_paths_between(#21441, #21442): multi-hop lineage, and the paths between two assets.get_dataset_queriesandget_dataset_usage_history(#21443, #21444).get_aspect_history(#21445): an aspect's earlier versions.- Glossary term version reads (#21447).
Each folded PR's description has the details of what was taken from DataHub Cloud's tool and from the legacy mcp-server-datahub.
Review fixes in this range
cachetoolshas an upper bound:>=5.0.0,<9.get_entitieshas a per-deployment description, likesearch.- The Cursor Bugbot findings on this PR and the folded read-tool PRs are fixed in the two
fix(mcp): address review findingscommits at the end of this range: view caches (no cached failures, locked),NOT (a OR b)filters, a 10,000-result paging cap, hybrid document search totals and page size, schema-field and key/value schema fields inget_entities,grep_documentsandgrep_entitieserror handling, column lineage paths and filters, and draft glossary term versions.
Testing
- At each folded PR's tip, rebased onto
master:./gradlew :packages:datahub-core-mcp-tools:lint :packages:datahub-core-mcp-tools:testQuick :packages:datahub-ai-service:lint :packages:datahub-ai-service:testQuick. 638 core tests pass at the final tip. - GraphQL snapshot tests check every new
.gqlagainst the pinned GMS schemas (1.7.0, 1.8.0, 1.9.0 andmaster). - Each folded PR's description lists its own testing.
Checklist
- The PR conforms to DataHub's Contributing Guideline (particularly PR Title Format)
- Tests for the changes have been added/updated (if applicable)
- Docs related to the changes have been added/updated (if applicable). The user guide comes with the docs PR later in the stack.
- For any breaking change/potential downtime/deprecation/big changes an entry has been made in Breaking Changes. Not applicable: the server is off by default.
š¤ Generated with Claude Code