@sassoftware/sas-score-mcp-serverjs 0.0.2

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 (96) hide show
  1. package/.babelrc +6 -0
  2. package/.env +13 -0
  3. package/.env.http +29 -0
  4. package/CHANGES.md +2 -0
  5. package/CONTRIBUTING.md +14 -0
  6. package/ContributorAgreement.txt +56 -0
  7. package/LICENSE +205 -0
  8. package/LICENSES.json +105 -0
  9. package/QUICK_REFERENCE.md +378 -0
  10. package/README.md +267 -0
  11. package/SECURITY.md +31 -0
  12. package/SUPPORT.md +3 -0
  13. package/TOOL_DESCRIPTION_TEMPLATE.md +157 -0
  14. package/TOOL_UPDATES_SUMMARY.md +208 -0
  15. package/cli.js +214 -0
  16. package/labs/.subclass.json +13 -0
  17. package/labs/README.md +4 -0
  18. package/mcpConfigurations/README.md +3 -0
  19. package/mcpConfigurations/http.json +8 -0
  20. package/mcpConfigurations/stdio.json +20 -0
  21. package/mcpConfigurations/stdiodev.json +20 -0
  22. package/mcpserver.png +0 -0
  23. package/openApi.json +106 -0
  24. package/openApi.yaml +84 -0
  25. package/package.json +72 -0
  26. package/sas-mcp-tools-reference.md +600 -0
  27. package/sasCode/sas-sql-query.sas +33 -0
  28. package/sasCode/sas_sql_tool.json +237 -0
  29. package/scripts/getViyaca.sh +8 -0
  30. package/src/core.js +19 -0
  31. package/src/coreSSE.js +14 -0
  32. package/src/corehttp.js +335 -0
  33. package/src/createHttpTransport.js +26 -0
  34. package/src/createMcpServer.js +76 -0
  35. package/src/db/scrModels.js +23 -0
  36. package/src/toolSet/devaScore.js +69 -0
  37. package/src/toolSet/findJob.js +90 -0
  38. package/src/toolSet/findJobdef.js +95 -0
  39. package/src/toolSet/findLibrary.js +100 -0
  40. package/src/toolSet/findModel.js +83 -0
  41. package/src/toolSet/findTable.js +94 -0
  42. package/src/toolSet/getEnv.js +72 -0
  43. package/src/toolSet/listJobdefs.js +96 -0
  44. package/src/toolSet/listJobs.js +110 -0
  45. package/src/toolSet/listLibraries.js +90 -0
  46. package/src/toolSet/listModels.js +83 -0
  47. package/src/toolSet/listTables.js +95 -0
  48. package/src/toolSet/makeTools.js +75 -0
  49. package/src/toolSet/mcp server .png +0 -0
  50. package/src/toolSet/modelInfo.js +87 -0
  51. package/src/toolSet/modelScore.js +131 -0
  52. package/src/toolSet/readTable.js +104 -0
  53. package/src/toolSet/runCasProgram.js +118 -0
  54. package/src/toolSet/runJob.js +81 -0
  55. package/src/toolSet/runJobdef.js +85 -0
  56. package/src/toolSet/runMacro.js +82 -0
  57. package/src/toolSet/runProgram.js +145 -0
  58. package/src/toolSet/sasQuery.js +126 -0
  59. package/src/toolSet/sasQueryTemplate.js +148 -0
  60. package/src/toolSet/sasQueryTemplate2.js +140 -0
  61. package/src/toolSet/scrInfo.js +55 -0
  62. package/src/toolSet/scrScore.js +71 -0
  63. package/src/toolSet/searchAssets.js +52 -0
  64. package/src/toolSet/setContext.js +98 -0
  65. package/src/toolSet/superstat.js +60 -0
  66. package/src/toolSet/tableInfo.js +102 -0
  67. package/src/toolhelpers/_catalogSearch.js +87 -0
  68. package/src/toolhelpers/_getEnv.js +10 -0
  69. package/src/toolhelpers/_itemsData.js +28 -0
  70. package/src/toolhelpers/_jobSubmit.js +78 -0
  71. package/src/toolhelpers/_listJobdefs.js +59 -0
  72. package/src/toolhelpers/_listJobs.js +63 -0
  73. package/src/toolhelpers/_listLibrary.js +56 -0
  74. package/src/toolhelpers/_listModels.js +41 -0
  75. package/src/toolhelpers/_listTables.js +52 -0
  76. package/src/toolhelpers/_masDescribe.js +27 -0
  77. package/src/toolhelpers/_masScoring.js +64 -0
  78. package/src/toolhelpers/_readTable.js +69 -0
  79. package/src/toolhelpers/_scrInfo.js +32 -0
  80. package/src/toolhelpers/_scrScore.js +49 -0
  81. package/src/toolhelpers/_submitCasl.js +34 -0
  82. package/src/toolhelpers/_submitCode.js +96 -0
  83. package/src/toolhelpers/_submitMacro.js +24 -0
  84. package/src/toolhelpers/_tableColumns.js +61 -0
  85. package/src/toolhelpers/_tableInfo.js +72 -0
  86. package/src/toolhelpers/deleteSession.js +13 -0
  87. package/src/toolhelpers/getLogonPayload.js +100 -0
  88. package/src/toolhelpers/getOpts.js +43 -0
  89. package/src/toolhelpers/getOptsViya.js +38 -0
  90. package/src/toolhelpers/getStoreOpts.js +18 -0
  91. package/src/toolhelpers/getToken.js +40 -0
  92. package/src/toolhelpers/refreshToken.js +48 -0
  93. package/test/README.md +63 -0
  94. package/test/listLibraries.test.js +245 -0
  95. package/tool-developer-guide.md +80 -0
  96. package/types.js +25 -0
package/openApi.json ADDED
@@ -0,0 +1,106 @@
1
+ {
2
+ "swagger": "2.0",
3
+ "info": {
4
+ "title": "SAS Viya Sample MCP Server",
5
+ "version": "1.0.0",
6
+ "description": "OpenAPI 2.0 spec for the SAS Viya Sample MCP Server"
7
+ },
8
+ "host": "localhost:8080",
9
+ "schemes": ["http", "https"],
10
+ "basePath": "/",
11
+ "paths": {
12
+ "/health": {
13
+ "get": {
14
+ "summary": "Health check endpoint",
15
+ "description": "Returns server health and metadata",
16
+ "produces": ["application/json"],
17
+ "responses": {
18
+ "200": {
19
+ "description": "Health info",
20
+ "schema": { "type": "object" }
21
+ }
22
+ }
23
+ }
24
+ },
25
+ "/": {
26
+ "get": {
27
+ "summary": "Root endpoint",
28
+ "description": "Returns server info and usage",
29
+ "produces": ["application/json"],
30
+ "responses": {
31
+ "200": {
32
+ "description": "Server info",
33
+ "schema": { "type": "object" }
34
+ }
35
+ }
36
+ }
37
+ },
38
+ "/mcp": {
39
+ "get": {
40
+ "summary": "MCP endpoint (GET)",
41
+ "description": "Handles MCP protocol requests (GET)",
42
+ "produces": ["application/json"],
43
+ "parameters": [
44
+ {
45
+ "name": "Authorization",
46
+ "in": "header",
47
+ "type": "string",
48
+ "required": false
49
+ }
50
+ ],
51
+ "responses": {
52
+ "200": {
53
+ "description": "MCP response",
54
+ "schema": { "type": "object" }
55
+ }
56
+ }
57
+ },
58
+ "post": {
59
+ "summary": "MCP endpoint (POST)",
60
+ "description": "Handles MCP protocol requests (POST)",
61
+ "consumes": ["application/json"],
62
+ "produces": ["application/json"],
63
+ "parameters": [
64
+ {
65
+ "name": "Authorization",
66
+ "in": "header",
67
+ "type": "string",
68
+ "required": false
69
+ },
70
+ {
71
+ "name": "X-VIYA-SERVER",
72
+ "in": "header",
73
+ "type": "string",
74
+ "required": false
75
+ },
76
+ {
77
+ "name": "X-REFRESH-TOKEN",
78
+ "in": "header",
79
+ "type": "string",
80
+ "required": false
81
+ },
82
+ {
83
+ "name": "body",
84
+ "in": "body",
85
+ "schema": { "type": "object" }
86
+ }
87
+ ],
88
+ "responses": {
89
+ "200": {
90
+ "description": "MCP response",
91
+ "schema": { "type": "object" }
92
+ }
93
+ }
94
+ },
95
+ "options": {
96
+ "summary": "CORS preflight",
97
+ "description": "CORS preflight for MCP endpoint",
98
+ "responses": {
99
+ "204": {
100
+ "description": "No Content"
101
+ }
102
+ }
103
+ }
104
+ }
105
+ }
106
+ }
package/openApi.yaml ADDED
@@ -0,0 +1,84 @@
1
+ swagger: "2.0"
2
+ info:
3
+ title: SAS Viya Sample MCP Server
4
+ version: "1.0.0"
5
+ description: OpenAPI 2.0 spec for the SAS Viya MCP Server
6
+ host: localhost:8080
7
+ schemes:
8
+ - http
9
+ - https
10
+ basePath: /
11
+ paths:
12
+ /health:
13
+ get:
14
+ summary: Health check endpoint
15
+ description: Returns server health and metadata
16
+ produces:
17
+ - application/json
18
+ responses:
19
+ "200":
20
+ description: Health info
21
+ schema:
22
+ type: object
23
+ /:
24
+ get:
25
+ summary: Root endpoint
26
+ description: Returns server info and usage
27
+ produces:
28
+ - application/json
29
+ responses:
30
+ "200":
31
+ description: Server info
32
+ schema:
33
+ type: object
34
+ /mcp:
35
+ get:
36
+ summary: MCP endpoint (GET)
37
+ description: Handles MCP protocol requests (GET)
38
+ produces:
39
+ - application/json
40
+ parameters:
41
+ - name: Authorization
42
+ in: header
43
+ type: string
44
+ required: false
45
+ responses:
46
+ "200":
47
+ description: MCP response
48
+ schema:
49
+ type: object
50
+ post:
51
+ summary: MCP endpoint (POST)
52
+ description: Handles MCP protocol requests (POST)
53
+ consumes:
54
+ - application/json
55
+ produces:
56
+ - application/json
57
+ parameters:
58
+ - name: Authorization
59
+ in: header
60
+ type: string
61
+ required: false
62
+ - name: X-VIYA-SERVER
63
+ in: header
64
+ type: string
65
+ required: false
66
+ - name: X-REFRESH-TOKEN
67
+ in: header
68
+ type: string
69
+ required: false
70
+ - name: body
71
+ in: body
72
+ schema:
73
+ type: object
74
+ responses:
75
+ "200":
76
+ description: MCP response
77
+ schema:
78
+ type: object
79
+ options:
80
+ summary: CORS preflight
81
+ description: CORS preflight for MCP endpoint
82
+ responses:
83
+ "204":
84
+ description: No Content
package/package.json ADDED
@@ -0,0 +1,72 @@
1
+ {
2
+ "name": "@sassoftware/sas-score-mcp-serverjs",
3
+ "version": "0.0.2",
4
+ "description": "A mcp server for SAS Viya",
5
+ "author": "Deva Kumar <deva.kumar@sas.com>",
6
+ "license": "Apache-2.0",
7
+ "engines": {
8
+ "node": ">=22.16.0",
9
+ "npm": ">=10.9.2"
10
+ },
11
+ "type": "module",
12
+ "scripts": {
13
+ "start": "npx dotenv-cli -e .env -- node cli.js",
14
+ "testi": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 npx @modelcontextprotocol/inspector",
15
+ "test": "cd test && node",
16
+ "debug": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 node --inspect-brk cli.js",
17
+ "getViyatls": "bash ./scripts/getViyaca.sh",
18
+ "deploy": "bash ./deploy.sh",
19
+ "push2acr": "bash ./push2acr.sh",
20
+ "bump": "npm version prerelease",
21
+ "pub": "npm publish --tag alpha --access public"
22
+ },
23
+ "repository": "https://github.com/sassoftware/sas-score-mcp-serverjs",
24
+ "keywords": [
25
+ "SAS Viya",
26
+ "mcp-serverjs",
27
+ "Agentic AI",
28
+ "Viya actions",
29
+ "restaf",
30
+ "restafedit",
31
+ "restaflib",
32
+ "model context protocol"
33
+ ],
34
+ "main": "./cli.js",
35
+ "bin": {
36
+ "@sassoftware/sas-score-mcp-serverjs": "./cli.js"
37
+ },
38
+ "dependencies": {
39
+ "@modelcontextprotocol/sdk": "^1.25.1",
40
+ "@sassoftware/restaf": "^5.6.0",
41
+ "@sassoftware/restafedit": "^3.11.1-10",
42
+ "@sassoftware/restaflib": "^5.6.0",
43
+ "axios": "^1.13.2",
44
+ "body-parser": "^2.2.1",
45
+ "cors": "^2.8.5",
46
+ "cross-env": "^10.1.0",
47
+ "debug": "^4.4.3",
48
+ "dotenv": "^17.2.3",
49
+ "dotenv-expand": "^12.0.3",
50
+ "express": "^5.2.1",
51
+ "express-list-endpoints": "^7.1.1",
52
+ "express-rate-limit": "^8.2.1",
53
+ "helmet": "^8.1.0",
54
+ "mcp-framework": "^0.2.16",
55
+ "node-cache": "^5.1.2",
56
+ "selfsigned": "^5.2.0",
57
+ "undici": "^7.16.0",
58
+ "uuid": "^13.0.0",
59
+ "zod": "^4.2.1"
60
+ },
61
+ "devDependencies": {
62
+ "@babel/cli": "^7.28.3",
63
+ "@babel/core": "^7.28.5",
64
+ "@babel/eslint-parser": "^7.28.5",
65
+ "@babel/preset-env": "^7.28.5",
66
+ "@types/debug": "^4.1.12",
67
+ "@types/node": "^25.0.3",
68
+ "npm-check-updates": "^19.2.0",
69
+ "rimraf": "^6.1.2",
70
+ "typescript": "^5.9.3"
71
+ }
72
+ }