@sassoftware/sas-score-mcp-serverjs 0.3.6 → 0.3.8
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/package.json
CHANGED
package/src/expressMcpServer.js
CHANGED
|
@@ -69,7 +69,7 @@ async function expressMcpServer(mcpServer, cache, baseAppEnvContext) {
|
|
|
69
69
|
app.get("/", (req, res) => {
|
|
70
70
|
res.json({
|
|
71
71
|
name: "SAS Viya Sample MCP Server",
|
|
72
|
-
version:
|
|
72
|
+
version: baseAppEnvContext.version,
|
|
73
73
|
description: "SAS Viya Sample MCP Server",
|
|
74
74
|
endpoints: {
|
|
75
75
|
mcp: "/mcp",
|
|
@@ -82,13 +82,13 @@ app.get("/", (req, res) => {
|
|
|
82
82
|
|
|
83
83
|
// api metadata endpoint(for sas specs)
|
|
84
84
|
app.get("/apiMeta", (req, res) => {
|
|
85
|
-
let spec = openAPIJson();
|
|
85
|
+
let spec = openAPIJson(baseAppEnvContext.version);
|
|
86
86
|
res.json(spec);
|
|
87
87
|
});
|
|
88
88
|
|
|
89
89
|
// for azure container apps
|
|
90
90
|
app.get("/openapi.json", (req, res) => {
|
|
91
|
-
let spec = openAPIJson();
|
|
91
|
+
let spec = openAPIJson(baseAppEnvContext.version);
|
|
92
92
|
res.json(spec);
|
|
93
93
|
});
|
|
94
94
|
|
package/src/openAPIJson.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* Copyright © 2025, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
-
function openAPIJson() {
|
|
6
|
-
|
|
5
|
+
function openAPIJson(version) {
|
|
6
|
+
let spec = {
|
|
7
7
|
"swagger": "2.0",
|
|
8
8
|
"info": {
|
|
9
|
-
"title": "
|
|
10
|
-
"version":
|
|
11
|
-
"description": "
|
|
9
|
+
"title": "sas-score-mcp-serverjs API",
|
|
10
|
+
"version": version,
|
|
11
|
+
"description": "sas-score-mcp-serverjs is a mcp server for SAS Viya"
|
|
12
12
|
},
|
|
13
13
|
"host": "localhost:8080",
|
|
14
14
|
"basePath": "/",
|
|
@@ -48,6 +48,18 @@ function openAPIJson() {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
+
},
|
|
52
|
+
"/openapi.json": {
|
|
53
|
+
"get": {
|
|
54
|
+
"summary": "API metadata",
|
|
55
|
+
"description": "Returns the OpenAPI specification for this server.",
|
|
56
|
+
"responses": {
|
|
57
|
+
"200": {
|
|
58
|
+
"description": "OpenAPI document",
|
|
59
|
+
"schema": { "type": "object" }
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
51
63
|
},
|
|
52
64
|
"/mcp": {
|
|
53
65
|
"options": {
|
|
@@ -153,6 +165,8 @@ function openAPIJson() {
|
|
|
153
165
|
}
|
|
154
166
|
}
|
|
155
167
|
}
|
|
156
|
-
}
|
|
168
|
+
};
|
|
169
|
+
spec.info.version = version;
|
|
170
|
+
return spec;
|
|
157
171
|
};
|
|
158
172
|
export default openAPIJson;
|
|
@@ -16,10 +16,10 @@ async function _listLibrary(params ){
|
|
|
16
16
|
source: (server === 'sas') ? 'compute' : server,
|
|
17
17
|
table: null
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
let appControl;
|
|
20
20
|
try {
|
|
21
21
|
// setup request control
|
|
22
|
-
|
|
22
|
+
appControl = await restafedit.setup(
|
|
23
23
|
_appContext.logonPayload,
|
|
24
24
|
config
|
|
25
25
|
,null,{},'user',{}, {}, _appContext.storeConfig
|
|
@@ -48,7 +48,9 @@ async function _listLibrary(params ){
|
|
|
48
48
|
};
|
|
49
49
|
} catch (err) {
|
|
50
50
|
console.error(JSON.stringify(err));
|
|
51
|
-
|
|
51
|
+
if (appControl != null) {
|
|
52
|
+
await deleteSession(appControl);
|
|
53
|
+
}
|
|
52
54
|
return { isError: true, content: [{ type: 'text', text: JSON.stringify(err) }] };
|
|
53
55
|
}
|
|
54
56
|
}
|
|
@@ -41,6 +41,10 @@ async function igetLogonPayload(_appContext) {
|
|
|
41
41
|
|
|
42
42
|
// Use user supplied bearer token
|
|
43
43
|
if (_appContext.AUTHFLOW === "bearer") {
|
|
44
|
+
if (_appContext.bearerToken == null) {
|
|
45
|
+
console.error("[Error] AUTHFLOW set to bearer but no bearer token supplied");
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
44
48
|
console.error("[Note] Using user supplied bearer token ");
|
|
45
49
|
let logonPayload = {
|
|
46
50
|
host: _appContext.VIYA_SERVER,
|