@sassoftware/sas-score-mcp-serverjs 1.0.1-30 → 1.0.1-31

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.
Files changed (44) hide show
  1. package/.skills/copilot-instructions.md +11 -4
  2. package/.skills/skills/detail-strategy/SKILL.md +71 -43
  3. package/.skills/skills/list-resource/SKILL.md +5 -5
  4. package/.skills/skills/request-routing/SKILL.md +4 -0
  5. package/.skills/skills/score-strategy/SKILL.md +4 -2
  6. package/README.md +62 -43
  7. package/openApi.yaml +121 -121
  8. package/package.json +7 -5
  9. package/scripts/docs/oauth-http-transport.md +2 -2
  10. package/scripts/refreshtoken.js +57 -57
  11. package/src/createMcpServer.js +0 -1
  12. package/src/openApi.yaml +121 -121
  13. package/src/toolHelpers/_findJob.js +12 -0
  14. package/src/toolHelpers/_findJobdef.js +10 -0
  15. package/src/toolHelpers/_findLibrary.js +10 -0
  16. package/src/toolHelpers/_findModel.js +12 -0
  17. package/src/toolHelpers/_findTable.js +10 -0
  18. package/src/toolHelpers/_listJobs.js +2 -2
  19. package/src/toolSet/devaScore.js +61 -61
  20. package/src/toolSet/findJob.js +2 -1
  21. package/src/toolSet/findJobdef.js +2 -2
  22. package/src/toolSet/findLibrary.js +68 -68
  23. package/src/toolSet/findModel.js +2 -2
  24. package/src/toolSet/findTable.js +2 -2
  25. package/src/toolSet/jobInfo.js +59 -0
  26. package/src/toolSet/jobdefInfo.js +59 -0
  27. package/src/toolSet/listJobdefs.js +61 -61
  28. package/src/toolSet/listJobs.js +61 -61
  29. package/src/toolSet/listLibraries.js +78 -78
  30. package/src/toolSet/listModels.js +56 -56
  31. package/src/toolSet/listTables.js +66 -66
  32. package/src/toolSet/makeTools.js +3 -0
  33. package/src/toolSet/modelInfo.js +1 -1
  34. package/src/toolSet/readTable.js +63 -63
  35. package/src/toolSet/runMacro.js +82 -82
  36. package/src/toolSet/sasQuery.js +77 -77
  37. package/src/toolSet/setContext.js +65 -65
  38. package/src/toolSet/superstat.js +61 -61
  39. package/src/toolSet/tableInfo.js +58 -58
  40. package/scripts/optimize_final.py +0 -140
  41. package/scripts/optimize_tools.py +0 -99
  42. package/scripts/setup-skills.js +0 -34
  43. package/scripts/token.txt +0 -1
  44. package/scripts/update_descriptions.py +0 -46
package/openApi.yaml CHANGED
@@ -1,121 +1,121 @@
1
- swagger: "2.0"
2
- info:
3
- title: SAS Viya Sample MCP Server API
4
- version: "1.0.0"
5
- description: API for interacting with the SAS Viya Sample MCP Server.
6
- host: localhost:8080
7
- basePath: /
8
- schemes:
9
- - http
10
- - https
11
- consumes:
12
- - application/json
13
- produces:
14
- - application/json
15
- paths:
16
- /health:
17
- get:
18
- summary: Health check
19
- description: Returns health and version information.
20
- responses:
21
- 200:
22
- description: Health information
23
- schema:
24
- type: object
25
- properties:
26
- name:
27
- type: string
28
- version:
29
- type: string
30
- description:
31
- type: string
32
- endpoints:
33
- type: object
34
- usage:
35
- type: string
36
- /apiMeta:
37
- get:
38
- summary: API metadata
39
- description: Returns the OpenAPI specification for this server.
40
- responses:
41
- 200:
42
- description: OpenAPI document
43
- schema:
44
- type: object
45
- /mcp:
46
- options:
47
- summary: CORS preflight
48
- description: CORS preflight endpoint.
49
- responses:
50
- 204:
51
- description: No Content
52
- post:
53
- summary: MCP request
54
- description: Handles MCP JSON-RPC requests.
55
- parameters:
56
- - name: body
57
- in: body
58
- required: true
59
- schema:
60
- type: object
61
- - name: Authorization
62
- in: header
63
- required: false
64
- type: string
65
- description: Bearer token for authentication
66
- - name: X-VIYA-SERVER
67
- in: header
68
- required: false
69
- type: string
70
- description: Override VIYA server
71
- - name: X-REFRESH-TOKEN
72
- in: header
73
- required: false
74
- type: string
75
- description: Refresh token for authentication
76
- - name: mcp-session-id
77
- in: header
78
- required: false
79
- type: string
80
- description: Session ID
81
- responses:
82
- 200:
83
- description: MCP response
84
- schema:
85
- type: object
86
- 500:
87
- description: Server error
88
- schema:
89
- type: object
90
- get:
91
- summary: Get MCP session
92
- description: Retrieves information for an MCP session.
93
- parameters:
94
- - name: mcp-session-id
95
- in: header
96
- required: true
97
- type: string
98
- description: Session ID
99
- responses:
100
- 200:
101
- description: Session information
102
- schema:
103
- type: object
104
- 400:
105
- description: Invalid or missing session ID
106
- delete:
107
- summary: Delete MCP session
108
- description: Deletes an MCP session.
109
- parameters:
110
- - name: mcp-session-id
111
- in: header
112
- required: true
113
- type: string
114
- description: Session ID
115
- responses:
116
- 200:
117
- description: Session deleted
118
- schema:
119
- type: object
120
- 400:
121
- description: Invalid or missing session ID
1
+ swagger: "2.0"
2
+ info:
3
+ title: SAS Viya Sample MCP Server API
4
+ version: "1.0.0"
5
+ description: API for interacting with the SAS Viya Sample MCP Server.
6
+ host: localhost:8080
7
+ basePath: /
8
+ schemes:
9
+ - http
10
+ - https
11
+ consumes:
12
+ - application/json
13
+ produces:
14
+ - application/json
15
+ paths:
16
+ /health:
17
+ get:
18
+ summary: Health check
19
+ description: Returns health and version information.
20
+ responses:
21
+ 200:
22
+ description: Health information
23
+ schema:
24
+ type: object
25
+ properties:
26
+ name:
27
+ type: string
28
+ version:
29
+ type: string
30
+ description:
31
+ type: string
32
+ endpoints:
33
+ type: object
34
+ usage:
35
+ type: string
36
+ /apiMeta:
37
+ get:
38
+ summary: API metadata
39
+ description: Returns the OpenAPI specification for this server.
40
+ responses:
41
+ 200:
42
+ description: OpenAPI document
43
+ schema:
44
+ type: object
45
+ /mcp:
46
+ options:
47
+ summary: CORS preflight
48
+ description: CORS preflight endpoint.
49
+ responses:
50
+ 204:
51
+ description: No Content
52
+ post:
53
+ summary: MCP request
54
+ description: Handles MCP JSON-RPC requests.
55
+ parameters:
56
+ - name: body
57
+ in: body
58
+ required: true
59
+ schema:
60
+ type: object
61
+ - name: Authorization
62
+ in: header
63
+ required: false
64
+ type: string
65
+ description: Bearer token for authentication
66
+ - name: X-VIYA-SERVER
67
+ in: header
68
+ required: false
69
+ type: string
70
+ description: Override VIYA server
71
+ - name: X-REFRESH-TOKEN
72
+ in: header
73
+ required: false
74
+ type: string
75
+ description: Refresh token for authentication
76
+ - name: mcp-session-id
77
+ in: header
78
+ required: false
79
+ type: string
80
+ description: Session ID
81
+ responses:
82
+ 200:
83
+ description: MCP response
84
+ schema:
85
+ type: object
86
+ 500:
87
+ description: Server error
88
+ schema:
89
+ type: object
90
+ get:
91
+ summary: Get MCP session
92
+ description: Retrieves information for an MCP session.
93
+ parameters:
94
+ - name: mcp-session-id
95
+ in: header
96
+ required: true
97
+ type: string
98
+ description: Session ID
99
+ responses:
100
+ 200:
101
+ description: Session information
102
+ schema:
103
+ type: object
104
+ 400:
105
+ description: Invalid or missing session ID
106
+ delete:
107
+ summary: Delete MCP session
108
+ description: Deletes an MCP session.
109
+ parameters:
110
+ - name: mcp-session-id
111
+ in: header
112
+ required: true
113
+ type: string
114
+ description: Session ID
115
+ responses:
116
+ 200:
117
+ description: Session deleted
118
+ schema:
119
+ type: object
120
+ 400:
121
+ description: Invalid or missing session ID
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sassoftware/sas-score-mcp-serverjs",
3
- "version": "1.0.1-30",
3
+ "version": "1.0.1-31",
4
4
  "description": "A mcp server for SAS Viya",
5
5
  "author": "Deva Kumar <deva.kumar@sas.com>",
6
6
  "license": "Apache-2.0",
@@ -15,13 +15,15 @@
15
15
  "test": "cd test && node",
16
16
  "debug": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 node --inspect-brk cli.js",
17
17
  "getViyatls": "bash ./scripts/getViyaca.sh",
18
- "deploy": "bash ./deploy.sh",
19
- "push2acr": "cd docker && bash ./push2acr.sh",
18
+ "push2acr": "bash ./push2acr.sh",
19
+ "push2ghcr": "bash ./push2ghcr.sh",
20
20
  "bump": "npm version prerelease",
21
- "pub": "npm publish --tag dev --access public",
22
- "setup-skills": "node scripts/setup-skills.js"
21
+ "pub": "npm publish --tag dev --access public"
23
22
  },
24
23
  "repository": "https://github.com/sassoftware/sas-score-mcp-serverjs",
24
+ "bugs": {
25
+ "url": "https://github.com/sassoftware/sas-score-mcp-serverjs/issues"
26
+ },
25
27
  "keywords": [
26
28
  "SAS Viya",
27
29
  "mcp-serverjs",
@@ -5,7 +5,7 @@
5
5
 
6
6
  TBD
7
7
 
8
- ## VSCODE Githu Copilot
8
+ ## VSCODE Github Copilot
9
9
 
10
10
  ### Scenario:
11
11
 
@@ -35,7 +35,7 @@ It appears that the / at the end of the redirect URI is important]
35
35
  }
36
36
  ```
37
37
 
38
- ### pkce clientid when mcp server does teh oauth flow
38
+ ### pkce clientid when mcp server does the oauth flow
39
39
 
40
40
  ```js
41
41
 
@@ -1,58 +1,58 @@
1
- /*
2
- * Copyright © 2025, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
- import { Agent, fetch } from 'undici';
6
- import fs from "fs";
7
-
8
- refreshToken()
9
- .then (token => {
10
- console.log(token);
11
- fs.writeFileSync('token.txt', token, 'utf8');
12
- })
13
- .catch (err => {
14
- console.error('[Error] Failed to refresh token: ', err);
15
- });
16
- async function refreshToken(){
17
- let host = process.env.VIYA_SERVER;
18
- let token = "8afd75c0df5141b1a1d27dfe9db06fa5-r";
19
- let url = `${host}/SASLogon/oauth/token`;
20
-
21
- let aconnect = {
22
- rejectUnauthorized: false // or false, if you really want to bypass checks
23
- }
24
-
25
- const agent = new Agent(aconnect);
26
-
27
- console.error('[Info] Refreshing token...', token);
28
- const ibody = {
29
- grant_type: 'refresh_token',
30
- refresh_token: token,
31
- client_id: 'sas.cli'
32
- };
33
-
34
- let body = new URLSearchParams(ibody);
35
- try {
36
- const response = await fetch(url, {
37
- method: 'POST',
38
- headers: {
39
- 'Accept': 'application/json',
40
- 'Content-Type': 'application/x-www-form-urlencoded',
41
- dispatcher: agent
42
- },
43
- body: body.toString()
44
- });
45
-
46
- if (!response.ok) {
47
- const error = await response.text();
48
- console.error('[Error] Failed to refresh token: ', error);
49
- throw new Error(error);
50
- }
51
-
52
- const data = await response.json();
53
- return data.access_token;
54
- } catch (err) {
55
- console.error('[Error] Failed to refresh token: ', err);
56
- throw err;
57
- }
1
+ /*
2
+ * Copyright © 2025, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { Agent, fetch } from 'undici';
6
+ import fs from "fs";
7
+
8
+ refreshToken()
9
+ .then (token => {
10
+ console.log(token);
11
+ fs.writeFileSync('token.txt', `"AUTHORIZATION": "Bearer ${token}"`, 'utf8');
12
+ })
13
+ .catch (err => {
14
+ console.error('[Error] Failed to refresh token: ', err);
15
+ });
16
+ async function refreshToken(){
17
+ let host = process.env.VIYA_SERVER;
18
+ let token = process.env.REFRESH_TOKEN;
19
+ let url = `${host}/SASLogon/oauth/token`;
20
+
21
+ let aconnect = {
22
+ rejectUnauthorized: false // or false, if you really want to bypass checks
23
+ }
24
+
25
+ const agent = new Agent(aconnect);
26
+
27
+ console.error('[Info] Refreshing token...', token);
28
+ const ibody = {
29
+ grant_type: 'refresh_token',
30
+ refresh_token: token,
31
+ client_id: 'sas.cli'
32
+ };
33
+
34
+ let body = new URLSearchParams(ibody);
35
+ try {
36
+ const response = await fetch(url, {
37
+ method: 'POST',
38
+ headers: {
39
+ 'Accept': 'application/json',
40
+ 'Content-Type': 'application/x-www-form-urlencoded',
41
+ dispatcher: agent
42
+ },
43
+ body: body.toString()
44
+ });
45
+
46
+ if (!response.ok) {
47
+ const error = await response.text();
48
+ console.error('[Error] Failed to refresh token: ', error);
49
+ throw new Error(error);
50
+ }
51
+
52
+ const data = await response.json();
53
+ return data.access_token;
54
+ } catch (err) {
55
+ console.error('[Error] Failed to refresh token: ', err);
56
+ throw err;
57
+ }
58
58
  }
@@ -86,7 +86,6 @@ async function createMcpServer(cache, _appContext) {
86
86
  inputSchema: tool.inputSchema
87
87
  }
88
88
  let toolHandler = wrapf(cache, tool.handler);
89
- // console.error(`[Note] Registering tool ${toolName} with config: ${JSON.stringify(config)}`);
90
89
  let r = mcpServer.registerTool(toolName, config, toolHandler);
91
90
  toolNames.push(toolName);
92
91
  });
package/src/openApi.yaml CHANGED
@@ -1,121 +1,121 @@
1
- swagger: "2.0"
2
- info:
3
- title: SAS Viya Sample MCP Server API
4
- version: "1.0.0"
5
- description: API for interacting with the SAS Viya Sample MCP Server.
6
- host: localhost:8080
7
- basePath: /
8
- schemes:
9
- - http
10
- - https
11
- consumes:
12
- - application/json
13
- produces:
14
- - application/json
15
- paths:
16
- /health:
17
- get:
18
- summary: Health check
19
- description: Returns health and version information.
20
- responses:
21
- 200:
22
- description: Health information
23
- schema:
24
- type: object
25
- properties:
26
- name:
27
- type: string
28
- version:
29
- type: string
30
- description:
31
- type: string
32
- endpoints:
33
- type: object
34
- usage:
35
- type: string
36
- /apiMeta:
37
- get:
38
- summary: API metadata
39
- description: Returns the OpenAPI specification for this server.
40
- responses:
41
- 200:
42
- description: OpenAPI document
43
- schema:
44
- type: object
45
- /mcp:
46
- options:
47
- summary: CORS preflight
48
- description: CORS preflight endpoint.
49
- responses:
50
- 204:
51
- description: No Content
52
- post:
53
- summary: MCP request
54
- description: Handles MCP JSON-RPC requests.
55
- parameters:
56
- - name: body
57
- in: body
58
- required: true
59
- schema:
60
- type: object
61
- - name: Authorization
62
- in: header
63
- required: false
64
- type: string
65
- description: Bearer token for authentication
66
- - name: X-VIYA-SERVER
67
- in: header
68
- required: false
69
- type: string
70
- description: Override VIYA server
71
- - name: X-REFRESH-TOKEN
72
- in: header
73
- required: false
74
- type: string
75
- description: Refresh token for authentication
76
- - name: mcp-session-id
77
- in: header
78
- required: false
79
- type: string
80
- description: Session ID
81
- responses:
82
- 200:
83
- description: MCP response
84
- schema:
85
- type: object
86
- 500:
87
- description: Server error
88
- schema:
89
- type: object
90
- get:
91
- summary: Get MCP session
92
- description: Retrieves information for an MCP session.
93
- parameters:
94
- - name: mcp-session-id
95
- in: header
96
- required: true
97
- type: string
98
- description: Session ID
99
- responses:
100
- 200:
101
- description: Session information
102
- schema:
103
- type: object
104
- 400:
105
- description: Invalid or missing session ID
106
- delete:
107
- summary: Delete MCP session
108
- description: Deletes an MCP session.
109
- parameters:
110
- - name: mcp-session-id
111
- in: header
112
- required: true
113
- type: string
114
- description: Session ID
115
- responses:
116
- 200:
117
- description: Session deleted
118
- schema:
119
- type: object
120
- 400:
121
- description: Invalid or missing session ID
1
+ swagger: "2.0"
2
+ info:
3
+ title: SAS Viya Sample MCP Server API
4
+ version: "1.0.0"
5
+ description: API for interacting with the SAS Viya Sample MCP Server.
6
+ host: localhost:8080
7
+ basePath: /
8
+ schemes:
9
+ - http
10
+ - https
11
+ consumes:
12
+ - application/json
13
+ produces:
14
+ - application/json
15
+ paths:
16
+ /health:
17
+ get:
18
+ summary: Health check
19
+ description: Returns health and version information.
20
+ responses:
21
+ 200:
22
+ description: Health information
23
+ schema:
24
+ type: object
25
+ properties:
26
+ name:
27
+ type: string
28
+ version:
29
+ type: string
30
+ description:
31
+ type: string
32
+ endpoints:
33
+ type: object
34
+ usage:
35
+ type: string
36
+ /apiMeta:
37
+ get:
38
+ summary: API metadata
39
+ description: Returns the OpenAPI specification for this server.
40
+ responses:
41
+ 200:
42
+ description: OpenAPI document
43
+ schema:
44
+ type: object
45
+ /mcp:
46
+ options:
47
+ summary: CORS preflight
48
+ description: CORS preflight endpoint.
49
+ responses:
50
+ 204:
51
+ description: No Content
52
+ post:
53
+ summary: MCP request
54
+ description: Handles MCP JSON-RPC requests.
55
+ parameters:
56
+ - name: body
57
+ in: body
58
+ required: true
59
+ schema:
60
+ type: object
61
+ - name: Authorization
62
+ in: header
63
+ required: false
64
+ type: string
65
+ description: Bearer token for authentication
66
+ - name: X-VIYA-SERVER
67
+ in: header
68
+ required: false
69
+ type: string
70
+ description: Override VIYA server
71
+ - name: X-REFRESH-TOKEN
72
+ in: header
73
+ required: false
74
+ type: string
75
+ description: Refresh token for authentication
76
+ - name: mcp-session-id
77
+ in: header
78
+ required: false
79
+ type: string
80
+ description: Session ID
81
+ responses:
82
+ 200:
83
+ description: MCP response
84
+ schema:
85
+ type: object
86
+ 500:
87
+ description: Server error
88
+ schema:
89
+ type: object
90
+ get:
91
+ summary: Get MCP session
92
+ description: Retrieves information for an MCP session.
93
+ parameters:
94
+ - name: mcp-session-id
95
+ in: header
96
+ required: true
97
+ type: string
98
+ description: Session ID
99
+ responses:
100
+ 200:
101
+ description: Session information
102
+ schema:
103
+ type: object
104
+ 400:
105
+ description: Invalid or missing session ID
106
+ delete:
107
+ summary: Delete MCP session
108
+ description: Deletes an MCP session.
109
+ parameters:
110
+ - name: mcp-session-id
111
+ in: header
112
+ required: true
113
+ type: string
114
+ description: Session ID
115
+ responses:
116
+ 200:
117
+ description: Session deleted
118
+ schema:
119
+ type: object
120
+ 400:
121
+ description: Invalid or missing session ID
@@ -0,0 +1,12 @@
1
+ /*
2
+ * Copyright © 2025, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ import _listJobs from './_listJobs.js';
7
+ async function _findJob(params) {
8
+ let r = await _listJobs(params);
9
+ console.log ("findJob result:" , r);
10
+ return r;
11
+ }
12
+ export default _findJob;
@@ -0,0 +1,10 @@
1
+ /*
2
+ * Copyright © 2025, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ import _listJobdefs from './_listJobdefs.js';
7
+ async function _findJobdef(params) {
8
+ return await _listJobdefs(params);
9
+ }
10
+ export default _findJobdef;