Plugins and the SDK

Use FRX Image Viewer to inspect and extract recovered form graphics, or develop a custom plugin through the shared SDK.

VB/DE Decompiler MCP Server 2.1.0

Connect an MCP client to a project already open in VB Decompiler or DE Decompiler. The plugin exposes modules, forms and procedures through the host's plugin SDK. It supports reading recovered listings without running the analyzed program.

Download MCP Server 2.1.0 for x86 hosts · Delphi source code

Requirements

Use VB Decompiler or DE Decompiler for Windows with native DLL plugin support.

The archive contains a Windows x86 plugin. Match the DLL to the architecture of the decompiler that loads it. A 32-bit host can still analyze 64-bit files where its own feature set supports them.

The available tools depend on the host version, edition and open project. On older SDKs, some code reads use the existing decompilation cache and some workspace operations are unavailable. This plugin uses tool names beginning with vb_. If you replaced another implementation, reload the tool list in your client.

Install and start

  1. Close the decompiler. Extract the archive and copy vbmcp.dll into the plugins subfolder of the decompiler installation. If the C version is already installed, replace its DLL instead of keeping both.
  2. Start the decompiler and open a sample you are authorized to analyze. Choose Plugins → VB/DE Decompiler MCP Server.
  3. Select Enable MCP server for this session and click OK. Copy the endpoint shown in the dialog.
MCP Server settings in DE Decompiler, showing the local endpoint and client selector
The settings window displays the name of the decompiler that loaded the plugin.

Connect an MCP client

Use Streamable HTTP. The default endpoint is http://127.0.0.1:3023/mcp. If you run both decompilers with the server enabled, assign a separate port to each and use the endpoint shown in its dialog.

Codex

codex mcp add vbmcp --url http://127.0.0.1:3023/mcp

Claude Code

claude mcp add --transport http vbmcp http://127.0.0.1:3023/mcp

VS Code

In VS Code, merge this entry into .vscode/mcp.json or use MCP: Add Server and choose HTTP.

{
  "servers": {
    "vbmcp": {
      "type": "http",
      "url": "http://127.0.0.1:3023/mcp"
    }
  }
}

Client configuration references · Codex · Claude Code · VS Code

Check the connection

Open a sample that contains forms. Ask the client to list up to five forms using the read-only tool vb_list_forms with limit set to 5. If the client cannot connect, check that the server is enabled in the current session and that the endpoint matches the dialog.

MCP tools and examples

The 32 tools below are reported by tools/list in MCP Server 2.1.0. The list contains input schemas. Whether a call succeeds depends on the callbacks and data available in the host, its edition and the open project.

For a read-only review, start with vb_get_project_info. Use vb_list_forms followed by vb_get_form for form text, or vb_list_modules → vb_list_module_functions → vb_get_function for a procedure.

Project structure and resources

vb_get_project_info
Returns the open file, compiler, is_native, is_packed, vbmcp_path, product_name and sdk_extended.Arguments · None
vb_get_project_text
Returns the project text held by the decompiler in project_text. It can be large.Arguments · None
vb_list_forms
Lists form names in forms, with pagination. Positions correspond to zero-based form_index values.Arguments · limit (integer = 100), offset (integer = 0)
vb_get_form
Returns the form index, its name in form_name, and recovered property text in form_text. If the host supplies no name, form_name is an empty string.Arguments · form_index (integer)
vb_list_modules
Lists units and classes recovered in the Code tree. Optional query matches the entry name or its Pascal unit name. Use module_entries for the original module_index values. Requires the extended SDK.Arguments · limit (integer = 100), offset (integer = 0), query (string)
vb_get_module
Returns the module name, its declarations and string references.Arguments · module_index (integer)
vb_list_module_functions
Lists procedures in the selected module. Optional query matches a name fragment. Each entry retains its original index for vb_get_function.Arguments · module_index (integer), limit (integer = 100), offset (integer = 0), query (string)
vb_list_frx_icons
Lists images registered by the host. Each icons entry contains offset and size. Image bytes are unavailable through this call.Arguments · limit (integer = 100), offset (integer = 0)

Code and the active view

vb_search_module_code
Searches function bodies within one module for a literal substring. Returns one snippet per function with its index, address and line number. Default mode uses stored code. Set decode to true to request on-demand decompilation via the extended SDK.Arguments · module_index (integer), query (string), offset (integer = 0), limit (integer = 8), decode (Boolean = false)
vb_get_function
Returns the procedure’s name, address, code, string references and cached disassembly. The result depends on the host SDK and the available analysis data.Arguments · module_index (integer), function_index (integer)
vb_find_function_by_va
Finds a procedure by full hexadecimal virtual address. Use match_index, starting at 0, if several procedures share the address. A match includes module_index and function_index. Requires the extended SDK.Arguments · address (string), match_index (integer)
vb_get_sub_main
Returns the code for Sub Main on projects that expose this entry point.Arguments · None
vb_get_active_text
Returns text from the active code editor.Arguments · None
vb_get_active_disasm_text
Returns text from the active disassembly editor.Arguments · None
vb_get_active_coords
Returns the active view’s module and procedure indices in coordinates.Arguments · None
vb_get_displayed_item
Returns the displayed item in item as TREE1;kind;module;function;form. A value of -1 means an index does not apply. Requires the extended SDK.Arguments · None
vb_get_function_mark
Reads the Boolean marked state of a visible procedure in the tree. Requires the extended SDK.Arguments · module_index (integer), function_index (integer)

Navigation and status

vb_goto_line
Moves the caret in the active editor. Line and column numbers start at 1.Arguments · line (integer), column (integer = 1)
vb_set_status
Sets the message in the decompiler’s status bar.Arguments · text (string)

Changes to the workspace

Require approval in the MCP client before invoking these commands. They can change or discard recovered material in the working session.

vb_set_project_text
Replaces the complete project text held by the decompiler.Arguments · project_text (string)
vb_set_form
Replaces the recovered property text of a form.Arguments · form_index (integer), form_text (string)
vb_rename_form
Renames a form. Native projects require the extended SDK.Arguments · form_index (integer), new_name (string)
vb_set_module
Replaces a module’s declarations.Arguments · module_index (integer), declarations (string)
vb_set_function
Replaces the recovered code of a procedure in the project.Arguments · module_index (integer), function_index (integer), code (string)
vb_rename_function
Renames a procedure. Native projects require the extended SDK.Arguments · module_index (integer), function_index (integer), new_name (string)
vb_set_sub_main
Replaces the recovered Sub Main code on projects that expose this entry point.Arguments · code (string)
vb_set_active_text
Replaces text in the active code editor.Arguments · text (string)
vb_set_active_disasm_text
Replaces text in the active disassembly editor.Arguments · text (string)
vb_set_function_mark
Sets or clears the tree mark for a visible procedure. Requires the extended SDK.Arguments · module_index (integer), function_index (integer), marked (Boolean)
vb_set_options
Changes the stack-parameter and procedure-analyzer settings, then refreshes the view. Values are strings "0" or "1". Omitted options retain their previous values.Arguments · stack_check (string), analyzer_check (string)
vb_update_all
Refreshes the host’s project tree to reflect the current model.Arguments · None
vb_clear_buffers
Clears the decompiler’s internal buffers and discards the current decompilation results.Arguments · None

SDK and data limits

  • Open a project in the decompiler before reading it. Commands address the host’s current project. Use explicit indices from the relevant list. Project item indices start at 0.
  • Pagination starts at offset 0 with a default limit of 100. The plugin caps pages at 10,000 entries. Use has_more and next_offset to continue. The position in a paginated form or module list is its offset plus the item’s position on that page.
  • Extended SDK callbacks enable displayed-item lookup, module counting, lookup by full virtual address, function marks and native renaming. The host can still reject an individual call. A mark requires a procedure visible in the tree.
  • Function reads can use the cache or an on-demand SDK read. On older SDKs, code_fast and the full virtual address may be unavailable, and disassembly may fail if that callback is missing. An empty listing may also mean the host has yet to analyze that item.
  • Pass a virtual address to vb_find_function_by_va as a string in hexadecimal. vb_get_function returns virtual_address, when available, as a decimal string. Keep addresses as strings to preserve full 64-bit values.
  • SDK calls execute on the GUI thread. Prefer small pages and individual procedure reads for large projects. Text passed to setters must be representable in the host’s ANSI code page.

Find chart code and inspect thread synchronization

For VCLTee.TeCanvas, start with vb_list_modules and a short query such as TeCanvas. Use the returned module_index. A unit can have multiple class entries. If available library classes are missing, enable Show VCL classes in the host and analyze the file again.

Search both the application’s worker or event-handler modules and the chart classes. Use vb_search_module_code with a separate term such as Synchronize, Queue, or EnterCriticalSection, then review the call and its execution path with vb_get_function. A text match can also occur in a declaration, comment, or string.

Follow next_offset while has_more is true, even after an empty page. total_count counts underlying slots. In code search, unavailable_count reports bodies without readable code. With decode: true, each page inspects up to eight functions and may stop earlier between functions.

Find a Delphi unit by its qualified name

Request

{
  "jsonrpc": "2.0",
  "id": 11,
  "method": "tools/call",
  "params": {
    "name": "vb_list_modules",
    "arguments": {
      "query": "vcltee.tecanvas",
      "offset": 256,
      "limit": 1
    }
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": 11,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"module_entries\":[{\"module_index\":281,\"name\":\"TChartCanvas\",\"unit_name\":\"VCLTee.TeCanvas\"}],\"modules\":[\"TChartCanvas\"],\"count\":1,\"total_count\":283,\"offset\":256,\"limit\":1,\"has_more\":true,\"next_offset\":282}"
      }
    ],
    "isError": false
  }
}
Search a procedure body for a thread-related call

Request

{
  "jsonrpc": "2.0",
  "id": 12,
  "method": "tools/call",
  "params": {
    "name": "vb_search_module_code",
    "arguments": {
      "module_index": 281,
      "query": "thread.queue",
      "decode": true,
      "limit": 32
    }
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": 12,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"matches\":[{\"function_index\":0,\"name\":\"QueueRefresh\",\"address\":\"4198400\",\"line_number\":2,\"snippet\":\"  TThread.Queue(nil, RefreshChart);\"}],\"module_index\":281,\"source\":\"decompiled\",\"scanned_count\":5,\"unavailable_count\":0,\"count\":1,\"total_count\":5,\"offset\":0,\"limit\":8,\"has_more\":false,\"next_offset\":-1}"
      }
    ],
    "isError": false
  }
}

JSON-RPC requests and responses

After initializing the Streamable HTTP connection, use POST /mcp with Content-Type: application/json and Accept: application/json, text/event-stream. The examples show responses from a test project.

Check result.isError and parse result.content[0].text as JSON. On failure that JSON contains error. Malformed requests can also produce a top-level JSON-RPC error.

List one form

Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "vb_list_forms",
    "arguments": {
      "limit": 1,
      "offset": 1
    }
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"forms\":[\"Form_日本\"],\"count\":1,\"total_count\":2,\"offset\":1,\"limit\":1,\"has_more\":false,\"next_offset\":-1}"
      }
    ],
    "isError": false
  }
}
Read a form’s name and properties

Request

{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "vb_get_form",
    "arguments": {
      "form_index": 1
    }
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"form_index\":1,\"form_name\":\"Form_日本\",\"form_text\":\"Begin VB.Form Form1\\r\\nEnd\"}"
      }
    ],
    "isError": false
  }
}
List one procedure in module 0

Request

{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "name": "vb_list_module_functions",
    "arguments": {
      "module_index": 0,
      "limit": 1,
      "offset": 0
    }
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"module_index\":0,\"functions\":[{\"index\":0,\"name\":\"Proc_0_0\",\"address\":\"4198400\"}],\"count\":1,\"total_count\":1,\"offset\":0,\"limit\":1,\"has_more\":false,\"next_offset\":-1}"
      }
    ],
    "isError": false
  }
}
Example of an invalid page size

Request

{
  "jsonrpc": "2.0",
  "id": 4,
  "method": "tools/call",
  "params": {
    "name": "vb_list_forms",
    "arguments": {
      "limit": 0
    }
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": 4,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"error\":\"Argument is below its minimum: limit\"}"
      }
    ],
    "isError": true
  }
}

Local access and project changes

The listener binds to 127.0.0.1 and has no user authentication. A local application that reaches it can read project data or request changes to the current decompiler workspace, including edits to listings and function marks. Keep write approvals enabled in the client. To stop the server, clear Enable MCP server for this session and click OK. The server starts disabled each time the decompiler launches.

The plugin communicates locally. Your MCP client may send returned code or metadata to its model provider, depending on how the client is configured.

Developed in Delphi by Sergey Chubchenko (DotFix Software). The original MCP plugin provided the starting point. Distributed under the MIT License.

FRX Image Viewer

FRX Image Viewer 1.2.0 previews and extracts images registered by VB Decompiler or DE Decompiler. VB Decompiler supplies VB5/6 and .NET form graphics; DE Decompiler supplies binary DFM graphics from supported VCL applications written in Delphi or built with C++Builder. Supported picture formats are BMP, PNG, JPEG, GIF, ICO and CUR.

Installation and opening

  1. Copy FRXViewer.dll to the host installation's plugins subdirectory and restart the decompiler. The DLL architecture must match the host application, regardless of the analyzed file's architecture.
  2. Open the executable or DLL and decode its forms so that the host registers the available images.
  3. Select Plugins > FRX Image Viewer, then choose a thumbnail to inspect the image.

The 1.2.0 download contains a DLL for an x86 host. Use a matching build for an x64 host. The plugin requires Windows 10/11; its source repository includes build instructions.

Preview and export

The gallery and preview show available images, including compound ICO/CUR files. The status area identifies the selected item, dimensions, size or source-bitmap offset, and format. The viewer follows the host theme and supports dark mode.

Choose Save to file to export the selected item. Standalone pictures retain their original bytes and format. Individual ImageList cells are exported as ICO files with their masks and alpha transparency; these ICO files are derived from the source bitmap sheets.

FRX Image Viewer in DE Decompiler, displaying Delphi DFM graphics and individual ImageList icons.
FRX Image Viewer in DE Decompiler, displaying Delphi DFM graphics and individual ImageList icons.

Native VCL ImageLists and compatibility

With a compatible host, recognized native VCL ImageLists appear as individual icons. Separately encoded pictures in collection items remain separate ordinary images. Unsupported streams retain whole-picture handling where the original image entries are available.

Shared SDK revision 26.6, supported by VB Decompiler 26.6 and DE Decompiler 26.6, adds optional GetFrxImageListInfo (63) and GetProductName (64). Older hosts retain the original picture API and whole-image behavior. See the SDK reference for capability detection and offset rules.

Viewing and extraction do not execute the inspected file or load its components. Animated GIFs display their first frame. The available assets depend on images successfully decoded and registered by the host.

The Plugins menu is the entry point for installed native DLL plugins. The shared callback interface exposes supported project information and code to custom extensions. Available DLL plugins are initialized at startup; build for the intended host architecture and Windows environment.

Developing a plugin

The SDK includes examples for Visual C++, Rust, Delphi and Free Pascal. Use its exported entry points and host callback to implement the operations required by your workflow.

You can also ask an AI coding agent to implement a plugin. Provide the SDK and API reference link and a description of the required behavior, then review, build and test the resulting DLL against DE Decompiler and representative input files.

Compatibility of the interface

Use the documented SDK calling convention, exported entry points and data representations. Shared API identifiers keep their existing names, including the VBDecompilerPlugin prefix; changing the product name in an exported symbol would change the ABI.

Sharing the interface does not make every VB Decompiler plugin suitable for DE Decompiler data. Check the expected object types, recovered code language and operations available for the current selection.

Developer reference

See the Plugin API reference on the product website. It describes exported entry points, command identifiers, callback data and buffer requirements. The SDK provides active-view and project-level code access; operations that search every decompiled procedure need the corresponding listings to be available. Code-query callbacks can process individual procedures when the matching input is available.

Displayed items, function marks and addresses

Plugins can query the displayed form, unit, class or procedure with GetDisplayedTreeItem (65), read or change a function mark with GetModuleFunctionMark (66) and SetModuleFunctionMark (67), and locate functions by virtual address with FindModuleFunctionByVA (68). GetModuleFunctionVA (69) returns the full virtual address, including 64-bit addresses. Existing callback signatures and command numbers remain compatible.