Skip to content

Commit 1faa266

Browse files
authored
Merge pull request #30 from semantic-developer/feature/sd-32
aligned config.toml usage for mcp server definitions
2 parents 3f8b509 + 557d1ef commit 1faa266

File tree

12 files changed

+569
-125
lines changed

12 files changed

+569
-125
lines changed

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@
2727
- Pull requests should include: a brief summary, testing notes, screenshots/GIFs for UI changes, and links to relevant issues or discussions.
2828

2929
## Configuration & Security Notes
30-
- User-specific MCP servers live at `~/.config/SemanticDeveloper/mcp_servers.json` (or `%AppData%\SemanticDeveloper\mcp_servers.json` on Windows); avoid committing sample credentials.
30+
- User-specific MCP servers live under `~/.codex/config.toml` (or `%USERPROFILE%\.codex\config.toml` on Windows); avoid committing sample credentials. The path honors `$CODEX_HOME`.
3131
- API keys are configured through the app settings; never hard-code secrets—use environment variables or the settings dialog.

README.md

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ A cross‑platform desktop UI (Avalonia/.NET 8) for driving the Codex CLI app se
88
- Start a Codex session and stream assistant output in real time
99
- Send user input that is wrapped as protocol `Submission`s (app server)
1010
- Auto‑approve exec/patch requests (automatic)
11-
- Pick a model (built-in or from `config.toml` profiles) and load MCP servers from a JSON config (see [Windows setup](README.windows.md) for a WSL recipe)
11+
- Pick a model (built-in or from `config.toml` profiles) and load MCP servers from the Codex CLI `config.toml` (`[mcp_servers]` section); see [Windows setup](README.windows.md) for a WSL recipe
1212
- Keep multiple Codex sessions active at once using the tabbed header (each tab title shows its live status, e.g., `Session 2 – thinking…`)
1313
– See live token usage and estimated context remaining in the header
1414

@@ -28,21 +28,18 @@ Semantic Developer can drive the Codex CLI from Linux, macOS, or Windows.
2828
### Linux
2929

3030
- Install the .NET 8 SDK and the Codex CLI in your Linux environment.
31-
- Profiles live under `~/.codex/config.toml`; prompts under `~/.codex/prompts/`.
32-
- MCP config file: `~/.config/SemanticDeveloper/mcp_servers.json`.
31+
- Profiles & MCP servers live under `~/.codex/config.toml` (respects `$CODEX_HOME`); prompts under `~/.codex/prompts/`.
3332

3433
### macOS
3534

3635
- Install .NET 8 (e.g., `brew install dotnet-sdk`) and the Codex CLI (`brew install codex` or the official installer).
37-
- Profiles/prompts: `~/.codex/config.toml` and `~/.codex/prompts/`.
38-
- MCP config file: `~/Library/Application Support/SemanticDeveloper/mcp_servers.json`.
36+
- Profiles & MCP servers: `~/.codex/config.toml` (respects `$CODEX_HOME`); prompts under `~/.codex/prompts/`.
3937

4038
### Windows
4139

4240
- RECOMMENDED see [Windows setup](README.windows.md) recipe
4341
- Install the Windows .NET 8 SDK and Codex CLI for Windows, ensuring `codex.exe` is on your Windows `PATH`.
44-
- Profiles/prompts default to `%USERPROFILE%\.codex\config.toml` and `%USERPROFILE%\.codex\prompts\` (respect `CODEX_HOME` if set).
45-
- MCP config file: `%AppData%\SemanticDeveloper\mcp_servers.json`.
42+
- Profiles & MCP servers default to `%USERPROFILE%\.codex\config.toml` (respects `CODEX_HOME`); prompts live under `%USERPROFILE%\.codex\prompts\`.
4643

4744
## Build & Run
4845

@@ -65,11 +62,8 @@ Semantic Developer can drive the Codex CLI from Linux, macOS, or Windows.
6562
- Any profiles defined in `config.toml` (e.g., `$CODEX_HOME/config.toml`, defaulting to `~/.codex/config.toml`) are appended to the list and marked with an asterisk (`*`). Selecting a profile locks the reasoning controls and lets the profile determine the model/effort.
6663
- Profiles are optional—if you don’t have one, simply pick a built-in model.
6764
- Verbose logging (show suppressed output)
68-
- Enable MCP support (loads MCP servers from your JSON config and passes them directly to Codex)
69-
- MCP config locations:
70-
- Linux: `~/.config/SemanticDeveloper/mcp_servers.json`
71-
- macOS: `~/Library/Application Support/SemanticDeveloper/mcp_servers.json`
72-
- Windows: `%AppData%\SemanticDeveloper\mcp_servers.json`
65+
- Enable MCP support (mirrors the `[mcp_servers]` entries from your Codex CLI `config.toml` and passes them directly to Codex)
66+
- Config defaults to `~/.codex/config.toml` on Linux/macOS and `%USERPROFILE%\.codex\config.toml` on Windows; both honor `$CODEX_HOME`.
7367
- Use API Key for Codex CLI (pipes the key to `codex login --with-api-key` before sessions; does not rely on existing CLI auth)
7468
- Allow network access for tools (sets sandbox_policy.network_access=true on turns so MCP tools can reach the network)
7569
- Without API key enabled, the app proactively authenticates with `codex auth login` (falling back to `codex login`) before sessions so your chat/GPT token is used.
@@ -222,18 +216,18 @@ Notes
222216
## MCP Servers Panel
223217

224218
- The left pane includes an MCP section below the file tree:
225-
- Servers list: a checkbox per server from `mcp_servers.json`. Only selected servers are injected at session start.
219+
- Servers list: a checkbox per server defined under `[mcp_servers]` in your Codex `config.toml`. Only selected servers are injected at session start.
226220
- Tools list: after session starts, tools are grouped under their server names using short identifiers (the full identifier is available as a tooltip).
227221
- Header buttons:
228-
- ⚙ opens `mcp_servers.json` in your editor.
222+
- ⚙ opens `config.toml` in your editor.
229223
- ↻ reloads the config and updates the server list.
230224
- Only local stdio servers are supported (command/args/cwd/env). Remote transports (e.g., SSE) are not injected.
231225

232226
Config file location:
233-
- Linux/macOS: `~/.config/SemanticDeveloper/mcp_servers.json`
234-
- Windows: `%AppData%/SemanticDeveloper/mcp_servers.json`
227+
- Linux/macOS: `~/.codex/config.toml` (or `$CODEX_HOME/config.toml` if set)
228+
- Windows: `%USERPROFILE%\.codex\config.toml` (honors `CODEX_HOME`)
235229

236-
> Unlike the Codex CLI's `config.toml`, which may also list MCP servers, the app only reads from `mcp_servers.json`. Keep your server command/argument definitions in this JSON file so Semantic Developer can surface them in the UI and pass them to Codex automatically. Profiles still live in `config.toml`, but MCP server wiring should follow the Semantic Developer format.
230+
> Semantic Developer now shares the same MCP source as the Codex CLI. Define servers once inside `config.toml` and both the CLI and UI will pick them up automatically.
237231
238232
Selection behavior:
239233
- The checkbox state in the MCP pane determines which servers are passed to Codex at session start.

README.windows.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ WSLg should display the Semantic Developer UI on Windows. If the window fails to
7474

7575
## 10. Notes & Tips
7676
- Store Codex profiles and prompts inside the WSL home (`~/.codex/config.toml`, `~/.codex/prompts/`); Semantic Developer detects them automatically.
77-
- MCP server definitions live at `~/.config/SemanticDeveloper/mcp_servers.json` within Ubuntu.
77+
- MCP server definitions live under `~/.codex/config.toml` (the `[mcp_servers]` section) within Ubuntu.
7878
- Access Windows files from WSL using `/mnt/c/...`, but for best performance keep your workspace inside the Linux filesystem (e.g., `~/code`).
7979
- To update Codex or Node.js later:
8080
```bash
@@ -99,4 +99,4 @@ sudo apt install -y brave-browser
9999

100100
# test it
101101
brave-browser
102-
```
102+
```

SemanticDeveloper/Installers/Linux/build_deb.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ APP_PROJ="$ROOT/SemanticDeveloper/SemanticDeveloper.csproj"
88
PUBLISH_DIR="$SCRIPT_DIR/out/publish"
99
PKG_ROOT="$SCRIPT_DIR/pkgroot"
1010
DIST_DIR="$SCRIPT_DIR/dist"
11-
VERSION="1.0.6"
11+
VERSION="1.0.7"
1212
ARCH="amd64"
1313
if [[ "$RID" == "linux-arm64" ]]; then ARCH="arm64"; fi
1414

Binary file not shown.

SemanticDeveloper/SemanticDeveloper/Models/FileTreeItem.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@ public string Name
2424
public bool IsDirectory { get; init; }
2525
public ObservableCollection<FileTreeItem> Children { get; } = new();
2626
public bool ChildrenInitialized { get; private set; }
27+
private bool _isExpanded;
28+
public bool IsExpanded
29+
{
30+
get => _isExpanded;
31+
set
32+
{
33+
if (_isExpanded == value) return;
34+
_isExpanded = value;
35+
OnPropertyChanged();
36+
}
37+
}
2738
private string _gitStatus = string.Empty; // "added", "modified", "deleted", ""
2839
public string GitStatus
2940
{

SemanticDeveloper/SemanticDeveloper/SemanticDeveloper.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
77
<ApplicationManifest>app.manifest</ApplicationManifest>
88
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
9-
<Version>1.0.6</Version>
9+
<Version>1.0.7</Version>
1010
<Copyright>2025 Stainless Designer LLC</Copyright>
1111
</PropertyGroup>
1212

@@ -23,6 +23,7 @@
2323
<PackageReference Include="AvaloniaEdit.TextMate" Version="11.3.0" />
2424
<PackageReference Include="LibGit2Sharp" Version="0.31.0" />
2525
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
26+
<PackageReference Include="Tomlyn" Version="0.15.0" />
2627
</ItemGroup>
2728

2829
<ItemGroup>

SemanticDeveloper/SemanticDeveloper/Services/CodexConfigService.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,28 @@ public static string GetConfigTomlPath()
2626
}
2727
}
2828

29+
public static void EnsureConfigExists()
30+
{
31+
try
32+
{
33+
var path = GetConfigTomlPath();
34+
if (File.Exists(path))
35+
return;
36+
var dir = Path.GetDirectoryName(path);
37+
if (!string.IsNullOrWhiteSpace(dir))
38+
Directory.CreateDirectory(dir);
39+
// Seed a minimal config so opening the file works even on fresh installs.
40+
var seed = "# Codex CLI configuration generated by Semantic Developer" + Environment.NewLine +
41+
Environment.NewLine +
42+
"[mcp_servers]" + Environment.NewLine;
43+
File.WriteAllText(path, seed);
44+
}
45+
catch
46+
{
47+
// Best-effort safeguard — ignore failures so the caller can handle errors gracefully.
48+
}
49+
}
50+
2951
public static string GetPromptsDirectory()
3052
{
3153
try

SemanticDeveloper/SemanticDeveloper/Services/McpConfigService.cs

Lines changed: 0 additions & 44 deletions
This file was deleted.

SemanticDeveloper/SemanticDeveloper/Views/CliSettingsDialog.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
IsChecked="{Binding McpEnabled, Mode=TwoWay}"
7979
HorizontalAlignment="Stretch"
8080
Margin="0,0,24,0"/>
81-
<TextBlock Margin="0,4,24,6" Foreground="#888" FontSize="12" Text="Loads MCP servers from mcp_servers.json in your app data folder and passes them directly to Codex." TextWrapping="Wrap"/>
81+
<TextBlock Margin="0,4,24,6" Foreground="#888" FontSize="12" Text="Loads MCP servers from the Codex CLI config.toml ([mcp_servers]) so they flow straight into Codex sessions." TextWrapping="Wrap"/>
8282
<StackPanel IsEnabled="{Binding McpEnabled}">
8383
<CheckBox Content="Allow network access for tools (MCP, web fetches)"
8484
IsChecked="{Binding AllowNetworkAccess, Mode=TwoWay}"

0 commit comments

Comments
 (0)