Using the HelpNDoc MCP server with the Codex extension for Visual Studio Code
HelpNDoc includes a Model Context Protocol (MCP) server that lets the Codex IDE extension access HelpNDoc tools and work with the project currently open in HelpNDoc.
Prerequisites
The Codex IDE extension must be installed locally in Visual Studio Code on the same Windows computer as HelpNDoc.
Download and install the extension by following OpenAI's official instructions: Install the Codex IDE extension
After installing the extension:
- Open Visual Studio Code.
- Click the Codex icon in the Activity Bar.
- Sign in with your ChatGPT account.
When the Codex icon is not visible, open the Visual Studio Code Command Palette and run:
Codex: Open Codex Sidebar
Configure the HelpNDoc MCP server port
The HelpNDoc MCP server uses port 8933 by default.
To review or change the port:
- In HelpNDoc, select "File", then "Options".
- Select "Artificial Intelligence (AI)".
- Locate the "MCP Server" section.
- Enter the required port number in the "Port" field.
- Confirm the changes.
The port configured in Codex must match the port configured in HelpNDoc.
Start the HelpNDoc MCP server
Before connecting from Codex:
- Open the "Tools" ribbon tab in HelpNDoc.
- Locate the "Services" group.
- Click "Start MCP server".
Once the server is running, the command changes to "Stop MCP server". Click it to stop the server manually.
The MCP server also stops automatically when HelpNDoc is closed.
Register HelpNDoc in the Codex extension
Keep HelpNDoc running with its MCP server started.
To add the server from the Codex extension:
- Open the Codex sidebar in Visual Studio Code.
- Open the gear menu.
- Select "Codex settings"
- Select "MCP servers".
- Click "Add server".
- Enter HelpNDoc as the server name.
- Select "Streamable HTTP" as the server type.
- Enter the following server URL: http://localhost:8933/mcp
- Save the server.
- Click "Restart extension".
When another port is configured in HelpNDoc, replace 8933 with that port number.
Alternative setup using the Codex CLI
The HelpNDoc server can also be registered from a Windows terminal. See: Using the HelpNDoc MCP server with Codex
Check the server connection
Open the Codex sidebar, then open the gear menu and select "MCP servers".
The HelpNDoc server should appear in the list and be enabled.
When the server cannot connect, verify that:
- HelpNDoc is running.
- "Start MCP server" has been clicked.
- The HelpNDoc and Codex port numbers match.
- The server URL ends with /mcp.
- Visual Studio Code and HelpNDoc are running on the same computer.
- A firewall or security application is not blocking the local connection.
Inspect the available HelpNDoc tools
Open a chat in the Codex sidebar and ask:
List the tools available from the HelpNDoc MCP server and briefly explain what each tool does.
You can also ask Codex to verify the connection:
Confirm that the HelpNDoc MCP server is connected and report the tools it provides.
Codex discovers MCP tools and selects them according to the current task. A tool might only be loaded when it becomes relevant to the request.
Use HelpNDoc from the Codex extension
Keep the HelpNDoc project open and the MCP server running.
In Visual Studio Code, open the Codex sidebar and start a new chat. Use natural-language instructions that clearly mention HelpNDoc and the operation to perform.
For example:
- Use the HelpNDoc MCP server to describe the currently open HelpNDoc project and list its topics.
- Use HelpNDoc to find the topic named "Getting Started".
- Use HelpNDoc to create a new topic named "Installation".
- Review the structure of the open HelpNDoc project and suggest improvements. Do not modify the project.
- Update the selected HelpNDoc topic using the following content: ...
- Find all HelpNDoc topics that mention installation requirements and summarize them.
Codex selects and calls the appropriate HelpNDoc tools. Depending on the configured approval policy, Codex might ask for permission before running a tool or modifying the project.
For safer operation, first ask Codex to inspect the project and explain its proposed changes. After reviewing the proposal, explicitly authorize it to make the changes.
Help Codex select the correct server
When several MCP servers are configured, explicitly mention HelpNDoc in the request.
For example:
Use the HelpNDoc MCP server, not another documentation tool, to list the topics in the currently open project.
You can also add instructions to an AGENTS.md file in the Visual Studio Code workspace:
When a request concerns the HelpNDoc project, use the HelpNDoc MCP server. Inspect the project before making changes, and do not modify it unless the request explicitly asks for modifications.
This can help Codex consistently select the HelpNDoc tools while working in that workspace.
Stop the HelpNDoc MCP server
When the integration is no longer needed:
- Return to HelpNDoc.
- Open the "Tools" ribbon tab.
- Locate the "Services" group.
- Click "Stop MCP server".
The server also stops automatically when HelpNDoc is closed.