CLI Agent Integration
Auto-configure CLI agents to connect to the genart.dev desktop app
CLI Agent Integration
The genart.dev desktop app can automatically configure CLI-based AI agents to connect to its local MCP sidecar server. Config entries are written on startup and removed on quit.
How it works
When the desktop app launches, it writes a genart entry into each enabled agent's config file. The entry points to the local MCP sidecar at http://localhost:<port>/mcp. On quit, the entry is removed.
- Merge, not overwrite — only the
genartkey is added or removed. Existing config entries are preserved. - Creates missing files — if the config file or parent directory doesn't exist, they are created automatically.
- Clean removal — on quit, only the
genartentry is deleted. If the servers map becomes empty, the container key is removed too. The file itself is never deleted.
Supported agents
| Agent | Config file | Format | Connection | Setup guide |
|---|---|---|---|---|
| Claude Code | ~/.claude.json | JSON | Native HTTP | Guide |
| Codex CLI | ~/.codex/config.toml | TOML | mcp-remote bridge | Guide |
| Gemini CLI | ~/.gemini/settings.json | JSON | mcp-remote bridge | Guide |
| OpenCode | ~/.config/opencode/opencode.json | JSON | Native HTTP | Guide |
| Kiro | ~/.kiro/settings/mcp.json | JSON | Native HTTP | Guide |
Agents that support Streamable HTTP natively (Claude Code, OpenCode, Kiro) connect directly. Codex CLI and Gemini CLI use mcp-remote as a stdio-to-HTTP bridge, installed automatically via npx.
Toggling agents
- Open the desktop app
- Open the Connect Modal (
Cmd+Shift+C) - Switch to the Local tab
- Under Connected Agents, toggle agents on or off
Claude Code is enabled by default. Other agents are disabled until toggled on.
When you enable an agent, its config file is updated immediately. When you disable it, the genart entry is removed.
Config examples
The desktop app writes the following entries automatically. These examples show what each agent's config file looks like after auto-configuration (assuming the sidecar is running on port 52045).
Claude Code
{
"mcpServers": {
"genart": {
"type": "http",
"url": "http://localhost:52045/mcp"
}
}
}Codex CLI
[mcp_servers.genart]
command = "npx"
args = ["-y", "mcp-remote", "http://localhost:52045/mcp", "--transport", "streamable-http"]Gemini CLI
{
"mcpServers": {
"genart": {
"command": "npx",
"args": ["-y", "mcp-remote", "http://localhost:52045/mcp", "--transport", "streamable-http"]
}
}
}OpenCode
{
"mcp": {
"genart": {
"type": "remote",
"url": "http://localhost:52045/mcp"
}
}
}Kiro
{
"mcpServers": {
"genart": {
"url": "http://localhost:52045/mcp"
}
}
}Manual configuration
If you prefer to configure agents manually (or need to point to a different port), add the appropriate entry from the examples above to the agent's config file. Replace 52045 with the actual port shown in the desktop app status bar.
For remote MCP setup (without the desktop app), see the individual agent pages linked above.
Edge cases
| Scenario | Behavior |
|---|---|
| App crashes without cleanup | Stale config entries are harmless — the local port is no longer listening, so agents fail gracefully |
| Multiple desktop app instances | Both instances write the same genart key. The first to quit removes it; the second overwrites on next apply |
| Config file has other MCP servers | They are preserved. Only the genart entry is modified |
| Malformed config file | The error is reported inline in the Connect Modal. The file is not overwritten |
| Permission denied | The error is shown next to the agent toggle in the Connect Modal |
| TOML comments | Comments in config.toml are lost on roundtrip (limitation of TOML serialization) |