Skip to content

Allow configuring CLI arguments using a schema #1244

@kantord

Description

@kantord

Problem

As a user of thv (or the GUI app), I find it difficult to use MCPs that require CLI arguments to run properly.

What makes it difficult and frustrating:

  • there is no immediate feedback when I'm using the wrong arguments
  • there is no easy way to find what the correct arguments are
  • when there is no feedback, I might just assume that the MCP is working properly, when in reality, it's not
  • getting it right requires a lot of trial-and-error, and this involves looking at logs in multiple places
  • I don't know how to use secrets for CLI arguments

Suggestion

We could have a simple schema based system for validating CLI arguments. (Perhaps, JSON schema or a similar schema engine can be used for this).

This could allow the GUI and CLI to use an intermediate JSON representation for the CLI arguments that can be validated against the schema.

In order to solve the serialization of this intermediate representation back to CLI arguments, we could add either design the schema system in such a way that a generic serializer is trivial to build (for example, the schema could have a string template for each field). Or, we could attach a small jq script to registry entries which would handle the serialization.

Deserialization might also be needed, if we want to allow this feature through the CLI/API. I think the schema system could be built to support this, or perhaps it can be implemented using a standard argument parsing library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions