{
  "markdown": "# node-opcua-modeler-mcp-server\n\n[![npm version](https://img.shields.io/npm/v/node-opcua-modeler-mcp-server.svg)](https://www.npmjs.com/package/node-opcua-modeler-mcp-server)\n[![npm downloads/month](https://img.shields.io/npm/dm/node-opcua-modeler-mcp-server.svg)](https://www.npmjs.com/package/node-opcua-modeler-mcp-server)\n[![npm downloads total](https://img.shields.io/npm/dt/node-opcua-modeler-mcp-server.svg)](https://www.npmjs.com/package/node-opcua-modeler-mcp-server)\n[![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)\n[![MCP](https://img.shields.io/badge/MCP-compatible-purple.svg)](https://modelcontextprotocol.io)\n\nAn [MCP server](https://modelcontextprotocol.io) that gives AI agents access to the **OPC UA companion specification type system** — 589 types across 22 industrial namespaces, plus 1,533 engineering units — and lets agents **validate, generate, reverse-engineer, and create** OPC UA information models.\n\nBuilt on [node-opcua](https://github.com/node-opcua/node-opcua), the most widely used OPC UA stack for Node.js.\n\n## Why?\n\nWhen an AI agent needs to build an OPC UA information model, it must know:\n- What **companion spec types** exist (DI, Machinery, Robotics, Machine Tools…)\n- What **components, properties, and methods** each type has\n- What **namespace dependencies** are required\n- What **engineering unit symbols** are valid (UNECE Rec. 20)\n\nThis MCP server answers all of those questions — **offline, for free, in milliseconds**.\n\n## Quick Start\n\n### With Claude Desktop\n\nAdd to your `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"opcua-modeler\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"node-opcua-modeler-mcp-server\"],\n      \"env\": {\n        \"OPCUA_MODELER_API_KEY\": \"stfv_your_api_key_here\"\n      }\n    }\n  }\n}\n```\n\n> **Note:** The API key is optional for discovery tools (offline) and `opcua_model_validate` (50 anonymous calls/day). It is required for `opcua_model_generate`, `opcua_model_reverse`, and `opcua_model_create`. Register at [opcua-modeler.sterfive.io](https://opcua-modeler.sterfive.io/signup) and create a key under **Settings → API** — the free tier gives 25 calls/day for 90 days; see [pricing](https://opcua-modeler.sterfive.io/pricing) for paid plans.\n\n### With any MCP client\n\n```bash\nnpx node-opcua-modeler-mcp-server\n```\n\nThe server communicates over **stdio** using the [Model Context Protocol](https://modelcontextprotocol.io).\n\n### Using a local backend instead of the hosted API\n\nIf you run the OPC UA Modeler CLI on the same machine, the model tools can be\nserved from it instead of the hosted API — your YAML never leaves the host.\n\nStart the server (requires a licence that includes the `serve` entitlement):\n\n```bash\nopcua-modeler serve\n```\n\nThen set one environment variable in your MCP client config:\n\n```json\n{\n  \"mcpServers\": {\n    \"opcua-modeler\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"node-opcua-modeler-mcp-server\"],\n      \"env\": {\n        \"OPCUA_MODELER_BACKEND\": \"local\"\n      }\n    }\n  }\n}\n```\n\nNo API key is needed in this mode — the client discovers the local endpoint and\nits credentials automatically.\n\n| Variable | Values | Purpose |\n|----------|--------|---------|\n| `OPCUA_MODELER_BACKEND` | `cloud` (default), `local` | Which backend serves the model tools |\n| `OPCUA_MODELER_API_KEY` | `stfv_…` | API key, `cloud` backend only |\n| `OPCUA_MODELER_API_URL` | URL | Override the hosted API base URL |\n\n**Notes**\n\n- The two backends are never mixed, and there is no fallback between them. If\n  `local` is selected and no server is running, the call fails with instructions\n  rather than silently sending your model to the hosted API.\n- The seven discovery tools are local to this package and work offline on either\n  setting.\n- `opcua_model_create` (AI generation) is available on the `cloud` backend only.\n\n## Tools\n\n### `list_namespaces`\n\nList all 25 OPC UA companion spec namespaces with aliases, URIs, and dependencies.\n\n```\n→ list_namespaces()\n← [\n    { \"alias\": \"di\", \"name\": \"OPC UA for Devices\", \"uri\": \"http://opcfoundation.org/UA/DI/\", \"dependencies\": [] },\n    { \"alias\": \"robotics\", \"name\": \"OPC UA for Robotics\", \"uri\": \"http://opcfoundation.org/UA/Robotics/\", \"dependencies\": [\"di\", \"ia\"] },\n    ...\n  ]\n```\n\n### `resolve_dependencies`\n\nResolve the full dependency chain for companion spec aliases. Returns a topologically sorted list for the YAML `namespaces:` block.\n\n```\n→ resolve_dependencies({ aliases: [\"machineTool\"] })\n← [\"di\", \"ia\", \"machinery\", \"isa95JobControl\", \"machineryJobs\", \"machineTool\"]\n```\n\n### `list_types`\n\nList all ObjectTypes and VariableTypes defined in a companion spec namespace.\n\n```\n→ list_types({ alias: \"robotics\" })\n← [\n    { \"browseName\": \"MotionDeviceType\", \"kind\": \"ObjectType\", \"subtypeOf\": \"di:ComponentType\", ... },\n    { \"browseName\": \"AxisType\", \"kind\": \"ObjectType\", \"subtypeOf\": \"di:ComponentType\", ... },\n    ...\n  ]   // 25 types\n```\n\n### `get_type_details`\n\nGet the full structure of a type — components, properties, methods, interfaces, including inherited members.\n\n```\n→ get_type_details({ alias: \"robotics\", browseName: \"MotionDeviceType\" })\n← {\n    \"browseName\": \"MotionDeviceType\",\n    \"kind\": \"ObjectType\",\n    \"subtypeOf\": \"di:ComponentType\",\n    \"interfaces\": [\"di:IVendorNameplateType\", \"di:ITagNameplateType\"],\n    \"components\": [\n      { \"browseName\": \"robotics:Axes\", \"nodeClass\": \"Object\", \"typeDefinition\": \"FolderType\", \"modellingRule\": \"Mandatory\" },\n      { \"browseName\": \"robotics:PowerTrains\", \"nodeClass\": \"Object\", \"typeDefinition\": \"FolderType\", \"modellingRule\": \"Mandatory\" },\n      ...\n    ],\n    \"properties\": [\n      { \"browseName\": \"di:Manufacturer\", \"dataType\": \"LocalizedText\", \"modellingRule\": \"Mandatory\" },\n      { \"browseName\": \"robotics:MotionDeviceCategory\", \"dataType\": \"MotionDeviceCategoryEnumeration\", \"modellingRule\": \"Mandatory\" },\n      ...\n    ]\n  }\n```\n\n### `search_types`\n\nSearch for types across **all** companion specs by keyword.\n\n```\n→ search_types({ query: \"temperature\" })\n← [\n    { \"alias\": \"glass\", \"browseName\": \"MotorTemperatureTooHighEventType\", ... },\n    { \"alias\": \"padim\", \"browseName\": \"TemperatureMeasurementVariableType\", ... },\n    { \"alias\": \"amb\", \"browseName\": \"OverTemperatureConditionClassType\", ... }\n  ]\n```\n\n### `find_engineering_unit`\n\nFind the official UNECE Rec. 20 engineering unit symbol. Supports fuzzy matching and natural language aliases.\n\n```\n→ find_engineering_unit({ query: \"celsius\" })\n← { \"symbol\": \"°C\", \"matchType\": \"alias\", \"confidence\": 1 }\n\n→ find_engineering_unit({ query: \"revolutions per minute\" })\n← { \"symbol\": \"r/min\", \"matchType\": \"alias\", \"confidence\": 1 }\n\n→ find_engineering_unit({ query: \"bar\" })\n← { \"symbol\": \"bar\", \"matchType\": \"exact\", \"confidence\": 1 }\n```\n\n### `opcua_model_validate` ☁️\n\nValidate an OPC UA YAML model for correctness. Returns diagnostics with severity, codes, messages, and line numbers. Works without an API key (limited to 5 calls/day).\n\n```\n→ opcua_model_validate({ yaml: \"namespaces:\\n  di:\\n...\" })\n← {\n    \"valid\": true,\n    \"diagnostics\": [\n      { \"severity\": \"warning\", \"code\": \"W001\", \"message\": \"...\", \"line\": 42 }\n    ]\n  }\n```\n\n### `opcua_model_generate` ☁️\n\nGenerate OPC UA NodeSet2.xml and Symbols.CSV from a validated YAML model. Returns base64-encoded artifacts. Requires an API key.\n\n```\n→ opcua_model_generate({ yaml: \"namespaces:\\n  di:\\n...\", include_docs: false })\n← {\n    \"valid\": true,\n    \"artifacts\": {\n      \"nodeset2_xml\": \"PD94bWwg...\",\n      \"symbols_csv\": \"bmFtZSxu...\"\n    },\n    \"diagnostics\": []\n  }\n```\n\n### `opcua_model_reverse` ☁️\n\nReverse-engineer a NodeSet2.xml file back into the YAML DSL format. Requires an API key.\n\n```\n→ opcua_model_reverse({ xml: \"<?xml version=...\" })\n← {\n    \"yaml\": \"namespaces:\\n  di:\\n...\",\n    \"diagnostics\": []\n  }\n```\n\n### `opcua_model_create` ☁️\n\nGenerate an OPC UA YAML model from a natural language description using AI. The AI will auto-detect relevant companion specs, generate a validated model with documentation, and auto-correct validation errors. Requires an API key.\n\n```\n→ opcua_model_create({ prompt: \"A robotic welding cell with two robot arms, each having 6 axes, temperature monitoring on each motor\" })\n← {\n    \"success\": true,\n    \"yaml\": \"namespaces:\\n  di:\\n  robotics:\\n...\",\n    \"attempts\": 2,\n    \"diagnostics\": [],\n    \"model\": \"gemini-2.5-pro\",\n    \"tokens\": { \"input\": 4200, \"output\": 1800 }\n  }\n\n→ opcua_model_create({ prompt: \"A CNC lathe with spindle speed and temperature\", forceSpecs: [\"di\", \"cnc\"] })\n← {\n    \"success\": true,\n    \"yaml\": \"namespaces:\\n  di:\\n  cnc:\\n...\",\n    \"attempts\": 1,\n    \"diagnostics\": [],\n    \"model\": \"gemini-2.5-pro\",\n    \"tokens\": { \"input\": 3500, \"output\": 1200 }\n  }\n```\n\n## Coverage\n\n### Companion Specifications (25)\n\n| Alias | Specification | Types |\n|-------|--------------|-------|\n| `padim` | OPC UA for PA-DIM | 101 |\n| `ijtBase` | OPC UA for IJT Base | 65 |\n| `machineTool` | OPC UA for Machine Tools | 63 |\n| `di` | OPC UA for Devices | 44 |\n| `glass` | OPC UA for Glass Manufacturing | 36 |\n| `machineVision` | OPC UA for Machine Vision | 36 |\n| `adi` | OPC UA for Analyzer Devices | 35 |\n| `commercialKitchenEquipment` | OPC UA for Commercial Kitchen Equipment | 35 |\n| `robotics` | OPC UA for Robotics | 25 |\n| `ia` | OPC UA for Industrial Automation | 20 |\n| `amb` | OPC UA for AMB | 18 |\n| `autoId` | OPC UA for AutoID | 18 |\n| `metalForming` | OPC UA for Metal Forming | 16 |\n| `machinery` | OPC UA for Machinery | 15 |\n| `gds` | OPC UA GDS | 14 |\n| `woodworking` | OPC UA for Woodworking | 13 |\n| `cnc` | OPC UA for CNC Systems | 12 |\n| | *…and 5 more* | |\n| **Total** | **22 namespaces** | **589 types** |\n\n### Engineering Units\n\n1,533 official UNECE Rec. 20 symbols plus 134 natural language aliases (e.g., \"celsius\" → °C, \"revolutions per minute\" → r/min). Every alias resolves to a symbol the modeler engine accepts — the lookup never invents one.\n\n## How It Works\n\nThe server ships with a pre-generated `catalog.json` containing all type information extracted from OPC Foundation's official NodeSet2.xml files via [node-opcua](https://github.com/node-opcua/node-opcua). All queries are answered from this static catalog — **no network required, no API key needed**.\n\n```\n┌──────────────────────────────────────────────────┐\n│  node-opcua-modeler-mcp-server                   │\n│                                                  │\n│  LOCAL TOOLS (offline, free)                      │\n│  ┌────────────────────────────────────────┐       │\n│  │ catalog.json (1.7 MB)                  │       │\n│  │ • 25 companion spec registries         │       │\n│  │ • 589 type summaries + details         │       │\n│  │ • 1,533 engineering units              │       │\n│  └────────────────────────────────────────┘       │\n│  6 tools → query the catalog                     │\n│                                                  │\n│  CLOUD TOOLS (via api.opcua-modeler.sterfive.io) │\n│  4 tools → validate / generate / reverse / create│\n│                                                  │\n│  stdio transport (JSON-RPC)                      │\n└──────────────────────────────────────────────────┘\n```\n\n## Use Cases\n\n- **AI-assisted OPC UA modeling** — agents can discover types, resolve dependencies, and validate unit symbols before generating YAML/XML models\n- **Copilot integration** — add OPC UA awareness to coding assistants\n- **Industrial digital twin design** — explore companion spec type hierarchies interactively\n- **Learning OPC UA** — ask an AI to explain types and their relationships\n\n## Requirements\n\n- Node.js ≥ 18\n\n## Related\n\n- [OPC UA Modeler — web app](https://opcua-modeler.sterfive.io) — Create, validate, and generate OPC UA information models in the browser\n- [Product page](https://www.sterfive.com/product/opcua-modeler) — OPC UA Modeler overview, features, and licensing\n- [Documentation](https://opcua-modeler.doc.sterfive.com) — Guides, YAML DSL reference, and how-tos\n- [Specification reference](https://opcua-modeler.doc.sterfive.com/specification/spec.html) — Rendered OPC UA information-model specification\n- [node-opcua](https://github.com/node-opcua/node-opcua) — Full OPC UA stack for Node.js\n- [Model Context Protocol](https://modelcontextprotocol.io) — Open protocol for AI tool integration\n\n## Licensing\n\nThree layers, stated once:\n\n| What | Licence |\n|------|---------|\n| **This package** (`node-opcua-modeler-mcp-server`, the MCP client and its catalog) | [Apache License 2.0](./LICENSE) from version 1.5.0 — see [NOTICE](./NOTICE) for trademark and third-party notices. Versions 1.0–1.4.x were published under MIT and remain so. |\n| **The hosted OPC UA Modeler API** (`opcua-modeler.sterfive.io/api/v1`) that the cloud backend calls | [Sterfive API Terms of Use](https://opcua-modeler.sterfive.io/terms) — anonymous discovery, free and paid plans. |\n| **The OPC UA Modeler CLI and `opcua-modeler serve`** (the local backend) | Sterfive commercial licence — see the [product page](https://www.sterfive.com/product/opcua-modeler). |\n\n\"OPC UA Modeler\" and \"Sterfive\" are trademarks of Sterfive SAS; the Apache\nlicence grants no rights to them. Contributions are accepted under the\n[Developer Certificate of Origin](./CONTRIBUTING.md).\n\n© [Sterfive SAS](https://www.sterfive.com)\n",
  "bytes": 13339,
  "sha": "680b69ed2866af86b2cab95930c0368185579f6d444874372f3c8aa3b88116fa",
  "repo_slug": "node-opcua/node-opcua-modeler-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_node_opcua_node_opcua_modeler__72b6bbe9/readme"
}