13. AI assistant: the documentation MCP server #
An AI assistant (Claude Code, Claude Desktop, Cursor, VS Code…) that writes PowerScript for PBToolboxAI does not know the library: it guesses method names, arguments, events — and gets them wrong with confidence. The documentation MCP server gives it the exact API of your version: it looks it up instead of making it up, and checks the code it proposes to you.
13.1 What it is #
- An MCP server (Model Context Protocol, the open protocol through which an AI assistant calls tools), started by the assistant itself.
- Free, with no licence: it only serves the public documentation, bundled with it. It works offline and neither reads nor sends anything from your machine.
- One documentation version per library version: the server shipped with 4.0 describes 4.0.
13.2 Installing it #
It ships in the demo package, in the mcp\ folder: the server (server\server.js), the documentation it serves (index\) and a README.md. Nothing to download, nothing else to install but Node.js 18 or later (nodejs.org) — node --version tells you yours.
Unzip the package, then keep the mcp\ folder where it will stay — for example C:\PBToolboxAI\mcp\, the path used in the examples below: the assistant's configuration names the full path of server\server.js.
13.3 Declaring it to your assistant #
Everywhere, the command is node and its argument the full path of server\server.js. In a JSON file, every backslash of the path is doubled.
Claude Code — one command line. The options come before the server name; --scope user makes it available in all your projects (without it, only in the current one):
claude mcp add --scope user pbtoolboxai-docs -- node C:\PBToolboxAI\mcp\server\server.js
A path with spaces goes between double quotes:
claude mcp add --scope user pbtoolboxai-docs -- node "C:\Program Files\PBToolboxAI\mcp\server\server.js"
Or, for the whole team of a project, the .mcp.json file at its root (what claude mcp add --scope project writes) — Claude Desktop and Cursor take the same content:
{
"mcpServers": {
"pbtoolboxai-docs": {
"command": "node",
"args": ["C:\\PBToolboxAI\\mcp\\server\\server.js"]
}
}
}
- Claude Desktop: Settings › Developer › Edit Config opens
claude_desktop_config.json(%APPDATA%\Claude\on Windows). Save, then quit Claude Desktop completely and start it again. - Cursor:
.cursor/mcp.jsonat the root of the project, or~/.cursor/mcp.jsonfor all your projects.
VS Code — .vscode/mcp.json in the project, or the MCP: Open User Configuration command for all your workspaces; the key is servers and the type stdio:
{
"servers": {
"pbtoolboxai-docs": {
"type": "stdio",
"command": "node",
"args": ["C:\\PBToolboxAI\\mcp\\server\\server.js"]
}
}
}
13.4 The tools #
The assistant picks the tool that answers its question by itself:
| Tool | What it answers |
|---|---|
list_components | The components: class, visual or not, version introduced, free or paid, rubric |
get_component | A component's whole API: properties, methods, events, constants, item handles, inherited members; dll gives the external functions of the DLL to declare |
get_member | One member: exact signature and overloads, return codes, description, an example, what changed from one version to the next; also the exact declaration of a PBT_* function |
get_topic | A general page or one of its sections in full: installation, themes, rich text markup, language, licence… |
search | A free-text search over the whole documentation, ranked results |
get_examples | A component's complete PowerScript examples |
check_code | Checks PowerScript: unknown method or property, an of_set_*/of_get_* invented in place of a property, unknown event or one written with its former arguments, wrong number of arguments, removed member, a handle asked to build, wrong /*name*/ annotation, old vocabulary, event argument that does not exist, the code an add returns taken for a handle or called like an object |
get_migration | The migration guides, from each version to the next (the latest by default), for one component or for all |
13.5 Getting the most from it #
- Ask the assistant to run its code through
check_codebefore proposing it. check_codefully judges an object whose type is declared in the excerpt (u_pbt_ribbon uo_ribbon); without a declaration, it only judges the name and the number of arguments.- After updating the library, update the server too — replace the
mcp\folder with the one of the new demo package: it describes the version it was shipped with.