@sassoftware/sas-score-mcp-serverjs 0.3.3 → 0.3.4

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/openAPIJson.js +141 -101
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sassoftware/sas-score-mcp-serverjs",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "A mcp server for SAS Viya",
5
5
  "author": "Deva Kumar <deva.kumar@sas.com>",
6
6
  "license": "Apache-2.0",
@@ -2,116 +2,156 @@
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
- let spec =
7
- {
8
- "swagger": "2.0",
9
- "info": {
10
- "title": "SAS Viya Sample MCP Server",
11
- "version": "1.0.0",
12
- "description": "OpenAPI 2.0 spec for the SAS Viya Sample MCP Server"
13
- },
14
- "host": "localhost:8080",
15
- "schemes": ["http", "https"],
16
- "basePath": "/",
17
- "paths": {
18
- "/health": {
19
- "get": {
20
- "summary": "Health check endpoint",
21
- "description": "Returns server health and metadata",
22
- "produces": ["application/json"],
23
- "responses": {
24
- "200": {
25
- "description": "Health info",
26
- "schema": { "type": "object" }
27
- }
28
- }
29
- }
5
+ export default function openAPIJson() {
6
+ return {
7
+ swagger: "2.0",
8
+ info: {
9
+ title: "SAS Viya Sample MCP Server API",
10
+ version: "1.0.0",
11
+ description: "API for interacting with the SAS Viya Sample MCP Server."
30
12
  },
31
- "/": {
32
- "get": {
33
- "summary": "Root endpoint",
34
- "description": "Returns server info and usage",
35
- "produces": ["application/json"],
36
- "responses": {
37
- "200": {
38
- "description": "Server info",
39
- "schema": { "type": "object" }
13
+ host: "localhost:8080",
14
+ basePath: "/",
15
+ schemes: ["http", "https"],
16
+ consumes: ["application/json"],
17
+ produces: ["application/json"],
18
+ paths: {
19
+ "/health": {
20
+ get: {
21
+ summary: "Health check",
22
+ description: "Returns health and version information.",
23
+ responses: {
24
+ 200: {
25
+ description: "Health information",
26
+ schema: {
27
+ type: "object",
28
+ properties: {
29
+ name: { type: "string" },
30
+ version: { type: "string" },
31
+ description: { type: "string" },
32
+ endpoints: { type: "object" },
33
+ usage: { type: "string" }
34
+ }
35
+ }
36
+ }
40
37
  }
41
38
  }
42
- }
43
- },
44
- "/mcp": {
45
- "get": {
46
- "summary": "MCP endpoint (GET)",
47
- "description": "Handles MCP protocol requests (GET)",
48
- "produces": ["application/json"],
49
- "parameters": [
50
- {
51
- "name": "Authorization",
52
- "in": "header",
53
- "type": "string",
54
- "required": false
55
- }
56
- ],
57
- "responses": {
58
- "200": {
59
- "description": "MCP response",
60
- "schema": { "type": "object" }
39
+ },
40
+ "/apiMeta": {
41
+ get: {
42
+ summary: "API metadata",
43
+ description: "Returns the OpenAPI specification for this server.",
44
+ responses: {
45
+ 200: {
46
+ description: "OpenAPI document",
47
+ schema: { type: "object" }
48
+ }
61
49
  }
62
50
  }
63
51
  },
64
- "post": {
65
- "summary": "MCP endpoint (POST)",
66
- "description": "Handles MCP protocol requests (POST)",
67
- "consumes": ["application/json"],
68
- "produces": ["application/json"],
69
- "parameters": [
70
- {
71
- "name": "Authorization",
72
- "in": "header",
73
- "type": "string",
74
- "required": false
75
- },
76
- {
77
- "name": "X-VIYA-SERVER",
78
- "in": "header",
79
- "type": "string",
80
- "required": false
81
- },
82
- {
83
- "name": "X-REFRESH-TOKEN",
84
- "in": "header",
85
- "type": "string",
86
- "required": false
87
- },
88
- {
89
- "name": "body",
90
- "in": "body",
91
- "schema": { "type": "object" }
52
+ "/mcp": {
53
+ options: {
54
+ summary: "CORS preflight",
55
+ description: "CORS preflight endpoint.",
56
+ responses: {
57
+ 204: { description: "No Content" }
92
58
  }
93
- ],
94
- "responses": {
95
- "200": {
96
- "description": "MCP response",
97
- "schema": { "type": "object" }
59
+ },
60
+ post: {
61
+ summary: "MCP request",
62
+ description: "Handles MCP JSON-RPC requests.",
63
+ parameters: [
64
+ {
65
+ name: "body",
66
+ in: "body",
67
+ required: true,
68
+ schema: { type: "object" }
69
+ },
70
+ {
71
+ name: "Authorization",
72
+ in: "header",
73
+ required: false,
74
+ type: "string",
75
+ description: "Bearer token for authentication"
76
+ },
77
+ {
78
+ name: "X-VIYA-SERVER",
79
+ in: "header",
80
+ required: false,
81
+ type: "string",
82
+ description: "Override VIYA server"
83
+ },
84
+ {
85
+ name: "X-REFRESH-TOKEN",
86
+ in: "header",
87
+ required: false,
88
+ type: "string",
89
+ description: "Refresh token for authentication"
90
+ },
91
+ {
92
+ name: "mcp-session-id",
93
+ in: "header",
94
+ required: false,
95
+ type: "string",
96
+ description: "Session ID"
97
+ }
98
+ ],
99
+ responses: {
100
+ 200: {
101
+ description: "MCP response",
102
+ schema: { type: "object" }
103
+ },
104
+ 500: {
105
+ description: "Server error",
106
+ schema: { type: "object" }
107
+ }
98
108
  }
99
- }
100
- },
101
- "options": {
102
- "summary": "CORS preflight",
103
- "description": "CORS preflight for MCP endpoint",
104
- "responses": {
105
- "204": {
106
- "description": "No Content"
109
+ },
110
+ get: {
111
+ summary: "Get MCP session",
112
+ description: "Retrieves information for an MCP session.",
113
+ parameters: [
114
+ {
115
+ name: "mcp-session-id",
116
+ in: "header",
117
+ required: true,
118
+ type: "string",
119
+ description: "Session ID"
120
+ }
121
+ ],
122
+ responses: {
123
+ 200: {
124
+ description: "Session information",
125
+ schema: { type: "object" }
126
+ },
127
+ 400: {
128
+ description: "Invalid or missing session ID"
129
+ }
130
+ }
131
+ },
132
+ delete: {
133
+ summary: "Delete MCP session",
134
+ description: "Deletes an MCP session.",
135
+ parameters: [
136
+ {
137
+ name: "mcp-session-id",
138
+ in: "header",
139
+ required: true,
140
+ type: "string",
141
+ description: "Session ID"
142
+ }
143
+ ],
144
+ responses: {
145
+ 200: {
146
+ description: "Session deleted",
147
+ schema: { type: "object" }
148
+ },
149
+ 400: {
150
+ description: "Invalid or missing session ID"
151
+ }
107
152
  }
108
153
  }
109
154
  }
110
155
  }
111
- }
112
- };
113
-
114
- return spec;
115
- }
116
-
117
- export default openAPIJson;
156
+ };
157
+ }