Skip to content

Add structure dependency graph command#147

Merged
httpdss merged 1 commit intomainfrom
codex/add-command-to-mcp-from-issue-138
May 9, 2026
Merged

Add structure dependency graph command#147
httpdss merged 1 commit intomainfrom
codex/add-command-to-mcp-from-issue-138

Conversation

@httpdss
Copy link
Copy Markdown
Owner

@httpdss httpdss commented May 9, 2026

Motivation

  • Provide a way to visualize dependency relationships declared via folders[].struct / folders[].structkit so users can inspect nested structure references, detect missing targets, and find cycles.
  • Expose the feature both from the CLI and as an MCP tool so it can be used interactively and programmatically (e.g., from AI-assisted clients).

Description

  • Add a new CLI command GraphCommand in structkit/commands/graph.py that builds a dependency graph from structure definitions, de-duplicates edges, reports missing references and cycles, and emits text, json, or mermaid output.
  • Register graph in the main CLI (structkit/main.py) and document the command in docs/cli-reference.md.
  • Integrate graph functionality into MCP via _graph_structure_logic, a graph_structure tool registration, and a compatibility handler _handle_graph_structure in structkit/mcp_server.py, and document the MCP tool in docs/mcp-integration.md.
  • Add tests in tests/test_graph_command.py covering single/multiple/nested dependencies, missing nodes, cycles, local YAML input, --all mode, JSON/Mermaid output, and MCP compatibility.

Testing

  • Ran unit tests for the graph feature with pytest tests/test_graph_command.py -q, which passed.
  • Ran the graph + MCP integration tests with pytest tests/test_graph_command.py tests/test_mcp_integration.py -q, which passed.
  • Ran the full test suite with pytest -q, which passed (all tests green).

Codex Task

@httpdss httpdss added enhancement New feature or request minor feature labels May 9, 2026
@httpdss httpdss merged commit 6daecbe into main May 9, 2026
3 checks passed
@httpdss httpdss deleted the codex/add-command-to-mcp-from-issue-138 branch May 9, 2026 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant