using System.Collections.Generic;
using MCPForUnity.Editor.Clients;
using MCPForUnity.Editor.Models;
namespace MCPForUnity.Editor.Services
{
/// <summary>
/// Service for configuring MCP clients
/// </summary>
public interface IClientConfigurationService
/// Configures a specific MCP client
/// <param name="client">The client to configure</param>
void ConfigureClient(IMcpClientConfigurator configurator);
/// Configures all detected/installed MCP clients (skips clients where CLI/tools not found)
/// <returns>Summary of configuration results</returns>
ClientConfigurationSummary ConfigureAllDetectedClients();
/// Checks the configuration status of a client
/// <param name="client">The client to check</param>
/// <param name="attemptAutoRewrite">If true, attempts to auto-fix mismatched paths</param>
/// <returns>True if status changed, false otherwise</returns>
bool CheckClientStatus(IMcpClientConfigurator configurator, bool attemptAutoRewrite = true);
/// <summary>Gets the registry of discovered configurators.</summary>
IReadOnlyList<IMcpClientConfigurator> GetAllClients();
}
/// Summary of configuration results for multiple clients
public class ClientConfigurationSummary
/// Number of clients successfully configured
public int SuccessCount { get; set; }
/// Number of clients that failed to configure
public int FailureCount { get; set; }
/// Number of clients skipped (already configured or tool not found)
public int SkippedCount { get; set; }
/// Detailed messages for each client
public System.Collections.Generic.List<string> Messages { get; set; } = new();
/// Gets a human-readable summary message
public string GetSummaryMessage()
return $"✓ {SuccessCount} configured, ⚠ {FailureCount} failed, ➜ {SkippedCount} skipped";