node-opcua-modeler-mcp-server 1.4.2 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -21
- package/NOTICE +21 -0
- package/README.md +15 -3
- package/dist/cloud.d.ts +22 -0
- package/dist/cloud.js +10 -1
- package/dist/cloud.js.map +1 -1
- package/dist/http.d.ts +25 -0
- package/dist/http.js +67 -0
- package/dist/http.js.map +1 -0
- package/dist/server.js +32 -1
- package/dist/server.js.map +1 -1
- package/package.json +17 -3
- package/server.json +8 -2
package/LICENSE
CHANGED
|
@@ -1,21 +1,202 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
OPC UA Modeler MCP Server
|
|
2
|
+
Copyright 2025-2026 Sterfive SAS
|
|
3
|
+
|
|
4
|
+
This product includes software developed by Sterfive SAS
|
|
5
|
+
(https://www.sterfive.com).
|
|
6
|
+
|
|
7
|
+
"OPC UA Modeler", "Sterfive" and the Sterfive logo are trademarks of
|
|
8
|
+
Sterfive SAS. The Apache License, Version 2.0 under which this software is
|
|
9
|
+
distributed grants no rights to use these trademarks (see Section 6 of the
|
|
10
|
+
licence). Forks and derivative works must not present themselves as the
|
|
11
|
+
official OPC UA Modeler MCP Server or as endorsed by Sterfive.
|
|
12
|
+
|
|
13
|
+
"OPC UA" is a trademark of the OPC Foundation. The catalog shipped with this
|
|
14
|
+
package is derived from companion-specification NodeSet2.xml files published
|
|
15
|
+
by the OPC Foundation and its joint working groups; the underlying
|
|
16
|
+
specifications remain the property of their respective owners.
|
|
17
|
+
|
|
18
|
+
The hosted OPC UA Modeler API (opcua-modeler.sterfive.io) that this client
|
|
19
|
+
talks to is a separate service governed by the Sterfive API Terms of Use, and
|
|
20
|
+
the OPC UA Modeler CLI / `opcua-modeler serve` are separate products governed
|
|
21
|
+
by the Sterfive commercial licence. Neither is covered by this licence.
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/node-opcua-modeler-mcp-server)
|
|
4
4
|
[](https://www.npmjs.com/package/node-opcua-modeler-mcp-server)
|
|
5
5
|
[](https://www.npmjs.com/package/node-opcua-modeler-mcp-server)
|
|
6
|
-
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
7
7
|
[](https://modelcontextprotocol.io)
|
|
8
8
|
|
|
9
9
|
An [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.
|
|
@@ -326,6 +326,18 @@ The server ships with a pre-generated `catalog.json` containing all type informa
|
|
|
326
326
|
- [node-opcua](https://github.com/node-opcua/node-opcua) — Full OPC UA stack for Node.js
|
|
327
327
|
- [Model Context Protocol](https://modelcontextprotocol.io) — Open protocol for AI tool integration
|
|
328
328
|
|
|
329
|
-
##
|
|
329
|
+
## Licensing
|
|
330
330
|
|
|
331
|
-
|
|
331
|
+
Three layers, stated once:
|
|
332
|
+
|
|
333
|
+
| What | Licence |
|
|
334
|
+
|------|---------|
|
|
335
|
+
| **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. |
|
|
336
|
+
| **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. |
|
|
337
|
+
| **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). |
|
|
338
|
+
|
|
339
|
+
"OPC UA Modeler" and "Sterfive" are trademarks of Sterfive SAS; the Apache
|
|
340
|
+
licence grants no rights to them. Contributions are accepted under the
|
|
341
|
+
[Developer Certificate of Origin](./CONTRIBUTING.md).
|
|
342
|
+
|
|
343
|
+
© [Sterfive SAS](https://www.sterfive.com)
|
package/dist/cloud.d.ts
CHANGED
|
@@ -26,6 +26,28 @@
|
|
|
26
26
|
* IMPORTANT: Never use console.log() — stdout is reserved for JSON-RPC.
|
|
27
27
|
* ==========================================================================
|
|
28
28
|
*/
|
|
29
|
+
/**
|
|
30
|
+
* Per-request overrides, used when this server is HOSTED inside the API it
|
|
31
|
+
* calls (the Streamable HTTP connector) rather than run on a user's machine.
|
|
32
|
+
*
|
|
33
|
+
* In that topology the process-wide env vars are wrong in two ways: the
|
|
34
|
+
* default base URL sends the call back out through the public hostname and
|
|
35
|
+
* the reverse proxy into the very same app, and the backend then sees the
|
|
36
|
+
* container as the client — so every connector user on earth would share one
|
|
37
|
+
* rate-limit bucket. Both are per-request facts, not process-wide ones, so
|
|
38
|
+
* they live in AsyncLocalStorage: concurrent requests each keep their own
|
|
39
|
+
* values, which a module-level variable could not do.
|
|
40
|
+
*
|
|
41
|
+
* Unset (the stdio/npx case) → env vars behave exactly as before.
|
|
42
|
+
*/
|
|
43
|
+
export interface RequestContext {
|
|
44
|
+
/** Base URL override; takes precedence over OPCUA_MODELER_API_URL. */
|
|
45
|
+
apiUrl?: string;
|
|
46
|
+
/** Extra headers to send upstream (e.g. x-forwarded-for). */
|
|
47
|
+
forwardHeaders?: Record<string, string>;
|
|
48
|
+
}
|
|
49
|
+
/** Run `fn` with `ctx` applied to every cloudFetch it performs. */
|
|
50
|
+
export declare function withRequestContext<T>(ctx: RequestContext, fn: () => Promise<T>): Promise<T>;
|
|
29
51
|
/** Structured error from the cloud API */
|
|
30
52
|
export interface CloudError {
|
|
31
53
|
error: string;
|
package/dist/cloud.js
CHANGED
|
@@ -26,9 +26,15 @@
|
|
|
26
26
|
* IMPORTANT: Never use console.log() — stdout is reserved for JSON-RPC.
|
|
27
27
|
* ==========================================================================
|
|
28
28
|
*/
|
|
29
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
29
30
|
import { isLocalBackend, localFetch, readLocalEndpoint } from "./local.js";
|
|
30
31
|
const DEFAULT_API_URL = "https://api.opcua-modeler.sterfive.io";
|
|
31
32
|
const TIMEOUT_MS = 30_000;
|
|
33
|
+
const requestContext = new AsyncLocalStorage();
|
|
34
|
+
/** Run `fn` with `ctx` applied to every cloudFetch it performs. */
|
|
35
|
+
export function withRequestContext(ctx, fn) {
|
|
36
|
+
return requestContext.run(ctx, fn);
|
|
37
|
+
}
|
|
32
38
|
/**
|
|
33
39
|
* The local engine runs in-process on the user's machine, where a large model
|
|
34
40
|
* with documentation can legitimately take minutes — there is no gateway
|
|
@@ -36,7 +42,7 @@ const TIMEOUT_MS = 30_000;
|
|
|
36
42
|
*/
|
|
37
43
|
const LOCAL_TIMEOUT_MS = 300_000;
|
|
38
44
|
function getApiUrl() {
|
|
39
|
-
return process.env.OPCUA_MODELER_API_URL || DEFAULT_API_URL;
|
|
45
|
+
return requestContext.getStore()?.apiUrl || process.env.OPCUA_MODELER_API_URL || DEFAULT_API_URL;
|
|
40
46
|
}
|
|
41
47
|
function getApiKey() {
|
|
42
48
|
return process.env.OPCUA_MODELER_API_KEY;
|
|
@@ -107,6 +113,9 @@ export async function cloudFetch(path, body, contentType, method = "POST") {
|
|
|
107
113
|
if (apiKey) {
|
|
108
114
|
headers["Authorization"] = `Bearer ${apiKey}`;
|
|
109
115
|
}
|
|
116
|
+
// Applied last so a hosted caller can attribute the call to the real
|
|
117
|
+
// end user (x-forwarded-for) rather than to this process.
|
|
118
|
+
Object.assign(headers, requestContext.getStore()?.forwardHeaders);
|
|
110
119
|
const controller = new AbortController();
|
|
111
120
|
const timeout = setTimeout(() => controller.abort(), TIMEOUT_MS);
|
|
112
121
|
try {
|
package/dist/cloud.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloud.js","sourceRoot":"","sources":["../src/cloud.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE3E,MAAM,eAAe,GAAG,uCAAuC,CAAC;AAChE,MAAM,UAAU,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"cloud.js","sourceRoot":"","sources":["../src/cloud.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE3E,MAAM,eAAe,GAAG,uCAAuC,CAAC;AAChE,MAAM,UAAU,GAAG,MAAM,CAAC;AAuB1B,MAAM,cAAc,GAAG,IAAI,iBAAiB,EAAkB,CAAC;AAE/D,mEAAmE;AACnE,MAAM,UAAU,kBAAkB,CAAI,GAAmB,EAAE,EAAoB;IAC7E,OAAO,cAAc,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AACrC,CAAC;AAED;;;;GAIG;AACH,MAAM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@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ==========================================================================
|
|
3
|
+
* OPC UA Modeler — MCP Server (Streamable HTTP entry point)
|
|
4
|
+
*
|
|
5
|
+
* Web Standards (Request/Response) transport, for hosting the same tool set
|
|
6
|
+
* as `index.ts` (stdio) behind an HTTP route — e.g. a Next.js route handler
|
|
7
|
+
* so the server can be added as a claude.ai custom connector.
|
|
8
|
+
*
|
|
9
|
+
* Stateless: no session ID, no SSE resumability — each request creates its
|
|
10
|
+
* own McpServer + transport pair. Simple, and fine for our tool set (no
|
|
11
|
+
* long-running/streaming tool calls, no server-initiated notifications).
|
|
12
|
+
* ==========================================================================
|
|
13
|
+
*/
|
|
14
|
+
import { type RequestContext } from "./cloud.js";
|
|
15
|
+
export type { RequestContext };
|
|
16
|
+
/**
|
|
17
|
+
* Handle one MCP-over-HTTP request and return the response. Mount this behind
|
|
18
|
+
* any route that can hand you a standard `Request` and return a standard
|
|
19
|
+
* `Response` (Next.js route handlers, Cloudflare Workers, Deno, Bun, Hono...).
|
|
20
|
+
*
|
|
21
|
+
* `context` lets a host that runs this server in-process alongside the API it
|
|
22
|
+
* proxies to redirect those calls and attribute them to the real end user —
|
|
23
|
+
* see {@link RequestContext}. Omit it for the plain stdio-equivalent behavior.
|
|
24
|
+
*/
|
|
25
|
+
export declare function handleMcpHttpRequest(request: Request, context?: RequestContext): Promise<Response>;
|
package/dist/http.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ==========================================================================
|
|
3
|
+
* OPC UA Modeler — MCP Server (Streamable HTTP entry point)
|
|
4
|
+
*
|
|
5
|
+
* Web Standards (Request/Response) transport, for hosting the same tool set
|
|
6
|
+
* as `index.ts` (stdio) behind an HTTP route — e.g. a Next.js route handler
|
|
7
|
+
* so the server can be added as a claude.ai custom connector.
|
|
8
|
+
*
|
|
9
|
+
* Stateless: no session ID, no SSE resumability — each request creates its
|
|
10
|
+
* own McpServer + transport pair. Simple, and fine for our tool set (no
|
|
11
|
+
* long-running/streaming tool calls, no server-initiated notifications).
|
|
12
|
+
* ==========================================================================
|
|
13
|
+
*/
|
|
14
|
+
import { WebStandardStreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";
|
|
15
|
+
import { withRequestContext } from "./cloud.js";
|
|
16
|
+
import { createServer } from "./server.js";
|
|
17
|
+
/**
|
|
18
|
+
* POST carries JSON-RPC; the other two verbs the Streamable HTTP spec defines
|
|
19
|
+
* only mean something with sessions, which stateless mode does not have:
|
|
20
|
+
*
|
|
21
|
+
* - GET opens the standalone SSE channel for server-initiated notifications.
|
|
22
|
+
* Here the transport is per-request and nothing else holds a reference, so
|
|
23
|
+
* no message could ever reach that stream — and `transport.close()` below
|
|
24
|
+
* would tear it down before the client read a byte anyway.
|
|
25
|
+
* - DELETE terminates a session; there is none to terminate.
|
|
26
|
+
*
|
|
27
|
+
* The spec's guidance for a server that does not offer these is 405, so say
|
|
28
|
+
* so directly instead of handing back a stream that dies on arrival.
|
|
29
|
+
*/
|
|
30
|
+
function methodNotAllowed() {
|
|
31
|
+
return new Response(JSON.stringify({
|
|
32
|
+
jsonrpc: "2.0",
|
|
33
|
+
error: { code: -32000, message: "Method Not Allowed: this MCP endpoint is stateless and only accepts POST" },
|
|
34
|
+
id: null
|
|
35
|
+
}), { status: 405, headers: { "Content-Type": "application/json", Allow: "POST" } });
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Handle one MCP-over-HTTP request and return the response. Mount this behind
|
|
39
|
+
* any route that can hand you a standard `Request` and return a standard
|
|
40
|
+
* `Response` (Next.js route handlers, Cloudflare Workers, Deno, Bun, Hono...).
|
|
41
|
+
*
|
|
42
|
+
* `context` lets a host that runs this server in-process alongside the API it
|
|
43
|
+
* proxies to redirect those calls and attribute them to the real end user —
|
|
44
|
+
* see {@link RequestContext}. Omit it for the plain stdio-equivalent behavior.
|
|
45
|
+
*/
|
|
46
|
+
export async function handleMcpHttpRequest(request, context) {
|
|
47
|
+
if (request.method !== "POST") {
|
|
48
|
+
return methodNotAllowed();
|
|
49
|
+
}
|
|
50
|
+
const server = createServer();
|
|
51
|
+
const transport = new WebStandardStreamableHTTPServerTransport({
|
|
52
|
+
sessionIdGenerator: undefined, // stateless mode
|
|
53
|
+
// Our tools are all fast request/response calls, so a plain JSON body is
|
|
54
|
+
// simpler and more broadly compatible than SSE. It also makes the
|
|
55
|
+
// `close()` below safe: the body is fully materialised before
|
|
56
|
+
// `handleRequest` resolves, whereas an SSE response would still be
|
|
57
|
+
// streaming and would be truncated.
|
|
58
|
+
enableJsonResponse: true
|
|
59
|
+
});
|
|
60
|
+
await server.connect(transport);
|
|
61
|
+
const response = context
|
|
62
|
+
? await withRequestContext(context, () => transport.handleRequest(request))
|
|
63
|
+
: await transport.handleRequest(request);
|
|
64
|
+
await transport.close();
|
|
65
|
+
return response;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=http.js.map
|
package/dist/http.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.js","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,wCAAwC,EAAE,MAAM,+DAA+D,CAAC;AACzH,OAAO,EAAuB,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAI3C;;;;;;;;;;;;GAYG;AACH,SAAS,gBAAgB;IACvB,OAAO,IAAI,QAAQ,CACjB,IAAI,CAAC,SAAS,CAAC;QACb,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,0EAA0E,EAAE;QAC5G,EAAE,EAAE,IAAI;KACT,CAAC,EACF,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CAChF,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,OAAgB,EAAE,OAAwB;IACnF,IAAI,OAAO,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;QAC9B,OAAO,gBAAgB,EAAE,CAAC;IAC5B,CAAC;IAED,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAG,IAAI,wCAAwC,CAAC;QAC7D,kBAAkB,EAAE,SAAS,EAAE,iBAAiB;QAChD,yEAAyE;QACzE,kEAAkE;QAClE,8DAA8D;QAC9D,mEAAmE;QACnE,oCAAoC;QACpC,kBAAkB,EAAE,IAAI;KACzB,CAAC,CAAC;IAEH,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,MAAM,QAAQ,GAAG,OAAO;QACtB,CAAC,CAAC,MAAM,kBAAkB,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAC3E,CAAC,CAAC,MAAM,SAAS,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC3C,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC;IACxB,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/server.js
CHANGED
|
@@ -12,11 +12,42 @@
|
|
|
12
12
|
* IMPORTANT: Never use console.log() — stdout may be reserved for JSON-RPC.
|
|
13
13
|
* ==========================================================================
|
|
14
14
|
*/
|
|
15
|
+
import fs from "node:fs";
|
|
16
|
+
import path from "node:path";
|
|
17
|
+
import { fileURLToPath } from "node:url";
|
|
15
18
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
16
19
|
import { z } from "zod";
|
|
17
20
|
import { findEngineeringUnit, findReusableBlock, getTypeDetails, listNamespaces, listTypes, resolveDependencies, searchTypes } from "./catalog.js";
|
|
18
21
|
import { cloudFetch, formatCloudError } from "./cloud.js";
|
|
19
22
|
import { isLocalBackend } from "./local.js";
|
|
23
|
+
/**
|
|
24
|
+
* The version reported in the MCP handshake — read from package.json rather
|
|
25
|
+
* than duplicated as a literal here.
|
|
26
|
+
*
|
|
27
|
+
* A hand-maintained copy had already drifted three minor versions (it said
|
|
28
|
+
* 1.2.0 against a 1.5.0 package) because `scripts/release.mjs` bumps
|
|
29
|
+
* package.json and server.json but knew nothing about this file. Deriving it
|
|
30
|
+
* makes that drift structurally impossible instead of adding a third place
|
|
31
|
+
* the release script must remember.
|
|
32
|
+
*
|
|
33
|
+
* Both `src/` (vitest, in place) and `dist/` (tsc output) sit one level below
|
|
34
|
+
* the package root, so the same relative path works either way — the pattern
|
|
35
|
+
* `catalog.ts` already uses to find `catalog/`.
|
|
36
|
+
*/
|
|
37
|
+
const SERVER_VERSION = (() => {
|
|
38
|
+
try {
|
|
39
|
+
const pkgPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..", "package.json");
|
|
40
|
+
const { version } = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
41
|
+
if (version)
|
|
42
|
+
return version;
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
// fall through
|
|
46
|
+
}
|
|
47
|
+
// A packaging quirk must not break the handshake itself; an obviously bogus
|
|
48
|
+
// version is a better failure than no server at all.
|
|
49
|
+
return "0.0.0";
|
|
50
|
+
})();
|
|
20
51
|
// Re-export for testing
|
|
21
52
|
export { findEngineeringUnit, findReusableBlock, getTypeDetails, listNamespaces, listTypes, resolveDependencies, searchTypes };
|
|
22
53
|
const jsonResult = (data) => ({ content: [{ type: "text", text: JSON.stringify(data) }] });
|
|
@@ -137,7 +168,7 @@ export async function handleToolCall(name, args) {
|
|
|
137
168
|
export function createServer() {
|
|
138
169
|
const server = new McpServer({
|
|
139
170
|
name: "opcua-modeler",
|
|
140
|
-
version:
|
|
171
|
+
version: SERVER_VERSION
|
|
141
172
|
});
|
|
142
173
|
// ── LOCAL TOOLS — registered from the single-source descriptors ───────
|
|
143
174
|
// Same list `handleToolCall` uses, so protocol and test paths never diverge.
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,SAAS,EACT,mBAAmB,EACnB,WAAW,EACZ,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,wBAAwB;AACxB,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,cAAc,EAAE,cAAc,EAAE,SAAS,EAAE,mBAAmB,EAAE,WAAW,EAAE,CAAC;AAsB/H,MAAM,UAAU,GAAG,CAAC,IAAa,EAAc,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAChH,MAAM,SAAS,GAAG,CAAC,OAAe,EAAc,EAAE,CAAC,CAAC;IAClD,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACrE,OAAO,EAAE,IAAI;CACd,CAAC,CAAC;AAiBH,SAAS,eAAe,CAA0B,IAKjD;IACC,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACxC,OAAO;QACL,IA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kBAAkB,CAAC,CAAC;QAErG,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC1E,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;QACD,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;SACxE,CAAC;IACJ,CAAC,CACF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-modeler-mcp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"mcpName": "io.github.node-opcua/node-opcua-modeler-mcp-server",
|
|
5
5
|
"description": "OPC UA Modeler MCP Server — exposes companion spec tools to AI agents",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.js",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./http": {
|
|
15
|
+
"types": "./dist/http.d.ts",
|
|
16
|
+
"default": "./dist/http.js"
|
|
17
|
+
},
|
|
18
|
+
"./package.json": "./package.json",
|
|
19
|
+
"./catalog/*": "./catalog/*"
|
|
20
|
+
},
|
|
9
21
|
"bin": {
|
|
10
22
|
"node-opcua-modeler-mcp": "dist/index.js"
|
|
11
23
|
},
|
|
@@ -14,7 +26,9 @@
|
|
|
14
26
|
"catalog/",
|
|
15
27
|
"server.json",
|
|
16
28
|
"README.md",
|
|
17
|
-
"SKILL.md"
|
|
29
|
+
"SKILL.md",
|
|
30
|
+
"LICENSE",
|
|
31
|
+
"NOTICE"
|
|
18
32
|
],
|
|
19
33
|
"scripts": {
|
|
20
34
|
"build": "tsc",
|
|
@@ -46,7 +60,7 @@
|
|
|
46
60
|
"ai-agent",
|
|
47
61
|
"model-context-protocol"
|
|
48
62
|
],
|
|
49
|
-
"license": "
|
|
63
|
+
"license": "Apache-2.0",
|
|
50
64
|
"repository": {
|
|
51
65
|
"type": "git",
|
|
52
66
|
"url": "git+https://github.com/node-opcua/node-opcua-modeler-mcp-server.git"
|
package/server.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "io.github.node-opcua/node-opcua-modeler-mcp-server",
|
|
4
4
|
"title": "OPC UA Modeler",
|
|
5
5
|
"description": "OPC UA companion spec types, namespace dependencies, and engineering units for AI agents",
|
|
6
|
-
"version": "1.
|
|
6
|
+
"version": "1.6.0",
|
|
7
7
|
"websiteUrl": "https://opcua-modeler.sterfive.io",
|
|
8
8
|
"repository": {
|
|
9
9
|
"url": "https://github.com/node-opcua/node-opcua-modeler-mcp-server",
|
|
@@ -13,12 +13,18 @@
|
|
|
13
13
|
{
|
|
14
14
|
"registryType": "npm",
|
|
15
15
|
"identifier": "node-opcua-modeler-mcp-server",
|
|
16
|
-
"version": "1.
|
|
16
|
+
"version": "1.6.0",
|
|
17
17
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
18
18
|
"runtimeHint": "npx",
|
|
19
19
|
"transport": {
|
|
20
20
|
"type": "stdio"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
+
],
|
|
24
|
+
"remotes": [
|
|
25
|
+
{
|
|
26
|
+
"type": "streamable-http",
|
|
27
|
+
"url": "https://api.opcua-modeler.sterfive.io/api/mcp"
|
|
28
|
+
}
|
|
23
29
|
]
|
|
24
30
|
}
|