MCP Servers
The MCP layer is the typed, deterministic interface to DataFlow: 21 tools across authoring, pipelines, execution, and observability. It makes the calls; agent reasoning, sessions, and mutation approvals live in the runtime, and permissions stay enforced by DataFlow.
At a glance
- 21 typed tools - authoring, pipelines, execution, and observability.
- Five are mutating - Apply, Run, Cancel, and the two schedule tools; all require an approval.
- Secret-safe - specs are redacted on the way out, and YAML containing
<redacted>placeholders is refused on apply. - No credential passthrough -
list_connectionsnever calls the credentials endpoint; DataFlow resolves managed-connection auth.
The 21 tools
Authoring
| Tool | Purpose |
|---|---|
dataflow.get_authoring_schema | Safe authoring schema/guidance |
dataflow.validate_pipeline | Structural YAML validation |
dataflow.analyze_metadata | Frames + semantic warnings |
dataflow.check_saved_pipeline | Validate a saved spec privately |
dataflow.explore_connection | Connection hierarchy exploration |
dataflow.list_connections | Safe connection metadata |
Pipelines
| Tool | Purpose |
|---|---|
dataflow.list_pipelines | Find saved pipelines |
dataflow.get_pipeline_spec | Secret-safe spec projection |
dataflow.list_pipeline_versions | Known gap (always errors) |
dataflow.apply_pipeline | Create/update a pipeline |
Execution
| Tool | Purpose |
|---|---|
dataflow.get_pipeline_schedule | Schedule config + state |
dataflow.enable_pipeline_schedule | Enable a schedule |
dataflow.disable_pipeline_schedule | Pause a schedule |
dataflow.run_pipeline | Execute a saved pipeline |
dataflow.cancel_run | Kill a run |
Observability
| Tool | Purpose |
|---|---|
dataflow.list_pipeline_runs | Run history with filters |
dataflow.get_run | One run (from history) |
dataflow.get_run_spec | Historical run YAML |
dataflow.get_run_logs | Bounded driver logs |
dataflow.get_run_stages | Stage status + failures |
dataflow.get_stage_sample_data | Persisted sample rows |
Five tools are mutating: apply_pipeline, run_pipeline, cancel_run, and the two schedule toggles. They are flagged requires_confirmation in the generated contract, and the runtime enforces the approvals - the MCP server itself never infers approval from conversation text. Apply and Run remain separate approvals.
Connecting to DataFlow
Set in mcp/.env:
| Variable | Default | Purpose |
|---|---|---|
DATAFLOW_BASE_URL | http://localhost:8080 | Backend URL |
DATAFLOW_TOKEN | empty | Bearer token |
DATAFLOW_COOKIE | empty | Raw cookie header |
DATAFLOW_TIMEOUT_MS | 30000 | Per-request timeout |
DATAFLOW_INSECURE_TLS | false | Skip TLS verification |
MCP_HOST / MCP_PORT / MCP_PATH | loopback / 3100 / /mcp | HTTP transport bind |
Token or cookie - either works; both are sent if both are set. Production should use delegated user identity so DataFlow stays the authorization authority; local development can use a personal token.
Running the adapter
Code
- stdio is for clients that launch the process (how the runtime uses it). Set the working directory to
mcp/so its.envloads; the protocol uses stdout, the banner goes to stderr - HTTP serves an MCP handler at
MCP_PATHwith aGET /healthcheck - handy for pointing other MCP clients at it
Secret safety
- Specs are sanitized before they leave: credentials redacted,
redacted_pathsreported, and YAML containing<redacted>placeholders is refused on apply list_connectionsnever calls the credentials endpoint; DataFlow resolves managed-connection auth itself- All tool outputs and error details are scrubbed (bearer/basic values, signed URLs, private keys)
Versioning
MCP_VERSION (0.4.23) is pinned to the package version, and DATAFLOW_TESTED_VERSION records the DataFlow version the layer was reviewed against (1.0.0). npm run doctor warns on a backend version mismatch - advisory only: the live backend remains authoritative.
Live tests
Code
Four suites (authoring, pipelines, execution, observability) spawn the real server, connect a real MCP client, and verify tool registration against the contract. --full creates disposable pipelines (__mcp_e2e_<timestamp>) and runs enable/disable/run/cancel cycles - use it only against a test backend.
Known gaps
| Gap | Behavior |
|---|---|
| Saved version history | list_pipeline_versions always returns DATAFLOW_CAPABILITY_NOT_AVAILABLE |
| Run detail endpoint | get_run derives results from run history (the direct endpoint is a stub) |
| Stage lineage route | get_stage_sample_data returns sample rows, not a lineage graph |
Related pages
- Agent Runtime - who calls these tools and how approvals work
- Skills - the guidance that drives tool use
- API Reference - the underlying DataFlow REST surface