feat(mcp): add the ingestion tools to DataHub Core's MCP server

NW
2d ago
+2947-114

Stack. Part of the series that adds a built-in MCP server to DataHub Core. Based on na--mcp-homepage (#21591); review only its own commits. Everything user-facing is behind MCP_SERVER_ENABLED, off by default.

Stack so far:

1–22. Merged to master as #21332.
23–34. #21435, the read tools (PRs 24–34 merged into it).
35–46. #21501, the write tools (PRs 36–46 merged into it).
47–55. #21587, MCP settings: model, API and UI.
56–60. #21588, telemetry, metrics, usage events and the stdio server.
61–64. #21589, docs, release notes and smoke tests.
65–68. #21590, settings enforcement and the tool catalog.
69–70. #21591, the home page module.
71–74. This PR, the ingestion tools. ← this PR

What this does

Adds an ingestion tool group with 10 tools, so an agent can write and check a recipe, save it as an ingestion source, run it on DataHub's executor, follow the run and roll it back. It combines what would have been stack PRs 71–74, one commit each.

  • Recipe tools (PR 71): list_connector_types, get_recipe_schema and validate_recipe, the datahub recipe CLI as MCP tools. They run against the acryl-datahub in the server's process; a connector it can't load gets an error that links its docs, never a false "invalid". Secret references resolve to a placeholder, never to the server's environment.
  • Source tools (PR 72): list_ingestion_sources, create_ingestion_source and update_ingestion_source. Credentials must be ${SECRET} references; stored literal credentials are masked when read back.
  • Run tools (PR 73): run_ingestion (also tests a connection, waiting up to 240 s), list_ingestion_runs, list_ingestion_run_entities and rollback_ingestion_run (a dry run by default). run_ingestion is marked destructive, because a stateful run removes what the source no longer has.
  • On by default in DataHub Core (PR 74): the group is part of "all tools" in Core and the stdio server serves it by default. DataHub Cloud keeps it opt-in (cloud_opt_in), so syncing this package doesn't add tools to its default server. The tool catalog reports optInGroups (Core: []), and the settings tool picker reads it.

Ported from DataHub Cloud's ingestion tools without the Cloud-only parts (the Ingestion Agent and its docs corpus, recipe runs and previews, probe requests, log streaming, agent task bindings). Writes go through execute_write: one attempt, and no reply is reported as an unknown outcome with how to check.

Switches: INGESTION_TOOLS_ENABLED=false removes the whole group, and TOOLS_IS_MUTATION_ENABLED=false removes its writes. The docs and release note say how to turn it off, and keep the risk note: these tools can create, run and roll back ingestion.

No version gates: every GraphQL field exists on GMS 1.7.0 (the schema-snapshot tests check 1.7.0, 1.8.0, 1.9.0 and master) and the Rest.li runs resource predates it. The recipe introspection needs acryl-datahub 1.8.0+ in the server; older gets a clear error.

Testing

  • Python: ./gradlew :packages:datahub-core-mcp-tools:lint :packages:datahub-core-mcp-tools:testQuick :packages:datahub-ai-service:lint :packages:datahub-ai-service:testQuick: 1,019 core and 174 service tests pass at this PR's tip.
  • Frontend: vitest on context/agents and settingsV2 (the tool picker with and without optInGroups): 88 tests. ESLint, Prettier and tsc pass.
  • Live, against a local DataHub Core with default settings: /catalog/tools returned optInGroups: [], tools/list had all 10 ingestion tools (39 in all), and list_ingestion_sources returned the instance's sources. A demo-data run succeeded (8 aspects), and both a dry-run and a real rollback worked; the test data was deleted afterwards.

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)
  • 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


Summary by cubic

Adds an ingestion tool group with 10 tools to DataHub Core's built-in MCP server, so agents can write and validate recipes, create and update ingestion sources, run them on the executor, follow runs, and roll them back. The group is on by default in DataHub Core; DataHub Cloud keeps it opt-in.

Behavior

  • New tools: list_connector_types, get_recipe_schema, validate_recipe, list_ingestion_sources, create_ingestion_source, update_ingestion_source, run_ingestion, list_ingestion_runs, list_ingestion_run_entities, and rollback_ingestion_run.
  • Recipe tools run against the acryl-datahub in the server's process; unloadable connectors get a clear error linking their docs, never a false "invalid".
  • Recipe credentials must be ${SECRET} references; stored literal credentials are masked when read back.
  • run_ingestion is marked destructive since stateful runs remove what the source no longer has; rollback_ingestion_run is dry-run by default.
  • INGESTION_TOOLS_ENABLED=false removes the whole group; TOOLS_IS_MUTATION_ENABLED=false drops only its writes.
  • The tool catalog reports optInGroups (Core: []), and the settings tool picker reads it; without the field it falls back to treating evals and ingestion as opt-in.