Skip to content

Expose DAG validation as LLM tools via MCP#1490

Open
Dev-iL wants to merge 2 commits intoapache:mainfrom
SummitSG-LLC:2602/mcp
Open

Expose DAG validation as LLM tools via MCP#1490
Dev-iL wants to merge 2 commits intoapache:mainfrom
SummitSG-LLC:2602/mcp

Conversation

@Dev-iL
Copy link
Collaborator

@Dev-iL Dev-iL commented Feb 22, 2026

Changes

This includes 6 tools that leverage Hamilton's compile-time DAG validation for LLM feedback loops:

  1. validate_dag - Validate Hamilton DAG code by building the Driver.
  2. list_nodes - List all nodes in a Hamilton DAG with their types and dependencies.
  3. visualize - Visualize the Hamilton DAG as DOT graph source.
  4. execute - Execute a Hamilton DAG and return the requested outputs.
  5. get_docs - Get Hamilton documentation for a specific topic.
  6. scaffold - Generate a starter Hamilton module for a given pattern.

How I tested this

  • The included unit tests.
  • Claude code:
Screenshot from 2026-02-22 16-47-08 Screenshot from 2026-02-22 16-48-15 Screenshot from 2026-02-22 16-49-24

Notes

To use:

uv pip install .[mcp]
# Below for Claude, for other tools see the fastmcp v3 docs
fastmcp install claude-code hamilton/plugins/h_mcp/server.py

Checklist

  • PR has an informative and human-readable title (this will be pulled into the release notes)
  • Changes are limited to a single goal (no scope creep)
  • Code passed the pre-commit check & code is left cleaner/nicer than when first encountered.
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future TODOs are captured in comments
  • Project documentation has been updated if adding/changing functionality.

@Dev-iL Dev-iL force-pushed the 2602/mcp branch 5 times, most recently from c259c29 to 21a0878 Compare February 23, 2026 07:37
@Dev-iL Dev-iL changed the title Exposes DAG validation as LLM tools via MCP Expose DAG validation as LLM tools via MCP Feb 23, 2026
Copy link
Contributor

@skrawcz skrawcz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just one change

@Dev-iL Dev-iL mentioned this pull request Feb 24, 2026
7 tasks
Dev-iL and others added 2 commits March 1, 2026 09:38
This includes 6 tools that leverage Hamilton's compile-time DAG validation for LLM feedback loops:

1. validate_dag
2. list_nodes
3. visualize
4. execute
5. get_docs
6. scaffold

Install with `pip install "sf-hamilton[mcp]"`, run via `hamilton-mcp`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The SDK's requirements.txt referenced `sf-hamilton` (the old package
name), while the project has been renamed to `apache-hamilton`. Both
packages provide the `hamilton` Python module, so when pip installed
`sf-hamilton` from PyPI and then the editable `apache-hamilton` from
source, the two coexisted — the old sf-hamilton files in site-packages
shadowed the editable install's .pth redirect to the local source.
This caused the SDK tests to run against the stale PyPI release, which
lacks the `pd.__version__ < "3.0"` guards added in 157ecd6 for
kwargs removed in pandas 3.0 (verbose, keep_date_col, delim_whitespace).

Changes:
- ui/sdk/requirements.txt: sf-hamilton -> apache-hamilton
- hamilton-sdk.yml: reorder install steps so the editable source install
  runs after requirements, ensuring it always overrides the PyPI version

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants