Skip to content

Add MCP Support to 'list' and 'info' Commands #75

@httpdss

Description

@httpdss

Summary

Add support for querying available structures and retrieving detailed information about structures using the Model Context Protocol (MCP) with the existing list and info commands in the struct tool.

Implementation Details

  • Stdio Integration: Implement the struct tool to allow standard input/output interactions for configuring MCP.
    • Configure MCP for struct tool to list available structures and fetch details about specific structures.
  • Existing Command Modifications: Make modifications to existing commands to leverage MCP:
    • struct list:
      • Extend to support querying MCP for the list of available structures.
    • struct info [structure]:
      • Extend to support querying MCP to retrieve detailed information about a specific structure.
  • Configuration Support: Allow configuration of MCP options through command-line arguments, environment variables, or config files.

Additional MCP Tools:

  1. Generate Structure with MCP:

    • Implement an MCP command to trigger structure generation using a specified definition, base path, and additional options like mappings, dry run, etc.
    • This would allow remote automation of generating and configuring project structures directly from other MCP-compatible tools.
    • AI-Assisted Development Workflow Support: Consider enhancing the generate subcommand to better support AI-assisted development workflows where the --output console feature is used to pipe structure content to stdout for subsequent AI prompts. This enables powerful workflows like:
      • struct generate project/python /tmp/myproject --output console | ai-tool "Review this project structure"
      • Capturing generated structure content as context for multi-step AI-assisted development processes
      • Using struct output as input for code review, testing, and improvement suggestions
  2. Validate Structure Configuration:

    • Expose an MCP endpoint to validate YAML configuration files for structures.
    • This would allow checking for errors in structure configurations programmatically within an integrated development environment.

Expected Output

  1. List Available Structures:

    • Users should be able to run struct list and see structures queried from MCP.
  2. Get Structure Details:

    • Users should be able to run struct info [structure] to get detailed information about specified structures using MCP integration.
  3. Generate Structure via MCP:

    • Users should be able to use an MCP command to generate structures remotely with flexibility in configuration through various options.
    • Support for console output mode to enable AI-assisted development workflows where generated content serves as context for subsequent AI interactions.
  4. Validate Structure via MCP:

    • Users should be able to validate their structure configurations easily through a simple MCP call, ensuring correctness before deployment.

Benefits

This integration will provide a more versatile, programmable interface to interact with structure definitions, allowing improved automation and integration with other tools. The enhanced console output support will enable powerful AI-assisted development workflows where struct-generated content can be seamlessly integrated into broader development processes.

Acceptance Criteria

  • Implement MCP configuration for list and info commands
  • Thorough testing of MCP integration
  • Backward compatibility retained with existing functionality
  • Comprehensive documentation and usage guides for configuring MCP integrations
  • MCP support for generating structures with consideration for AI-assisted workflow use cases
  • MCP support for validating configurations
  • Enhanced console output functionality to better support AI prompt consumption and chaining

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions