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