Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/mcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Examples:
agentuity mcp list`,
Run: func(cmd *cobra.Command, args []string) {
logger := env.NewLogger(cmd)
detected, err := mcp.Detect(true)
detected, err := mcp.Detect(logger, true)
if err != nil {
logger.Fatal("%s", err)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,9 @@ Examples:

if tui.HasTTY {
// handle MCP server installation
detected, err := mcp.Detect(true)
detected, err := mcp.Detect(logger, true)
if err != nil {
logger.Fatal("%s", err)
logger.Error("failed to detect MCP clients: %s", err)
}
if len(detected) > 0 {
var clients []string
Expand Down
9 changes: 5 additions & 4 deletions internal/mcp/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func loadConfig(path string) (*MCPConfig, error) {
var mcpClientConfigs []MCPClientConfig

// Detect detects the MCP clients that are installed and returns an array of MCP client names found.
func Detect(all bool) ([]MCPClientConfig, error) {
func Detect(logger logger.Logger, all bool) ([]MCPClientConfig, error) {
home, err := os.UserHomeDir()
if err != nil {
return nil, err
Expand Down Expand Up @@ -158,7 +158,8 @@ func Detect(all bool) ([]MCPClientConfig, error) {
if util.Exists(config.ConfigLocation) {
mcpconfig, err = loadConfig(config.ConfigLocation)
if err != nil {
return nil, err
logger.Error("failed to load MCP config for %s: %s", config.Name, err)
return nil, nil
}
if _, ok := mcpconfig.MCPServers[agentuityToolName]; ok {
config.Detected = true
Expand All @@ -173,7 +174,7 @@ func Detect(all bool) ([]MCPClientConfig, error) {
// Install installs the agentuity tool for the given command and args.
// It will install the tool for each MCP client config that is detected and not already installed.
func Install(ctx context.Context, logger logger.Logger) error {
detected, err := Detect(false)
detected, err := Detect(logger, false)
if err != nil {
return err
}
Expand Down Expand Up @@ -243,7 +244,7 @@ func Install(ctx context.Context, logger logger.Logger) error {
// Uninstall uninstalls the agentuity tool for the given command and args.
// It will uninstall the tool for each MCP client config that is detected and not already uninstalled.
func Uninstall(ctx context.Context, logger logger.Logger) error {
detected, err := Detect(false)
detected, err := Detect(logger, false)
if err != nil {
return err
}
Expand Down
Loading