Skip to content
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
28 changes: 28 additions & 0 deletions MCPForUnity/Editor/Data/McpClients.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,34 @@ public class McpClients
mcpType = McpTypes.VSCode,
configStatus = "Not Configured",
},
// Trae IDE
new()
{
name = "Trae",
// Windows: %AppData%\Trae\mcp.json
windowsConfigPath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
"Trae",
"mcp.json"
),
// macOS: ~/Library/Application Support/Trae/mcp.json
macConfigPath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
"Library",
"Application Support",
"Trae",
"mcp.json"
),
// Linux: ~/.config/Trae/mcp.json
linuxConfigPath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
".config",
"Trae",
"mcp.json"
),
mcpType = McpTypes.Trae,
configStatus = "Not Configured",
},
// 3) Kiro
new()
{
Expand Down
1 change: 1 addition & 0 deletions MCPForUnity/Editor/Models/McpTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ public enum McpTypes
Kiro,
VSCode,
Windsurf,
Trae,
}
}
10 changes: 10 additions & 0 deletions MCPForUnity/Editor/Services/ClientConfigurationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,16 @@ public string GetInstallationSteps(McpClient client)
" OR manually run: claude mcp add UnityMCP\n" +
"3. Restart Claude Code",

McpTypes.Trae =>
"1. Open Trae and go to Settings > MCP\n" +
"2. Select Add Server > Add Manually\n" +
"3. Paste the JSON or point to the mcp.json file\n" +
" Windows: %AppData%\\Trae\\mcp.json\n" +
" macOS: ~/Library/Application Support/Trae/mcp.json\n" +
" Linux: ~/.config/Trae/mcp.json\n" +
"4. For local servers, Node.js (npx) or uvx must be installed\n" +
"5. Save and restart Trae",

_ => "Configuration steps not available for this client."
};

Expand Down
7 changes: 7 additions & 0 deletions MCPForUnity/Editor/Windows/ManualConfigEditorWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ protected virtual void OnGUI()
instructionStyle
);
}
else if (mcpClient?.mcpType == McpTypes.Trae)
{
EditorGUILayout.LabelField(
" a) Going to Settings > MCP > Add Server > Add Manually",
instructionStyle
);
}
EditorGUILayout.LabelField(" OR", instructionStyle);
EditorGUILayout.LabelField(
" b) Opening the configuration file at:",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,22 @@ public void DoesNotAddEnvOrDisabled_ForVSCode()
Assert.AreEqual("stdio", (string)unity["type"], "VSCode entry should include type=stdio");
}

[Test]
public void DoesNotAddEnvOrDisabled_ForTrae()
{
var configPath = Path.Combine(_tempRoot, "trae.json");
WriteInitialConfig(configPath, isVSCode: false, command: _fakeUvPath, directory: "/old/path");

var client = new McpClient { name = "Trae", mcpType = McpTypes.Trae };
InvokeWriteToConfig(configPath, client);

var root = JObject.Parse(File.ReadAllText(configPath));
var unity = (JObject)root.SelectToken("mcpServers.unityMCP");
Assert.NotNull(unity, "Expected mcpServers.unityMCP node");
Assert.IsNull(unity["env"], "env should not be added for Trae client");
Assert.IsNull(unity["disabled"], "disabled should not be added for Trae client");
}

[Test]
public void PreservesExistingEnvAndDisabled()
{
Expand Down
25 changes: 25 additions & 0 deletions UnityMcpBridge/Editor/Data/McpClients.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,31 @@ public class McpClients
mcpType = McpTypes.VSCode,
configStatus = "Not Configured",
},
// Trae IDE
new()
{
name = "Trae",
windowsConfigPath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
"Trae",
"mcp.json"
),
macConfigPath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
"Library",
"Application Support",
"Trae",
"mcp.json"
),
linuxConfigPath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
".config",
"Trae",
"mcp.json"
),
mcpType = McpTypes.Trae,
configStatus = "Not Configured",
},
// 3) Kiro
new()
{
Expand Down
1 change: 1 addition & 0 deletions UnityMcpBridge/Editor/Models/McpTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ public enum McpTypes
Kiro,
VSCode,
Windsurf,
Trae,
}
}
7 changes: 7 additions & 0 deletions UnityMcpBridge/Editor/Windows/ManualConfigEditorWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ protected virtual void OnGUI()
instructionStyle
);
}
else if (mcpClient?.mcpType == McpTypes.Trae)
{
EditorGUILayout.LabelField(
" a) Going to Settings > MCP > Add Server > Add Manually",
instructionStyle
);
}
EditorGUILayout.LabelField(" OR", instructionStyle);
EditorGUILayout.LabelField(
" b) Opening the configuration file at:",
Expand Down