Skip to content

Connect an agent

Opcodex is a tool your AI agents can use. A connected agent can read any open program and, if you allow it, rename functions, set comments and run analysis. It uses the same engine and the same operations as the app. Every change is recorded and can be undone.

Agents connect locally. The agent app starts opcodex mcp, which talks to the engine on your computer over stdio. Opcodex itself sends nothing to the internet. A cloud-hosted model behind your agent app may receive what the agent reads, so check your agent’s own data settings.

You can also chat with a model without leaving the app. Select Agent chat on the rail, or press Ctrl+J. A panel opens on the right.

  1. Choose a provider at the top of the panel: Claude, OpenAI or Local model.
  2. For Claude or OpenAI, add your own API key under Settings → AI models. The panel has an Open AI models settings button.
  3. Type a question about the open program, or pick a suggestion such as Explain what this function does. Press Enter to send; Shift+Enter starts a new line.

The line under the provider shows the model name and the open program.

Local model uses any server with an OpenAI-compatible API on this computer, such as Ollama or LM Studio. Its address must be on this computer (127.0.0.1 or localhost); Opcodex refuses any other host.

The assistant uses Opcodex’s own operations as tools: it lists functions, decompiles, follows references, reads strings, renames, comments, debugs and runs scripts. Each tool call appears in the conversation; select it to see its input and result.

  • Reads run straight away.
  • Changes and scripts follow the open project’s approval policy. When the policy asks, a card shows the operation and its input, with Approve and Decline.
  • Changes are recorded in history and can be undone like any other change.
  • The assistant takes up to 20 steps per message, then stops and says so. Ask it to continue if you want more.
  • Stop (the button that replaces Send) ends the current answer. New chat clears the conversation.

Before the first chat with Claude or OpenAI, Opcodex asks for consent. The card says that your messages, and the code and analysis the assistant reads, go to Anthropic or OpenAI. Nothing is sent until you select Allow for Claude or Allow for OpenAI. Use a local model switches to the local provider instead. To withdraw consent, select Withdraw under Settings → AI models.

The agent chat needs the desktop app. The browser preview of the interface can’t reach model providers.

Select Agents on the rail.

  1. Under Agent apps on this computer, Opcodex lists the apps it can register with and whether each is installed.
  2. Select Connect next to an app. Opcodex adds itself as an MCP server in that app’s configuration.
  3. Restart the agent app.

The status shows Connected, Not connected, Not installed, or Points to another copy when the app is registered with a different Opcodex installation. Disconnect removes the registration. Check again refreshes the list.

For Claude Code, Codex CLI and Gemini CLI, a connected row has a terminal button that opens the agent in the built-in terminal.

The rest of the page:

  • What agents may change: the approval policy for the open project. See Approval policy & history.
  • Recent agent activity: changes made by agents and the command line in the open program, with Undo this change.
  • Tools agents get: each operation an agent can call, marked reads or changes.
  • Other agents and harnesses: an MCP configuration to copy into any client that speaks MCP over stdio.

opcodex setup does the same registration from a shell. In the built-in terminal, opcodex is already on PATH. Elsewhere, use the full path, %LOCALAPPDATA%\Programs\Opcodex\Application\app\support\opcodex.exe.

Terminal window
opcodex setup --dry-run
opcodex setup --only claude-code,codex
opcodex setup --uninstall --only cursor
OptionEffect
--only ID,IDLimit setup to these agent apps. Without it, setup covers every installed app.
--dry-runShow which files would change, and change nothing.
--yesApply without asking. Required when the input is not a terminal.
--uninstallRemove the Opcodex registration instead of adding it.

Setup prints its plan and asks Apply these changes? [y/N]. Before it edits a file, it saves a copy beside it with the suffix .opcodex-backup. It refuses to touch a configuration that already has an opcodex server it did not add.

IDAppFile it edits
claude-codeClaude Code%USERPROFILE%\.claude.json
claude-desktopClaude Desktop%APPDATA%\Claude\claude_desktop_config.json
cursorCursor%USERPROFILE%\.cursor\mcp.json
vscodeVS Code%APPDATA%\Code\User\mcp.json
windsurfWindsurf%USERPROFILE%\.codeium\windsurf\mcp_config.json
geminiGemini CLI%USERPROFILE%\.gemini\settings.json
codexCodex CLI%USERPROFILE%\.codex\config.toml

Restart the agent app after setup. Check the result with opcodex doctor --format text.

With a program open in Opcodex, ask your agent something like:

List the functions in the open program that call connect, decompile the largest one and suggest a name for it.

The agent starts with program_list, then uses tools such as program_functions_list, code_decompile and xrefs_to. If it renames something, the change appears in the Inspector’s History and on the Agents page.

Next: MCP clients for manual configuration, or the CLI reference.