Files
Shutong Wu afa447ef38 fix(client): configure Kilo Code with its kilo.jsonc MCP format (#1120)
Kilo Code v7.0.33+ moved MCP config out of the VS Code extension's
globalStorage/mcp_settings.json to a CLI-style kilo.jsonc under ~/.config/kilo,
with a new schema (https://app.kilo.ai/config.json): an "mcp" container,
type:"remote" for HTTP servers (type:"local" for stdio), and an "enabled" flag.
Writing the legacy mcpServers / type:"http" / disabled config left the server
showing as stdio + disabled.

- KiloCodeConfigurator targets ~/.config/kilo/kilo.jsonc on every OS and declares
  the new format (mcp container, type:remote/local, enabled:true, $schema)
- Generalize the per-client HTTP "type" override: replace the UsesStreamableHttpType
  bool with McpClient.HttpTypeValue (Cline/Roo => "streamableHttp", Kilo => "remote",
  default "http"); add StdioTypeValue, ServerContainerKey and SchemaUrl fields
- ConfigJsonBuilder honors ServerContainerKey ("mcp") and writes a root $schema;
  JsonFileMcpConfigurator.CheckStatus/Unregister read/remove from the configured
  container so status detection and teardown work for Kilo
- Replace StreamableHttpTypeTests with ClientConfigFormatTests covering Kilo's
  remote/mcp/enabled format, Cline's streamableHttp, and generic http

Verified: 5 new tests + 13 existing config tests pass (EditMode, Unity 2021.3).
2026-06-14 21:32:04 -07:00

39 lines
1.9 KiB
C#

using System;
using System.Collections.Generic;
using System.IO;
using MCPForUnity.Editor.Models;
namespace MCPForUnity.Editor.Clients.Configurators
{
public class KiloCodeConfigurator : JsonFileMcpConfigurator
{
public KiloCodeConfigurator() : base(new McpClient
{
name = "Kilo Code",
// Kilo Code v7.0.33+ moved MCP config out of the VS Code extension's
// globalStorage/mcp_settings.json to a CLI-style kilo.jsonc under ~/.config/kilo.
// The new schema (https://app.kilo.ai/config.json) uses an "mcp" container,
// type:"remote" for HTTP servers, type:"local" for stdio, and an "enabled" flag.
// ~/.config/kilo/kilo.jsonc on every OS (UserProfile resolves to C:\Users\<user> on Windows).
windowsConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".config", "kilo", "kilo.jsonc"),
macConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".config", "kilo", "kilo.jsonc"),
linuxConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".config", "kilo", "kilo.jsonc"),
IsVsCodeLayout = false,
ServerContainerKey = "mcp",
HttpTypeValue = "remote",
StdioTypeValue = "local",
SchemaUrl = "https://app.kilo.ai/config.json",
DefaultUnityFields = { { "enabled", true } }
})
{ }
public override IList<string> GetInstallationSteps() => new List<string>
{
"Install or update Kilo Code (v7.0.33 or newer)",
"Open the Kilo Code MCP Servers view\nOR edit the config file at the path above (~/.config/kilo/kilo.jsonc)",
"Paste the configuration JSON into the \"mcp\" object",
"Save and restart Kilo Code"
};
}
}