node-opcua-modeler-mcp-server 1.1.0 → 1.2.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 +21 -0
- package/README.md +29 -3
- package/SKILL.md +63 -0
- package/catalog/catalog.json +53319 -16822
- package/package.json +2 -15
- package/server.json +2 -2
- package/dist/catalog.d.ts +0 -76
- package/dist/catalog.js +0 -134
- package/dist/catalog.js.map +0 -1
- package/dist/cloud.d.ts +0 -41
- package/dist/cloud.js +0 -147
- package/dist/cloud.js.map +0 -1
- package/dist/index.d.ts +0 -13
- package/dist/index.js +0 -25
- package/dist/index.js.map +0 -1
- package/dist/server.d.ts +0 -42
- package/dist/server.js +0 -226
- package/dist/server.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-modeler-mcp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.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",
|
|
@@ -18,25 +18,12 @@
|
|
|
18
18
|
],
|
|
19
19
|
"scripts": {
|
|
20
20
|
"build": "tsc",
|
|
21
|
-
"
|
|
22
|
-
"test:watch": "vitest",
|
|
23
|
-
"start": "node dist/index.js",
|
|
24
|
-
"extract-catalog": "tsx scripts/extract-catalog.ts",
|
|
25
|
-
"demo": "tsx scripts/demo.ts"
|
|
21
|
+
"start": "node dist/index.js"
|
|
26
22
|
},
|
|
27
23
|
"dependencies": {
|
|
28
24
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
29
25
|
"zod": "^3.25.0"
|
|
30
26
|
},
|
|
31
|
-
"devDependencies": {
|
|
32
|
-
"@sterfive/opcua-modeler-ex": "workspace:*",
|
|
33
|
-
"@sterfive/opcua-modeler-knowledge-base": "workspace:*",
|
|
34
|
-
"node-opcua-address-space": "2.173.1",
|
|
35
|
-
"node-opcua-data-model": "2.173.0",
|
|
36
|
-
"tsx": "^4.19.0",
|
|
37
|
-
"vitest": "^3.2.2",
|
|
38
|
-
"typescript": "~5.7.3"
|
|
39
|
-
},
|
|
40
27
|
"keywords": [
|
|
41
28
|
"opcua",
|
|
42
29
|
"opc-ua",
|
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.2.0",
|
|
7
7
|
"websiteUrl": "https://opcua-modeler.sterfive.com",
|
|
8
8
|
"repository": {
|
|
9
9
|
"url": "https://github.com/node-opcua/node-opcua-modeler-mcp-server",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
{
|
|
14
14
|
"registryType": "npm",
|
|
15
15
|
"identifier": "node-opcua-modeler-mcp-server",
|
|
16
|
-
"version": "1.
|
|
16
|
+
"version": "1.2.0",
|
|
17
17
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
18
18
|
"runtimeHint": "npx",
|
|
19
19
|
"transport": {
|
package/dist/catalog.d.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ==========================================================================
|
|
3
|
-
* OPC UA Modeler MCP Server — Static Catalog Loader
|
|
4
|
-
*
|
|
5
|
-
* Loads the pre-generated catalog.json that contains all public OPC UA
|
|
6
|
-
* companion spec type information. This file is generated at build time
|
|
7
|
-
* by scripts/extract-catalog.ts and committed to git.
|
|
8
|
-
*
|
|
9
|
-
* IMPORTANT: This module has ZERO dependencies on @sterfive/* packages.
|
|
10
|
-
* All data comes from the static JSON catalog.
|
|
11
|
-
* ==========================================================================
|
|
12
|
-
*/
|
|
13
|
-
export interface CompanionSpecEntry {
|
|
14
|
-
alias: string;
|
|
15
|
-
name: string;
|
|
16
|
-
uri: string;
|
|
17
|
-
deps: string[];
|
|
18
|
-
keywords: string[];
|
|
19
|
-
priority: 0 | 1 | 2;
|
|
20
|
-
}
|
|
21
|
-
export interface TypeSummary {
|
|
22
|
-
browseName: string;
|
|
23
|
-
kind: "ObjectType" | "VariableType" | "ReferenceType" | "DataType";
|
|
24
|
-
namespace: string;
|
|
25
|
-
isAbstract: boolean;
|
|
26
|
-
description?: string;
|
|
27
|
-
subtypeOf?: string;
|
|
28
|
-
}
|
|
29
|
-
export interface MemberSummary {
|
|
30
|
-
browseName: string;
|
|
31
|
-
nodeClass: string;
|
|
32
|
-
dataType?: string;
|
|
33
|
-
typeDefinition?: string;
|
|
34
|
-
modellingRule?: string;
|
|
35
|
-
description?: string;
|
|
36
|
-
}
|
|
37
|
-
export interface TypeDetails extends TypeSummary {
|
|
38
|
-
components: MemberSummary[];
|
|
39
|
-
properties: MemberSummary[];
|
|
40
|
-
methods: string[];
|
|
41
|
-
interfaces: string[];
|
|
42
|
-
}
|
|
43
|
-
export interface EngineeringUnitsData {
|
|
44
|
-
symbols: string[];
|
|
45
|
-
aliases: Record<string, string>;
|
|
46
|
-
}
|
|
47
|
-
export interface Catalog {
|
|
48
|
-
version: string;
|
|
49
|
-
generatedAt: string;
|
|
50
|
-
registry: CompanionSpecEntry[];
|
|
51
|
-
types: Record<string, TypeSummary[]>;
|
|
52
|
-
typeDetails: Record<string, Record<string, TypeDetails>>;
|
|
53
|
-
engineeringUnits: EngineeringUnitsData;
|
|
54
|
-
}
|
|
55
|
-
/** List all companion spec namespaces */
|
|
56
|
-
export declare function listNamespaces(): CompanionSpecEntry[];
|
|
57
|
-
/**
|
|
58
|
-
* Resolve the full dependency chain for a set of spec aliases.
|
|
59
|
-
* Returns a topologically sorted list (dependencies before dependents).
|
|
60
|
-
*/
|
|
61
|
-
export declare function resolveDependencies(aliases: string[]): string[];
|
|
62
|
-
/** List all types in a companion spec namespace */
|
|
63
|
-
export declare function listTypes(alias: string): TypeSummary[];
|
|
64
|
-
/** Get detailed information about a specific type */
|
|
65
|
-
export declare function getTypeDetails(alias: string, browseName: string): TypeDetails | null;
|
|
66
|
-
/** Search for types across all companion specs by keyword */
|
|
67
|
-
export declare function searchTypes(query: string): (TypeSummary & {
|
|
68
|
-
alias: string;
|
|
69
|
-
})[];
|
|
70
|
-
export interface UnitLookupResult {
|
|
71
|
-
symbol: string;
|
|
72
|
-
matchType: "exact" | "case-insensitive" | "alias" | "fuzzy";
|
|
73
|
-
confidence: number;
|
|
74
|
-
}
|
|
75
|
-
/** Find the official engineering unit symbol for a description */
|
|
76
|
-
export declare function findEngineeringUnit(query: string): UnitLookupResult | null;
|
package/dist/catalog.js
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ==========================================================================
|
|
3
|
-
* OPC UA Modeler MCP Server — Static Catalog Loader
|
|
4
|
-
*
|
|
5
|
-
* Loads the pre-generated catalog.json that contains all public OPC UA
|
|
6
|
-
* companion spec type information. This file is generated at build time
|
|
7
|
-
* by scripts/extract-catalog.ts and committed to git.
|
|
8
|
-
*
|
|
9
|
-
* IMPORTANT: This module has ZERO dependencies on @sterfive/* packages.
|
|
10
|
-
* All data comes from the static JSON catalog.
|
|
11
|
-
* ==========================================================================
|
|
12
|
-
*/
|
|
13
|
-
import fs from "node:fs";
|
|
14
|
-
import path from "node:path";
|
|
15
|
-
import { fileURLToPath } from "node:url";
|
|
16
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
17
|
-
const CATALOG_PATH = path.resolve(__dirname, "..", "catalog", "catalog.json");
|
|
18
|
-
// ── Lazy-loaded singleton ────────────────────────────────────────────────
|
|
19
|
-
let _catalog = null;
|
|
20
|
-
function getCatalog() {
|
|
21
|
-
if (!_catalog) {
|
|
22
|
-
const raw = fs.readFileSync(CATALOG_PATH, "utf-8");
|
|
23
|
-
_catalog = JSON.parse(raw);
|
|
24
|
-
}
|
|
25
|
-
return _catalog;
|
|
26
|
-
}
|
|
27
|
-
// ── Public Query API ─────────────────────────────────────────────────────
|
|
28
|
-
/** List all companion spec namespaces */
|
|
29
|
-
export function listNamespaces() {
|
|
30
|
-
return getCatalog().registry;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Resolve the full dependency chain for a set of spec aliases.
|
|
34
|
-
* Returns a topologically sorted list (dependencies before dependents).
|
|
35
|
-
*/
|
|
36
|
-
export function resolveDependencies(aliases) {
|
|
37
|
-
const registry = getCatalog().registry;
|
|
38
|
-
const byAlias = new Map(registry.map((s) => [s.alias, s]));
|
|
39
|
-
const resolved = new Set();
|
|
40
|
-
const result = [];
|
|
41
|
-
function visit(alias) {
|
|
42
|
-
if (resolved.has(alias))
|
|
43
|
-
return;
|
|
44
|
-
const spec = byAlias.get(alias);
|
|
45
|
-
if (!spec)
|
|
46
|
-
return;
|
|
47
|
-
for (const dep of spec.deps) {
|
|
48
|
-
visit(dep);
|
|
49
|
-
}
|
|
50
|
-
resolved.add(alias);
|
|
51
|
-
result.push(alias);
|
|
52
|
-
}
|
|
53
|
-
for (const alias of aliases) {
|
|
54
|
-
visit(alias);
|
|
55
|
-
}
|
|
56
|
-
return result;
|
|
57
|
-
}
|
|
58
|
-
/** List all types in a companion spec namespace */
|
|
59
|
-
export function listTypes(alias) {
|
|
60
|
-
return getCatalog().types[alias] ?? [];
|
|
61
|
-
}
|
|
62
|
-
/** Get detailed information about a specific type */
|
|
63
|
-
export function getTypeDetails(alias, browseName) {
|
|
64
|
-
const nsDetails = getCatalog().typeDetails[alias];
|
|
65
|
-
if (!nsDetails)
|
|
66
|
-
return null;
|
|
67
|
-
return nsDetails[browseName] ?? null;
|
|
68
|
-
}
|
|
69
|
-
/** Search for types across all companion specs by keyword */
|
|
70
|
-
export function searchTypes(query) {
|
|
71
|
-
const catalog = getCatalog();
|
|
72
|
-
const results = [];
|
|
73
|
-
const q = query.toLowerCase();
|
|
74
|
-
for (const [alias, types] of Object.entries(catalog.types)) {
|
|
75
|
-
for (const t of types) {
|
|
76
|
-
if (t.browseName.toLowerCase().includes(q) ||
|
|
77
|
-
(t.description && t.description.toLowerCase().includes(q))) {
|
|
78
|
-
results.push({ ...t, alias });
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return results;
|
|
83
|
-
}
|
|
84
|
-
let _unitsLower = null;
|
|
85
|
-
function getUnitsLowerMap() {
|
|
86
|
-
if (!_unitsLower) {
|
|
87
|
-
_unitsLower = new Map();
|
|
88
|
-
for (const u of getCatalog().engineeringUnits.symbols) {
|
|
89
|
-
_unitsLower.set(String(u).toLowerCase(), String(u));
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
return _unitsLower;
|
|
93
|
-
}
|
|
94
|
-
/** Find the official engineering unit symbol for a description */
|
|
95
|
-
export function findEngineeringUnit(query) {
|
|
96
|
-
if (!query || query.trim().length === 0)
|
|
97
|
-
return null;
|
|
98
|
-
const catalog = getCatalog();
|
|
99
|
-
const units = catalog.engineeringUnits.symbols.map(String);
|
|
100
|
-
const aliases = catalog.engineeringUnits.aliases;
|
|
101
|
-
const q = query.trim();
|
|
102
|
-
// 1. Exact match
|
|
103
|
-
if (units.includes(q)) {
|
|
104
|
-
return { symbol: q, matchType: "exact", confidence: 1 };
|
|
105
|
-
}
|
|
106
|
-
// 2. Case-insensitive match
|
|
107
|
-
const lowerMap = getUnitsLowerMap();
|
|
108
|
-
const lower = q.toLowerCase();
|
|
109
|
-
const ciMatch = lowerMap.get(lower);
|
|
110
|
-
if (ciMatch) {
|
|
111
|
-
return { symbol: ciMatch, matchType: "case-insensitive", confidence: 0.95 };
|
|
112
|
-
}
|
|
113
|
-
// 3. Alias match (natural language → symbol)
|
|
114
|
-
const aliasMatch = aliases[lower];
|
|
115
|
-
if (aliasMatch) {
|
|
116
|
-
return { symbol: aliasMatch, matchType: "alias", confidence: 1 };
|
|
117
|
-
}
|
|
118
|
-
// 4. Fuzzy: strip quotes, whitespace variants
|
|
119
|
-
const normalized = q.replace(/['"]/g, "").replace(/\s+/g, " ").toLowerCase();
|
|
120
|
-
const aliasNorm = aliases[normalized];
|
|
121
|
-
if (aliasNorm) {
|
|
122
|
-
return { symbol: aliasNorm, matchType: "alias", confidence: 0.9 };
|
|
123
|
-
}
|
|
124
|
-
// 5. Fuzzy: try removing trailing 's' (plurals)
|
|
125
|
-
if (normalized.endsWith("s")) {
|
|
126
|
-
const singular = normalized.slice(0, -1);
|
|
127
|
-
const singularMatch = aliases[singular];
|
|
128
|
-
if (singularMatch) {
|
|
129
|
-
return { symbol: singularMatch, matchType: "fuzzy", confidence: 0.85 };
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
return null;
|
|
133
|
-
}
|
|
134
|
-
//# sourceMappingURL=catalog.js.map
|
package/dist/catalog.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/D,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC;AAoD9E,4EAA4E;AAE5E,IAAI,QAAQ,GAAmB,IAAI,CAAC;AAEpC,SAAS,UAAU;IACjB,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QACnD,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAY,C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,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;IAC7E,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACtC,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC;IACpE,CAAC;IAED,gDAAgD;IAChD,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC7B,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACzC,MAAM,aAAa,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;QACxC,IAAI,aAAa,EAAE,CAAC;YAClB,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;QACzE,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/cloud.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ==========================================================================
|
|
3
|
-
* OPC UA Modeler — Cloud API Client
|
|
4
|
-
*
|
|
5
|
-
* Thin HTTP wrapper for proxying MCP tool calls to the Sterfive SaaS API.
|
|
6
|
-
* ZERO proprietary dependencies — only native fetch.
|
|
7
|
-
*
|
|
8
|
-
* Configuration via environment variables:
|
|
9
|
-
* OPCUA_MODELER_API_URL — Base URL (default: https://api.opcua-modeler.sterfive.io)
|
|
10
|
-
* OPCUA_MODELER_API_KEY — API key (stfv_...) for authenticated endpoints
|
|
11
|
-
*
|
|
12
|
-
* IMPORTANT: Never use console.log() — stdout is reserved for JSON-RPC.
|
|
13
|
-
* ==========================================================================
|
|
14
|
-
*/
|
|
15
|
-
/** Structured error from the cloud API */
|
|
16
|
-
export interface CloudError {
|
|
17
|
-
error: string;
|
|
18
|
-
status?: number;
|
|
19
|
-
hint?: string;
|
|
20
|
-
}
|
|
21
|
-
/** Result of a cloud API call — either success JSON or structured error */
|
|
22
|
-
export type CloudResult<T = unknown> = {
|
|
23
|
-
ok: true;
|
|
24
|
-
data: T;
|
|
25
|
-
} | {
|
|
26
|
-
ok: false;
|
|
27
|
-
error: CloudError;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Make an authenticated request to the Sterfive SaaS API.
|
|
31
|
-
*
|
|
32
|
-
* @param path - API path (e.g. "/v1/validate")
|
|
33
|
-
* @param body - Request body (string)
|
|
34
|
-
* @param contentType - Content-Type header (e.g. "text/yaml", "application/xml")
|
|
35
|
-
* @returns Parsed JSON response or structured error
|
|
36
|
-
*/
|
|
37
|
-
export declare function cloudFetch<T = unknown>(path: string, body: string, contentType: string): Promise<CloudResult<T>>;
|
|
38
|
-
/**
|
|
39
|
-
* Format a CloudError into a user-friendly MCP tool error response.
|
|
40
|
-
*/
|
|
41
|
-
export declare function formatCloudError(err: CloudError): string;
|
package/dist/cloud.js
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ==========================================================================
|
|
3
|
-
* OPC UA Modeler — Cloud API Client
|
|
4
|
-
*
|
|
5
|
-
* Thin HTTP wrapper for proxying MCP tool calls to the Sterfive SaaS API.
|
|
6
|
-
* ZERO proprietary dependencies — only native fetch.
|
|
7
|
-
*
|
|
8
|
-
* Configuration via environment variables:
|
|
9
|
-
* OPCUA_MODELER_API_URL — Base URL (default: https://api.opcua-modeler.sterfive.io)
|
|
10
|
-
* OPCUA_MODELER_API_KEY — API key (stfv_...) for authenticated endpoints
|
|
11
|
-
*
|
|
12
|
-
* IMPORTANT: Never use console.log() — stdout is reserved for JSON-RPC.
|
|
13
|
-
* ==========================================================================
|
|
14
|
-
*/
|
|
15
|
-
const DEFAULT_API_URL = "https://api.opcua-modeler.sterfive.io";
|
|
16
|
-
const TIMEOUT_MS = 30_000;
|
|
17
|
-
function getApiUrl() {
|
|
18
|
-
return process.env.OPCUA_MODELER_API_URL || DEFAULT_API_URL;
|
|
19
|
-
}
|
|
20
|
-
function getApiKey() {
|
|
21
|
-
return process.env.OPCUA_MODELER_API_KEY;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Make an authenticated request to the Sterfive SaaS API.
|
|
25
|
-
*
|
|
26
|
-
* @param path - API path (e.g. "/v1/validate")
|
|
27
|
-
* @param body - Request body (string)
|
|
28
|
-
* @param contentType - Content-Type header (e.g. "text/yaml", "application/xml")
|
|
29
|
-
* @returns Parsed JSON response or structured error
|
|
30
|
-
*/
|
|
31
|
-
export async function cloudFetch(path, body, contentType) {
|
|
32
|
-
const baseUrl = getApiUrl();
|
|
33
|
-
const apiKey = getApiKey();
|
|
34
|
-
const url = `${baseUrl}${path}`;
|
|
35
|
-
const headers = {
|
|
36
|
-
"Content-Type": contentType,
|
|
37
|
-
Accept: "application/json"
|
|
38
|
-
};
|
|
39
|
-
if (apiKey) {
|
|
40
|
-
headers["Authorization"] = `Bearer ${apiKey}`;
|
|
41
|
-
}
|
|
42
|
-
try {
|
|
43
|
-
const controller = new AbortController();
|
|
44
|
-
const timeout = setTimeout(() => controller.abort(), TIMEOUT_MS);
|
|
45
|
-
const response = await fetch(url, {
|
|
46
|
-
method: "POST",
|
|
47
|
-
headers,
|
|
48
|
-
body,
|
|
49
|
-
signal: controller.signal
|
|
50
|
-
});
|
|
51
|
-
clearTimeout(timeout);
|
|
52
|
-
if (response.ok) {
|
|
53
|
-
const data = (await response.json());
|
|
54
|
-
return { ok: true, data };
|
|
55
|
-
}
|
|
56
|
-
// Handle specific HTTP error codes with actionable messages
|
|
57
|
-
switch (response.status) {
|
|
58
|
-
case 401:
|
|
59
|
-
case 403:
|
|
60
|
-
return {
|
|
61
|
-
ok: false,
|
|
62
|
-
error: {
|
|
63
|
-
error: "Authentication required. Set OPCUA_MODELER_API_KEY in your MCP server config.",
|
|
64
|
-
status: response.status,
|
|
65
|
-
hint: "Get a free API key at https://opcua-modeler.sterfive.com/settings/api-keys"
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
case 429: {
|
|
69
|
-
const retryAfter = response.headers.get("Retry-After");
|
|
70
|
-
const upgradeUrl = response.headers.get("X-Upgrade-URL");
|
|
71
|
-
return {
|
|
72
|
-
ok: false,
|
|
73
|
-
error: {
|
|
74
|
-
error: `Rate limit exceeded.${retryAfter ? ` Try again in ${retryAfter}s.` : ""}`,
|
|
75
|
-
status: 429,
|
|
76
|
-
hint: upgradeUrl
|
|
77
|
-
? `Upgrade your plan at ${upgradeUrl}`
|
|
78
|
-
: "Reduce request frequency or upgrade your plan."
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
case 422: {
|
|
83
|
-
// Validation error from the API (e.g. malformed YAML)
|
|
84
|
-
let detail = "";
|
|
85
|
-
try {
|
|
86
|
-
const errBody = await response.json();
|
|
87
|
-
detail = errBody.detail || errBody.message || "";
|
|
88
|
-
}
|
|
89
|
-
catch {
|
|
90
|
-
detail = await response.text();
|
|
91
|
-
}
|
|
92
|
-
return {
|
|
93
|
-
ok: false,
|
|
94
|
-
error: {
|
|
95
|
-
error: `Validation error: ${detail}`,
|
|
96
|
-
status: 422
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
default: {
|
|
101
|
-
let text = "";
|
|
102
|
-
try {
|
|
103
|
-
text = await response.text();
|
|
104
|
-
}
|
|
105
|
-
catch { /* ignore */ }
|
|
106
|
-
return {
|
|
107
|
-
ok: false,
|
|
108
|
-
error: {
|
|
109
|
-
error: `API error (HTTP ${response.status}): ${text || response.statusText}`,
|
|
110
|
-
status: response.status
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
catch (e) {
|
|
117
|
-
if (e instanceof DOMException && e.name === "AbortError") {
|
|
118
|
-
return {
|
|
119
|
-
ok: false,
|
|
120
|
-
error: {
|
|
121
|
-
error: `Request timed out after ${TIMEOUT_MS / 1000}s. The server may be unavailable.`,
|
|
122
|
-
hint: "Check https://opcua-modeler.sterfive.com/status for service status."
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
// Network errors (DNS, connection refused, etc.)
|
|
127
|
-
const message = e instanceof Error ? e.message : String(e);
|
|
128
|
-
return {
|
|
129
|
-
ok: false,
|
|
130
|
-
error: {
|
|
131
|
-
error: `Cannot reach the OPC UA Modeler API: ${message}`,
|
|
132
|
-
hint: "Check your network connection or verify the API URL."
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Format a CloudError into a user-friendly MCP tool error response.
|
|
139
|
-
*/
|
|
140
|
-
export function formatCloudError(err) {
|
|
141
|
-
const parts = [err.error];
|
|
142
|
-
if (err.hint) {
|
|
143
|
-
parts.push(`Hint: ${err.hint}`);
|
|
144
|
-
}
|
|
145
|
-
return parts.join("\n");
|
|
146
|
-
}
|
|
147
|
-
//# sourceMappingURL=cloud.js.map
|
package/dist/cloud.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cloud.js","sourceRoot":"","sources":["../src/cloud.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,eAAe,GAAG,uCAAuC,CAAC;AAChE,MAAM,UAAU,GAAG,MAAM,CAAC;AAc1B,SAAS,SAAS;IAChB,OAAO,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,eAAe,CAAC;AAC9D,CAAC;AAED,SAAS,SAAS;IAChB,OAAO,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC;AAC3C,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,IAAY,EACZ,IAAY,EACZ,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AAM,IAAI,IAAI,QAAQ,CAAC,UAAU,EAAE;wBAC5E,MAAM,EAAE,QAAQ,CAAC,MAAM;qBACxB;iBACF,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,YAAY,YAAY,IAAI,CAAC,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;YACzD,OAAO;gBACL,EAAE,EAAE,KAAK;gBACT,KAAK,EAAE;oBACL,KAAK,EAAE,2BAA2B,UAAU,GAAG,IAAI,mCAAmC;oBACtF,IAAI,EAAE,qEAAqE;iBAC5E;aACF,CAAC;QACJ,CAAC;QAED,iDAAiD;QACjD,MAAM,OAAO,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC3D,OAAO;YACL,EAAE,EAAE,KAAK;YACT,KAAK,EAAE;gBACL,KAAK,EAAE,wCAAwC,OAAO,EAAE;gBACxD,IAAI,EAAE,sDAAsD;aAC7D;SACF,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAe;IAC9C,MAAM,KAAK,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC1B,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;QACb,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
package/dist/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* ==========================================================================
|
|
4
|
-
* OPC UA Modeler — MCP Server (CLI Entry Point)
|
|
5
|
-
*
|
|
6
|
-
* Thin wrapper that creates the server and connects it to stdio transport.
|
|
7
|
-
* All tool registration logic lives in server.ts.
|
|
8
|
-
*
|
|
9
|
-
* Transport: stdio (JSON-RPC over stdin/stdout)
|
|
10
|
-
* IMPORTANT: Never use console.log() — stdout is reserved for JSON-RPC.
|
|
11
|
-
* ==========================================================================
|
|
12
|
-
*/
|
|
13
|
-
export {};
|
package/dist/index.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* ==========================================================================
|
|
4
|
-
* OPC UA Modeler — MCP Server (CLI Entry Point)
|
|
5
|
-
*
|
|
6
|
-
* Thin wrapper that creates the server and connects it to stdio transport.
|
|
7
|
-
* All tool registration logic lives in server.ts.
|
|
8
|
-
*
|
|
9
|
-
* Transport: stdio (JSON-RPC over stdin/stdout)
|
|
10
|
-
* IMPORTANT: Never use console.log() — stdout is reserved for JSON-RPC.
|
|
11
|
-
* ==========================================================================
|
|
12
|
-
*/
|
|
13
|
-
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
14
|
-
import { createServer } from "./server.js";
|
|
15
|
-
async function main() {
|
|
16
|
-
const server = createServer();
|
|
17
|
-
const transport = new StdioServerTransport();
|
|
18
|
-
await server.connect(transport);
|
|
19
|
-
console.error("opcua-modeler MCP server running on stdio");
|
|
20
|
-
}
|
|
21
|
-
main().catch((err) => {
|
|
22
|
-
console.error("Fatal error starting MCP server:", err);
|
|
23
|
-
process.exit(1);
|
|
24
|
-
});
|
|
25
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,2CAA2C,CAAC,CAAC;AAC7D,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,GAAG,CAAC,CAAC;IACvD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/server.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ==========================================================================
|
|
3
|
-
* OPC UA Modeler — MCP Server Factory (IP-Safe Version)
|
|
4
|
-
*
|
|
5
|
-
* Creates and configures the MCP server with 9 OPC UA tools:
|
|
6
|
-
* - 6 LOCAL tools: query the static type catalog (free, offline)
|
|
7
|
-
* - 3 CLOUD tools: proxy to api.opcua-modeler.sterfive.io
|
|
8
|
-
*
|
|
9
|
-
* Architecture: "Thin Local Shell" per Project Prometheus §1.1
|
|
10
|
-
* ZERO dependencies on proprietary @sterfive/* packages.
|
|
11
|
-
*
|
|
12
|
-
* IMPORTANT: Never use console.log() — stdout may be reserved for JSON-RPC.
|
|
13
|
-
* ==========================================================================
|
|
14
|
-
*/
|
|
15
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
16
|
-
import { findEngineeringUnit, getTypeDetails, listNamespaces, listTypes, resolveDependencies, searchTypes } from "./catalog.js";
|
|
17
|
-
export { findEngineeringUnit, getTypeDetails, listNamespaces, listTypes, resolveDependencies, searchTypes };
|
|
18
|
-
/** Tool name type */
|
|
19
|
-
export type ToolName = "resolve_dependencies" | "list_namespaces" | "list_types" | "get_type_details" | "search_types" | "find_engineering_unit" | "opcua_model_validate" | "opcua_model_generate" | "opcua_model_reverse";
|
|
20
|
-
/**
|
|
21
|
-
* Direct tool call handler for testing (bypasses MCP protocol).
|
|
22
|
-
* Returns the same shape as MCP tool responses.
|
|
23
|
-
*/
|
|
24
|
-
export declare function handleToolCall(name: ToolName, args: Record<string, unknown>): Promise<{
|
|
25
|
-
content: {
|
|
26
|
-
type: "text";
|
|
27
|
-
text: string;
|
|
28
|
-
}[];
|
|
29
|
-
isError?: undefined;
|
|
30
|
-
} | {
|
|
31
|
-
content: {
|
|
32
|
-
type: "text";
|
|
33
|
-
text: string;
|
|
34
|
-
}[];
|
|
35
|
-
isError: boolean;
|
|
36
|
-
}>;
|
|
37
|
-
/**
|
|
38
|
-
* Create and configure the MCP server with all OPC UA tools registered.
|
|
39
|
-
* The server is NOT connected to any transport — the caller is responsible
|
|
40
|
-
* for connecting it (e.g., StdioServerTransport or InMemoryTransport).
|
|
41
|
-
*/
|
|
42
|
-
export declare function createServer(): McpServer;
|