OPC UA companion spec types, namespace dependencies, and engineering units for AI agents
The io.github.node-opcua/node-opcua-modeler-mcp-server is an MCP server for AI agents that provides OPC UA companion specification types, namespace dependencies, and engineering units. It focuses on model-related metadata needed to interpret or construct OPC UA information reliably.
π οΈ Key Features
OPC UA companion spec types
Namespace dependencies
Engineering units
Exposes 12 tools via MCP
π Use Cases
Supplying AI agents with OPC UA model type information
Resolving or documenting namespace dependencies
Providing engineering-unit context for OPC UA data
β‘ Developer Benefits
Centralizes OPC UA modeler data (types, namespaces, units) for agent workflows
Tool-based access for integrating these elements into MCP clients
β οΈ Limitations
Scope is limited to companion spec types, namespace dependencies, and engineering units based on available documentation
Given one or more companion spec namespace aliases, returns the full resolved dependency list that MUST go in the YAML `namespaces:` section. Always call this before generating the namespaces block.
Parameters1
aliases
array
required
Companion spec aliases to resolve (e.g. ["machineTool", "robotics"])
List all well-known OPC UA companion spec namespace aliases with their full names, URIs, and dependencies. Use this to discover what namespaces are available.
List ALL ObjectTypes, VariableTypes, and InterfaceTypes defined in a specific companion spec namespace. ALWAYS call this before using any type from a namespace β NEVER guess type names.
Parameters1
alias
string
required
Companion spec alias (e.g. "machinery", "di", "robotics")
Get detailed information about a specific type: its components, properties, methods, interfaces, and optional members. Use this to understand a type's structure before creating instances or subtypes.
Parameters2
alias
string
required
Companion spec alias where the type is defined (e.g. "machinery")
browseName
string
required
The type browse name (e.g. "MachineryItemIdentificationType")
Raw schema
{
"type": "object",
"properties": {
"alias": {
"type": "string",
"description": "Companion spec alias where the type is defined (e.g. \"machinery\")"
},
"browseName": {
"type": "string",
"description": "The type browse name (e.g. \"MachineryItemIdentificationType\")"
}
},
"required": [
"alias",
"browseName"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}
search_types
Search for types across ALL companion specs by keyword. Use this when you don't know which namespace defines a type. Returns matching types with their namespace alias.
Find reusable Interfaces / AddIns by capability β pass a member name or keyword (e.g. "SerialNumber", "DeviceHealth", "Location") and get the standard blocks that already expose it. PREFER applying/composing an existing block over redefining its members inline. Interfaces are applied with `interfaces:`; addins (types with a DefaultInstanceBrowseName) are composed with `addIns:`. A single property β use the Interface; a whole named sub-object β use the AddIn.
Parameters1
query
string
required
Member name or capability keyword (e.g. "SerialNumber", "health", "calibration")
Find the official UNECE Rec. 20 engineering unit symbol for a given description. ALWAYS call this before using any engineering unit β NEVER guess unit symbols.
Parameters1
query
string
required
Description or common name of the unit (e.g. "revolutions per minute", "celsius", "pressure bar")
Raw schema
{
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "Description or common name of the unit (e.g. \"revolutions per minute\", \"celsius\", \"pressure bar\")"
}
},
"required": [
"query"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}
get_dsl_reference
Get the grammar reference for the OPC UA modeler YAML DSL: file header, top-level sections, name-prefix conventions, minimal examples, and common mistakes. Call this FIRST before writing any YAML model by hand. Works without an API key.
Validate an OPC UA YAML model for correctness. Returns diagnostics with severity (error/warning/info), codes, messages, and line numbers. Works without an API key (limited to 50 calls/day). ALWAYS validate before generating.
Parameters1
yaml
string
required
The full YAML model source to validate
Raw schema
{
"type": "object",
"properties": {
"yaml": {
"type": "string",
"description": "The full YAML model source to validate"
}
},
"required": [
"yaml"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}
opcua_model_generate
Generate OPC UA NodeSet2.xml and Symbols.CSV from a YAML model. Requires an API key (set OPCUA_MODELER_API_KEY env var). Returns base64-encoded artifacts if the model is valid, or diagnostics if validation fails. Optionally set include_docs=true to also generate markdown documentation.
Parameters2
yaml
string
required
The full YAML model source to generate from
include_docs
boolean
optional
Set to true to include markdown documentation (slower)
Raw schema
{
"type": "object",
"properties": {
"yaml": {
"type": "string",
"description": "The full YAML model source to generate from"
},
"include_docs": {
"type": "boolean",
"description": "Set to true to include markdown documentation (slower)"
}
},
"required": [
"yaml"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}
opcua_model_reverse
Reverse-engineer a NodeSet2.xml file back into the YAML DSL format. Requires an API key (set OPCUA_MODELER_API_KEY env var). Optionally specify the target namespace URI to extract.
Parameters2
xml
string
required
The NodeSet2.xml content to reverse-engineer
namespace_uri
string
optional
Target namespace URI to extract (auto-detected if omitted)
Raw schema
{
"type": "object",
"properties": {
"xml": {
"type": "string",
"description": "The NodeSet2.xml content to reverse-engineer"
},
"namespace_uri": {
"type": "string",
"description": "Target namespace URI to extract (auto-detected if omitted)"
}
},
"required": [
"xml"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}
opcua_model_create
Generate an OPC UA YAML model from a natural language description using AI. Requires an API key (set OPCUA_MODELER_API_KEY env var). The AI will auto-detect relevant companion specs, generate a validated model with documentation, and auto-correct validation errors.
Parameters2
prompt
string
required
Natural language description of the OPC UA model to generate
forceSpecs
array
optional
Companion spec aliases to force (e.g. ["di", "ia"])
Raw schema
{
"type": "object",
"properties": {
"prompt": {
"type": "string",
"description": "Natural language description of the OPC UA model to generate"
},
"forceSpecs": {
"type": "array",
"items": {
"type": "string"
},
"description": "Companion spec aliases to force (e.g. [\"di\", \"ia\"])"
}
},
"required": [
"prompt"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}
An MCP server that gives AI agents access to the OPC UA companion specification type system β 764 types across 30 industrial namespaces, plus 1,533 engineering units β and lets agents validate, generate, reverse-engineer, and create OPC UA information models.
Built on node-opcua, the most widely used OPC UA stack for Node.js.
Why?
When an AI agent needs to build an OPC UA information model, it must know:
What companion spec types exist (DI, Machinery, Robotics, Machine Toolsβ¦)
What components, properties, and methods each type has
What namespace dependencies are required
What engineering unit symbols are valid (UNECE Rec. 20)
This MCP server answers all of those questions β offline, for free, in milliseconds.
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 and create a key under Settings β API β the free tier gives 25 calls/day for 90 days; see pricing for paid plans.
If you run the OPC UA Modeler CLI on the same machine, the model tools can be
served from it instead of the hosted API β your YAML never leaves the host.
Start the server (requires a licence that includes the serve entitlement):
bash
opcua-modeler serve
Then set one environment variable in your MCP client config:
No API key is needed in this mode β the client discovers the local endpoint and
its credentials automatically.
Variable
Values
Purpose
OPCUA_MODELER_BACKEND
cloud (default), local
Which backend serves the model tools
OPCUA_MODELER_API_KEY
stfv_β¦
API key, cloud backend only
OPCUA_MODELER_API_URL
URL
Override the hosted API base URL
Notes
The two backends are never mixed, and there is no fallback between them. If
local is selected and no server is running, the call fails with instructions
rather than silently sending your model to the hosted API.
The seven discovery tools are local to this package and work offline on either
setting.
opcua_model_create (AI generation) is available on the cloud backend only.
Tools
list_namespaces
List all 30 OPC UA companion spec namespaces with aliases, URIs, and dependencies.
code
β list_namespaces()
β [
{ "alias": "di", "name": "OPC UA for Devices", "uri": "http://opcfoundation.org/UA/DI/", "dependencies": [] },
{ "alias": "robotics", "name": "OPC UA for Robotics", "uri": "http://opcfoundation.org/UA/Robotics/", "dependencies": ["di", "ia"] },
...
]
resolve_dependencies
Resolve the full dependency chain for companion spec aliases. Returns a topologically sorted list for the YAML namespaces: block.
Find reusable Interfaces and AddIns by capability β pass a member name or keyword
and get the standard blocks that already expose it. Prefer composing an existing
block over redefining its members by hand.
Fetch the YAML DSL grammar reference β the file header, top-level sections, type
and instance syntax, and a list of common mistakes. No API key required.
Served from the API rather than bundled into this package, so the reference an
agent reads always matches the validator that will judge its output.
Validate an OPC UA YAML model for correctness. Returns diagnostics with severity, codes, messages, and line numbers. Works without an API key (limited to 50 calls/day per IP).
Generate 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.
code
β opcua_model_create({ prompt: "A robotic welding cell with two robot arms, each having 6 axes, temperature monitoring on each motor" })
β {
"success": true,
"yaml": "namespaces:\n di:\n robotics:\n...",
"attempts": 2,
"diagnostics": [],
"model": "gemini-2.5-pro",
"tokens": { "input": 4200, "output": 1800 }
}
β opcua_model_create({ prompt: "A CNC lathe with spindle speed and temperature", forceSpecs: ["di", "cnc"] })
β {
"success": true,
"yaml": "namespaces:\n di:\n cnc:\n...",
"attempts": 1,
"diagnostics": [],
"model": "gemini-2.5-pro",
"tokens": { "input": 3500, "output": 1200 }
}
Coverage
Companion Specifications (30)
Alias
Specification
Types
padim
OPC UA for PA-DIM
101
ijtBase
OPC UA for IJT Base
65
machineTool
OPC UA for Machine Tools
63
scales
OPC UA for Scales
58
lads
OPC UA for Laboratory Devices
53
di
OPC UA for Devices
44
glass
OPC UA for Glass Manufacturing
36
machineVision
OPC UA for Machine Vision
36
adi
OPC UA for Analyzer Devices
35
commercialKitchenEquipment
OPC UA for Commercial Kitchen Equipment
35
i4aas
OPC UA for I4AAS
32
robotics
OPC UA for Robotics
25
ia
OPC UA for Industrial Automation
20
amb
OPC UA for AMB
18
autoId
OPC UA for AutoID
18
iolink
OPC UA for IO-Link
16
metalForming
OPC UA for Metal Forming
16
β¦and 12 more
Total
29 namespaces with types
764 types
The registry holds 28 specs; irdi is a dictionary-entry namespace and
defines no ObjectTypes or VariableTypes. These figures come from
catalog/catalog.json and are asserted against it by
test/catalog-coverage.test.ts, so they cannot drift silently.
Engineering Units
1,533 official UNECE Rec. 20 symbols plus 136 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.
How It Works
The server ships with a pre-generated catalog.json containing all type information extracted from OPC Foundation's official NodeSet2.xml files via node-opcua. All queries are answered from this static catalog β no network required, no API key needed.
AI-assisted OPC UA modeling β agents can discover types, resolve dependencies, and validate unit symbols before generating YAML/XML models
Copilot integration β add OPC UA awareness to coding assistants
Industrial digital twin design β explore companion spec type hierarchies interactively
Learning OPC UA β ask an AI to explain types and their relationships
Requirements
Node.js β₯ 18
Related
OPC UA Modeler on GitHub β the open YAML DSL specification, the JSON Schema and example models; the place for questions and issues about the language
This package (node-opcua-modeler-mcp-server, the MCP client and its catalog)
Apache License 2.0 from version 1.5.0 β see NOTICE for trademark and third-party notices. Versions 1.0β1.4.x were published under MIT and remain so.
The hosted OPC UA Modeler API (opcua-modeler.sterfive.io/api/v1) that the cloud backend calls
The OPC UA Modeler CLI and opcua-modeler serve (the local backend)
Sterfive commercial licence β see the product page.
"OPC UA Modeler" and "Sterfive" are trademarks of Sterfive SAS; the Apache
licence grants no rights to them. Contributions are accepted under the
Developer Certificate of Origin.