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