feat: add argument --with-uixt to start built-in uixt MCP server

This commit is contained in:
lilong.129
2025-05-20 22:36:46 +08:00
parent 037e69315e
commit 0c20fe7b02
11 changed files with 84 additions and 31 deletions

View File

@@ -15,7 +15,7 @@ var CmdMCPHost = &cobra.Command{
Long: `mcphost is a command-line tool that allows you to interact with MCP tools.`,
RunE: func(cmd *cobra.Command, args []string) error {
// Create MCP host
host, err := mcphost.NewMCPHost(mcpConfigPath)
host, err := mcphost.NewMCPHost(mcpConfigPath, withUIXT)
if err != nil {
return fmt.Errorf("failed to create MCP host: %w", err)
}
@@ -40,9 +40,11 @@ var CmdMCPHost = &cobra.Command{
var (
mcpConfigPath string
dumpPath string
withUIXT bool
)
func init() {
CmdMCPHost.Flags().StringVarP(&mcpConfigPath, "mcp-config", "c", "$HOME/.hrp/mcp.json", "path to the MCP config file")
CmdMCPHost.Flags().StringVar(&dumpPath, "dump", "", "path to save the exported tools JSON file")
CmdMCPHost.Flags().BoolVar(&withUIXT, "with-uixt", false, "start built-in uixt MCP server")
}