feat(mcp): tool groups and tool-aware server instructions
Merged
NW
4d ago+4600+4600+0123456789012345678901234567890123456789-178-178-012345678901234567890123456789
Stack. This is one PR in a series that adds a built-in MCP server to DataHub Core. It is based on na--mcp-schema-snapshots (the previous PR in the stack); review only its own commit. These PRs build out the shared datahub-core-mcp-tools package and datahub-ai-service; nothing is wired into quickstart, the frontend or Helm yet, so they change no running DataHub. The later PRs that expose MCP are all behind a GMS feature flag, MCP_SERVER_ENABLED, off by default.
Stack so far:
- #21332
- #21333
- #21334
- #21335
- #21336
- #21337
- #21338
- #21339
- #21340 ā this PR
- #21341
- #21342
- #21343
- #21344
- #21345
- #21346
- #21347
- #21348
- #21349
- #21350
- #21351
- #21352
- #21353
- #21435
- #21436
- #21437
- #21438
- #21439
- #21440
- #21441
- #21442
- #21443
- #21444
- #21445
- #21447
- #21501
- #21502
- #21503
- #21504
- #21505
- #21506
- #21507
- #21508
- #21509
- #21510
- #21511
- #21512
What this does
Add the shared capability groups and the instruction builder the settings
page and every host build on.
- tool_groups: Read metadata and Write metadata, membership computed from
tool tags, and resolve_tool_refs to turn a GROUP/TOOL selection into the
allowed tool names (a named tool overrides its group). get_me is a system
tool, served regardless of selection. Cloud passes its own longer group
list (proposals, evals, ...) to the same functions. - register_tools(groups=...) registers only the selected groups plus the
system tools, and returns the names it registered. - mcp_instructions: None / Small / Large. Large adds which tool fits which
job, naming only tools the server serves, and stays under the 2,048
characters clients keep. Custom instructions come last. - datahub-ai-service serves Large instructions built from its registered tools.
Testing
- Unit tests for group membership,
resolve_tool_refs(a named tool overriding its group),register_tools(groups=...), and the instructions (only served tools named, under 2,048 characters). - Instructions checked against a running DataHub Core instance.
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). Docs come later in the stack, with the user-facing pieces.
- For any breaking change/potential downtime/deprecation/big changes an entry has been made in Breaking Changes. Not applicable: nothing user-facing changes yet.
š¤ Generated with Claude Code