Files
Marc Schier be50f02700 Add additional companion spec MCP tool profiles (#4731)
# Description

Expose existing stack APIs through **337 additional domain MCP tools**:
114 industrial-companion tools, 35 WoT/xRegistry/document tools, and 188
higher-level stack-workflow tools. The fully enabled catalogue contains
**492 tools**; profile selection is not an execution grant.

The packages now follow the reviewed structure:
**`Opc.Ua.Mcp.Workflows`** contains roles/users, files, alarms and
history; **`Opc.Ua.Mcp.WotCon`** contains management/documents and
independently registered live WoT execution. GDS and schema tools remain
separate packages. The executable composes **18 libraries**.

| Workflow | Added domain tools | Profiles |
| --- | ---: | --- |
| GDS directory, certificates, reference-only credentials/tokens and
Part 21 onboarding | 46 | `gds`, `certificates`, `credentials`,
`onboarding` |
| Roles/users, regular and temporary files, alarms/conditions and
historical access | 74 | `roles`, `users`, `files`, `alarms`, `history`
|
| Bounded runtime types, XSD/BSD/UA JSON, PubSub and REST OpenAPI
artifacts | 6 | `schemas` |
| Named PubSub transports, remote configuration, declarative
adapters/bridges and SKS | 52 | `pubsub-runtime`,
`pubsub-configuration`, `pubsub-bridge`, `pubsub-security` |
| Live HTTP(S), MQTT, Modbus TCP and OPC UA WoT forms | 10 |
`wot-runtime` |

- Reuse typed clients, generated proxies, SDK transports, schema
providers and injected services rather than introducing another session
manager or protocol engine.
- Require host enablement plus exact caller/session/secret/network
grants. Protected generic Call/Write/node-management/history/file paths
enforce the same policy.
- Bind classifications, dispatches, file handles and historical cursors
to actual UA generations. Recovery cannot retarget an old handle or
authorized mutation. Preserve acknowledged results after late
cancellation; do not imply atomicity or retry business commands.
- Use opaque secret-store references, explicit writable-store
registration, issuer/resource/caller binding and reserved capacity
before issuance. Report remote success/local persistence failure as
partial completion; redact provider-controlled diagnostic text.
- Bound new named runtimes to eight per host, two per caller,
five-minute idle expiry and a thirty-minute absolute lease by default.
Pending/closing resources consume quota; failed cleanup remains visible.
Credential invalidation and session recovery close dependent runtimes.
- Keep document planning separate from execution, artifacts
root-confined and real JSON inputs typed. Preserve old profile ordinals
while widening the set to 64 bits. CI grades fully enabled privileged
catalogues rather than connection-only views.

**Limitations:** live Kafka remains explicitly unavailable because the
backend cannot enforce policy on broker-discovered connections;
configuration/schema/capability inspection stays available. The latest
public Dekaf v1.23.5 was also checked and its DNS injection remains
internal. No private-API workaround or bootstrap-only security claim was
added. Full legacy Core registration retains its documented
JSON-reflection limitation: native tests isolate its four connection
descriptors and validate the expanded production registrations, not
whole-host NativeAOT support.

## Related Issues

- Fixes #4730.

## Checklist

_Put an `x` in the boxes that apply. You can complete these step by step
after opening the PR._

- [ ] I have signed the
[CLA](https://opcfoundation.org/license/cla/ContributorLicenseAgreementv1.0.pdf)
and read the
[CONTRIBUTING](https://github.com/OPCFoundation/UA-.NETStandard/blob/master/CONTRIBUTING.md)
doc.
- [x] I have added tests that prove my fix is effective or that my
feature works and increased code coverage.
- [x] I have added all necessary documentation.
- [x] I have verified that my changes do not introduce (new) build or
analyzer warnings.
- [ ] I ran **all** tests locally using the **UA.slnx** solution against
at least .net **framework** and .net **10**, and all passed.
- [ ] I fixed **all** failing and flaky tests in the CI pipelines and
**all** CodeQL warnings.
- [x] I have addressed **all** PR feedback received.
2026-10-14 00:14:05 +02:00

127 lines
5.0 KiB
Markdown

# OPCFoundation.NetStandard.Opc.Ua.Mcp.Robotics
OPC UA Model Context Protocol (MCP) tools for Robot Intent controllers,
packaged so they can be embedded in any MCP server host rather than only run as
the shipped `opcua-mcp` tool.
Use this package when an application wants an LLM agent to discover Robot
Intent capabilities, read live controller state, submit explicit intents, and
manage missions through the OPC UA Robotics Client API.
## Tools
Discovery, live state and outstanding-work monitoring, direct-control tools for
authority/cancel/pause/resume/retry and one submit tool per intent kind, plus
mission submit/update/cancel, bounded operation/mission waits, and
`robotics_vision_pick`.
Every tool takes a controller selector (unique display name, BrowseName, or
NodeId). The selector is resolved once per call, and the controller's published
lookup tables are then used to resolve the frame, tool, location, output,
and program names named inside the request. Full NodeIds are always
accepted and validated by the server. Resolution is read-only: it never submits
work and never requests command authority.
Intent and mission inputs are typed MCP objects and arrays. There is no JSON
document encoded inside an `intentJson` or `stepsJson` string. Mission intent
`kind` is a closed discriminator, and exactly one matching payload is required.
Operation and mission list tools return filtered, cursor-paged summaries by
default; use Full detail only when the complete snapshots are needed.
`robotics_vision_pick` resolves a Vision pipeline on the same OPC UA session,
runs one detection inference, applies exact ID/class and confidence filters,
then submits either one Pick or a two-step Pick/Place mission. It returns the
selected detection provenance and the authoritative operation or mission
handles:
```json
{
"request": {
"controller": "BinPickingController",
"pipeline": "BinPickingPipeline",
"source": "Bin",
"tool": "ParallelGripper",
"destination": "Fixture",
"classLabel": "RedCube",
"minimumConfidence": 0.9,
"missionId": "place-red-cube"
}
}
```
Refusals are returned with the server's exact `IntentFailureEnum` and message;
the MCP layer does not retry, request authority implicitly, or reinterpret
server decisions.
## Intent, mission and result contracts
For example, a Pick tool request uses native JSON objects:
```json
{
"controller": "BinPickingController",
"input": {
"intentId": "pick-red",
"source": "Bin",
"tool": "ParallelGripper",
"objectClass": "RedCube"
}
}
```
Controller selectors accept an exact, unambiguous published name or NodeId.
Tool/frame/location/output/program selectors resolve against the snapshot read
for that call. Ambiguity is an error; resolution never takes authority or
submits exploratory work.
Mission `steps` and `transitions` are typed arrays. Each step requires a closed
`kind` discriminator and exactly one matching payload. A supplied IntentId is
preserved; one is generated only when omitted. Results retain the
`StepId -> IntentId -> operation NodeId -> state` correlation.
`robotics_wait_mission` takes the mission operation returned by submission,
not a lookup through mutable active state.
List summaries omit poses and complete output payloads; request Full detail
only for the page that needs it. Wait timeouts return `completed=false` and
a refreshed snapshot rather than claiming failure of the operation.
Vision-guided selection first applies exact DetectionId/ClassLabel filters and
the confidence threshold, then orders by confidence, ordinal DetectionId and
original result order. Results retain pipeline, sensor, model, frame and
detection provenance, the selected pose and submission handles. The call does
not wait for, cancel or retry the submitted work.
For tool behavior and the explicit-authority workflow, see the
[Robot Intent catalogue](https://github.com/OPCFoundation/UA-.NETStandard/blob/master/docs/McpServer.md#robot-intent-tools).
## Usage
```csharp
builder.Services.AddOpcUaMcpCore();
builder.Services.AddOpcUaMcpRobotics();
builder.Services.AddMcpServer()
.WithStdioServerTransport()
.WithOpcUaMcpFilters()
.WithOpcUaCoreTools(McpToolProfile.Robotics)
.WithOpcUaRoboticsTools(McpToolProfile.Robotics)
.WithTools<MyApplicationTools>();
```
A profile that does not select Robotics contributes no tools rather than
failing, so the same profile value can be passed to every OPC UA tool package a
host references.
## Related packages
| Package | Adds |
|---|---|
| `OPCFoundation.NetStandard.Opc.Ua.Mcp.Core` | Part 4 service tools, session management, filters (required) |
| `OPCFoundation.NetStandard.Opc.Ua.Robotics.Client` | Robot Intent discovery, state, authority, operation and mission client API |
| `OPCFoundation.NetStandard.Opc.Ua.Vision.Client` | same-session inference used by `robotics_vision_pick` |
| `OPCFoundation.NetStandard.Opc.Ua.Mcp` | the ready-to-run `opcua-mcp` server composing all OPC UA MCP tool packages |
## License
OPC Foundation MIT License 1.00 — <http://opcfoundation.org/License/MIT/1.00/>