stacklok / stacklok/toolhive

Allow configuring CLI arguments using a schema

Open
#1,244 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
2.2k
Forks
300
Avg merge
1d 15h
Merged PRs (30d)
184

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named. Start by mapping how thv and the GUI currently accept CLI arguments and how registry entries represent them; done requires an agreed schema covering validation, secrets, serialization, and any needed deserialization path.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, json
Domain
api, cli, desktop
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.