Skip to content

AI Integration in MDOpen for VS Code

MDOpen for VS Code includes an embedded MCP server (Model Context Protocol) that lets AI assistants answer questions about your IBM i application. You ask in plain words, and the assistant answers from MDiQ through your active MDOpen connection: counts, lists, where-used, call charts, source and more.

Beta

The AI integration is in beta. The assistant only reads and opens views: it changes nothing on the IBM i. The only repository actions it can take are switching, creating and copying a repository, and you are always asked to confirm first. It cannot delete or build a repository.

Supported AI Clients

The extension registers an MCP server called mdopen and installs its AI skills, so the tools are available in any folder you open.

  • GitHub Copilot in VS Code
  • Cursor Agent
  • Claude Code and the Claude desktop app
  • Codex

Getting Started

  1. Install or update the MDOpen extension and reload the window.
  2. Connect MDOpen to MDiQ as usual and select a repository. The assistant works against the selected repository unless you name another one.
  3. Open your AI client and ask: "which MDOpen tools do you have?". You should see tools such as mdiq_list, mdiq_where_used, mdiq_source, mdiq_ile_chart and the open_... view tools.

Tools not showing?

Run MDIQ: Refresh MCP from the command palette, then restart your AI client. For Codex, run MDIQ: Configure Codex MCP.

Where the Answer Goes

The words you use decide where the answer appears. A format word ("as JSON", "to a file") always wins over the verb.

A question (how many, which, who, is there) or give me X The answer in chat. Nothing opens.
Show / open / list / display, a diagram, metrics An MDOpen view opens. The chat gets one line.
... as JSON or in the editor A VS Code editor tab with the JSON.
... to a file or save as a file A file on disk. The chat gives you its path.
show me the call chart of X The MDOpen call chart view.
ILE chart of X or give me the call chart of X An interactive page in a VS Code tab (tree and flowchart, click to expand).
the call chart of X as a flowchart A flowchart in chat, with a short explanation.
get me the source of X A read-only editor tab with the source member.
export / save / extract with no format word The assistant asks once: JSON in an editor tab, or a file.

Note

When a list has more than about 50 rows, you get the count, ten names and one question: open the view, JSON in an editor tab, or save a file. When a request is unclear, the assistant asks one question with at most four options instead of guessing.

Commands

To be sure where the answer goes, start your message with a command. The command decides the result, whatever the wording.

/md-show Opens an MDOpen view /md-show RPGLE programs
/md-list Rows in chat /md-list programs that call CUST
/md-json JSON in an editor tab /md-json service programs of library MDVISDEM
/md-find-object What the object is, in chat /md-find-object CUST
/md-dependency What a program uses, grouped by kind /md-dependency CUST
/md-impact What a change to an object affects /md-impact CUSTDATA
/md-ile-chart The interactive ILE chart page /md-ile-chart CUST
/md-report-bad-answer A report file of the conversation (see below) /md-report-bad-answer

Example Prompts

Example

  • how many RPGLE programs are there?
  • who uses CUSTDATA?
  • show me the RPGLE programs
  • give me the program list as JSON
  • write the physical files of library MDVISDEM to a file
  • ILE chart of CUST
  • how many programs in SKU_VISDEM? (another repository, no switch needed)

Working with Another Repository

A question, a count or JSON for another repository works without switching. Opening a view for another repository asks you to Confirm / Cancel the switch first, because switching closes the open panels of the current repository.

Report a Bad Answer

Help us improve the assistant

When an answer is wrong, slow or opens the wrong thing, say "report this" in the same chat, or run MDIQ: Report a bad answer (AI) from the command palette.

A file is written to ~/Documents/mdopen-feedback/ with every tool call of the session and your note. Object, library and repository names are replaced and secrets are removed. Nothing is sent automatically: review the file and send it to Midrange Dynamics support.

Settings

These settings are found under MDOpen in the VS Code settings.

mdopen-86.mcp.enabled Enables the embedded MDOpen MCP server for AI clients. Default true.
mdopen-86.mcp.port Fixed localhost port of the MCP server. Default 6286.
mdopen-86.mcp.syncOnFolderOpen Re-syncs the Claude Code, Codex and workspace MCP configuration when a folder is opened. Default true.
mdopen-86.mcp.autoOpenAgentWorkspace When no folder is open, opens ~/mdopen-agent so Claude Code and Codex have a project. Default false.
mdopen-86.mcp.workspaceSkills Also writes the MDOpen AI skills into the open workspace folder (excluded from git). Default false.
mdopen-86.mcp.callLog Keeps a local log of MCP tool calls, used by Report a bad answer. Kept for 7 days, never sent anywhere. Default true.

Related commands in the command palette: MDIQ: Refresh MCP, MDIQ: Configure Codex MCP, MDIQ: Copy Claude Code MCP setup command and MDIQ: Remove AI agent files.

Known Limitations

Warning

  • The ILE chart does not show procedure-to-procedure calls, and the interactive page opens at 4 levels and 60 nodes.
  • Fields and variables have no where-used data: the where-used view opens instead.
  • Explain Code on a large program can take longer than the wait; the assistant says it is still running.
  • A _ in a name matches any single character, so CUST_ also finds CUST2.
  • Which tool is picked depends on the AI model, so wrong picks can happen. Please report them.