genart.dev

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 genart key 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 genart entry is deleted. If the servers map becomes empty, the container key is removed too. The file itself is never deleted.

Supported agents

AgentConfig fileFormatConnectionSetup guide
Claude Code~/.claude.jsonJSONNative HTTPGuide
Codex CLI~/.codex/config.tomlTOMLmcp-remote bridgeGuide
Gemini CLI~/.gemini/settings.jsonJSONmcp-remote bridgeGuide
OpenCode~/.config/opencode/opencode.jsonJSONNative HTTPGuide
Kiro~/.kiro/settings/mcp.jsonJSONNative HTTPGuide

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

  1. Open the desktop app
  2. Open the Connect Modal (Cmd+Shift+C)
  3. Switch to the Local tab
  4. 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

ScenarioBehavior
App crashes without cleanupStale config entries are harmless — the local port is no longer listening, so agents fail gracefully
Multiple desktop app instancesBoth instances write the same genart key. The first to quit removes it; the second overwrites on next apply
Config file has other MCP serversThey are preserved. Only the genart entry is modified
Malformed config fileThe error is reported inline in the Connect Modal. The file is not overwritten
Permission deniedThe error is shown next to the agent toggle in the Connect Modal
TOML commentsComments in config.toml are lost on roundtrip (limitation of TOML serialization)