Use the docs from AI tools
pdcomm-docs is a command-line tool that searches and reads the PDComm documentation. The same program also runs as a Model Context Protocol (MCP) server, so AI coding tools such as Claude Code and Cursor can look up the guides and the API reference while they answer your questions.
pdcomm-docs reads a local copy of the search index, so it works without an internet connection.
Before you begin
Section titled “Before you begin”Download the offline docs bundle and extract it to a folder of your choice. The bundle has this layout:
pdcomm-docs/├── bin/│ └── pdcomm-docs pdcomm-docs.exe on Windows└── site/ the offline documentation site (index.html is the docs home) └── search-index.json the index that the CLI and MCP server readbin/pdcomm-docs finds site/search-index.json in its own bundle. If you move the program somewhere else, pass the index file with --index.
To check the installation, print the version:
pdcomm-docs --versionThe examples on this page assume that you extracted the bundle to /opt/pdcomm-docs. On Windows, use your actual path, such as C:\PDComm\pdcomm-docs.
Search the docs from the command line
Section titled “Search the docs from the command line”The search command lists the most relevant sections first, with their title, URL, and a snippet:
pdcomm-docs search "holding registers" --product modbuspdcomm-docs search 보유 레지스터 읽기A query that contains Hangul searches the Korean pages; any other query searches the English pages. To choose the language yourself, add --lang en or --lang ko. To make one language the default, set the PDCOMM_DOCS_LANG environment variable to en or ko.
To read a result as Markdown, pass its URL or ID to get. If the URL ends with a # fragment, you get that section and its subsections only.
pdcomm-docs get /docs/en/modbus/quickstart/pdcomm-docs get /docs/en/modbus/quickstart/ --lang koThese are the commands you use most:
| Command | What it does |
|---|---|
search <query> |
Searches the docs. Narrow the results with --product, --lang, and --limit. |
get <url-or-id> |
Prints a page or section as Markdown. Use --lang to open the other language. |
api <name-or-glob> |
Shows the signature, parameters, and return value of C, C++, and .NET symbols. Supports * and ? wildcards. |
list |
Lists the pages and sections of each product in sidebar order. |
serve |
Serves the offline docs site on your computer. |
mcp |
Runs the MCP server. Your AI tool starts this command. |
Add --json to search, get, api, or list to get JSON output for scripts:
pdcomm-docs api 'pdcomm_modbus_*' --surface cpdcomm-docs list --product modbus --jsonFor every option, output format, and exit code, see the pdcomm-docs command reference.
Open the offline docs site
Section titled “Open the offline docs site”The serve command serves the bundle’s site/ folder on a web server that only your computer can reach. Add --open to open it in your browser:
pdcomm-docs serve --openThe default address is http://127.0.0.1:8787/. If that port is in use, pick another one with --port. To stop the server, press Ctrl+C in the terminal.
Connect the MCP server to your AI tool
Section titled “Connect the MCP server to your AI tool”The MCP server provides the following tools. All of them only read the docs; they never change files or devices.
| Tool | What it does |
|---|---|
docs_search |
Searches the docs in English or Korean and returns URLs with snippets. |
docs_get_page |
Returns a page or section as Markdown, in parts for long pages. |
docs_api_lookup |
Finds API symbols by name or wildcard and returns their signatures and descriptions. |
docs_list_sections |
Returns the pages and sections of each product. |
The server also exposes every page as a resource, such as pdcomm-docs://en/docs/modbus/quickstart.
Register the server from your terminal:
claude mcp add --transport stdio pdcomm-docs -- /opt/pdcomm-docs/bin/pdcomm-docs mcpBy default, the server is available only to you in the current project (local scope). Add --scope user to use it in every project, or --scope project to record it in the repository’s .mcp.json and share it with your team. You can also edit .mcp.json yourself:
{ "mcpServers": { "pdcomm-docs": { "type": "stdio", "command": "/opt/pdcomm-docs/bin/pdcomm-docs", "args": ["mcp"], "env": { "PDCOMM_DOCS_LANG": "en" } } }}To check the connection, run claude mcp list, or enter /mcp in a session.
Add the server to ~/.cursor/mcp.json to use it in every project, or to .cursor/mcp.json in a project to use it there only:
{ "mcpServers": { "pdcomm-docs": { "type": "stdio", "command": "/opt/pdcomm-docs/bin/pdcomm-docs", "args": ["mcp"], "env": { "PDCOMM_DOCS_LANG": "en" } } }}Then make sure that pdcomm-docs is turned on in the MCP section of the Cursor settings.
Any MCP client that supports the stdio transport can connect. The command is pdcomm-docs and the argument is mcp. Most clients use this format:
{ "mcpServers": { "pdcomm-docs": { "command": "/opt/pdcomm-docs/bin/pdcomm-docs", "args": ["mcp", "--index", "/opt/pdcomm-docs/site/search-index.json"] } }}You need --index only if you moved the program out of the bundle. The server exchanges newline-delimited JSON-RPC messages over standard input and output, and supports protocol versions 2025-11-25, 2025-06-18, 2025-03-26, and 2024-11-05.
On Windows, double the backslashes in JSON paths, for example "command": "C:\\PDComm\\pdcomm-docs\\bin\\pdcomm-docs.exe".
After you connect the server, ask your AI tool a question such as “How do I connect to a server in the PDComm Modbus quickstart?” The tool calls docs_search and docs_get_page and bases its answer on the docs.
Use the latest online index
Section titled “Use the latest online index”With --remote, pdcomm-docs downloads the current index from the public site instead of the bundled copy. This option runs your system’s curl and accepts HTTPS addresses only, except for plain HTTP on localhost.
pdcomm-docs search session --remote https://pdcomm.podosoft.io/docs/search-index.jsonpdcomm-docs picks the index in this order:
--index <file>--remote <url>search-index.jsonin the--root <folder>- The
PDCOMM_DOCS_INDEXenvironment variable site/search-index.jsonin the bundle next to the program
Command-line options take precedence over the environment variable.
Troubleshooting
Section titled “Troubleshooting”You get a no search index found error.
The program isn’t in the bin/ folder of a bundle. Pass search-index.json with --index, or set the PDCOMM_DOCS_INDEX environment variable.
Your AI tool can’t connect to the server.
Check that command in the configuration is the absolute path of the executable. Run pdcomm-docs search test in a terminal to see the error message. The MCP server writes only protocol messages to standard output and sends errors to standard error.
Results come back in the other language.
Add --lang, or add PDCOMM_DOCS_LANG to env in the MCP configuration.