@sassoftware/sas-score-mcp-serverjs 0.3.12 → 0.3.14
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/package.json +1 -1
- package/src/expressMcpServer.js +5 -2
- package/src/openAPIJson.js +12 -12
package/package.json
CHANGED
package/src/expressMcpServer.js
CHANGED
|
@@ -160,6 +160,7 @@ const handleRequest = async (req, res) => {
|
|
|
160
160
|
console.error("[Note] Using existing transport for session ID:", sessionId);
|
|
161
161
|
|
|
162
162
|
await transport.handleRequest(req, res, req.body);
|
|
163
|
+
return;
|
|
163
164
|
}
|
|
164
165
|
|
|
165
166
|
// initialize request
|
|
@@ -169,8 +170,10 @@ const handleRequest = async (req, res) => {
|
|
|
169
170
|
transport = new StreamableHTTPServerTransport({
|
|
170
171
|
sessionIdGenerator: () => randomUUID(),
|
|
171
172
|
enableJsonResponse: true,
|
|
173
|
+
enableDnsRebindingProtection: true,
|
|
172
174
|
onsessioninitialized: (sessionId) => {
|
|
173
175
|
// Store the transport by session ID
|
|
176
|
+
console.error("++++++++++++++++++++++++++++++ Transport initialized with ID:", sessionId);
|
|
174
177
|
transports[sessionId] = transport;
|
|
175
178
|
},
|
|
176
179
|
});
|
|
@@ -186,9 +189,9 @@ const handleRequest = async (req, res) => {
|
|
|
186
189
|
await mcpServer.connect(transport);
|
|
187
190
|
|
|
188
191
|
// Save transport data and app context for use in tools
|
|
189
|
-
console.error('connected
|
|
192
|
+
console.error('connected mcpServer');
|
|
190
193
|
cache.set("transports", transports);
|
|
191
|
-
await transport.handleRequest(req, res, req.body);
|
|
194
|
+
return await transport.handleRequest(req, res, req.body);
|
|
192
195
|
// cache transport
|
|
193
196
|
|
|
194
197
|
}
|
package/src/openAPIJson.js
CHANGED
|
@@ -7,7 +7,7 @@ function openAPIJson(version) {
|
|
|
7
7
|
"swagger": "2.0",
|
|
8
8
|
"info": {
|
|
9
9
|
"title": "sas-score-mcp-serverjs API",
|
|
10
|
-
"version":
|
|
10
|
+
"version": "1.0.0",
|
|
11
11
|
"description": "sas-score-mcp-serverjs is a mcp server for SAS Viya"
|
|
12
12
|
},
|
|
13
13
|
"host": "localhost:8080",
|
|
@@ -17,9 +17,9 @@ function openAPIJson(version) {
|
|
|
17
17
|
"produces": ["application/json"],
|
|
18
18
|
"paths": {
|
|
19
19
|
"/health": {
|
|
20
|
-
"
|
|
20
|
+
"get": {
|
|
21
21
|
"summary": "Health check",
|
|
22
|
-
"operationId": "
|
|
22
|
+
"operationId": "getHealth",
|
|
23
23
|
"description": "Returns health and version information.",
|
|
24
24
|
"responses": {
|
|
25
25
|
"200": {
|
|
@@ -39,7 +39,7 @@ function openAPIJson(version) {
|
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
"/apiMeta": {
|
|
42
|
-
"
|
|
42
|
+
"get": {
|
|
43
43
|
"summary": "API metadata using apiMeta",
|
|
44
44
|
"operationId": "GetApiMeta",
|
|
45
45
|
"responses": {
|
|
@@ -50,8 +50,8 @@ function openAPIJson(version) {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
|
-
|
|
54
|
-
"
|
|
53
|
+
"/openapi.json": {
|
|
54
|
+
"get": {
|
|
55
55
|
"summary": "API metadata using openapi.json",
|
|
56
56
|
"operationId": "GetOpenApiJson",
|
|
57
57
|
"description": "Returns the OpenAPI specification for this server.",
|
|
@@ -64,7 +64,7 @@ function openAPIJson(version) {
|
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
"/mcp": {
|
|
67
|
-
"
|
|
67
|
+
"options": {
|
|
68
68
|
"summary": "CORS preflight",
|
|
69
69
|
"operationId": "OptionsMcp",
|
|
70
70
|
"description": "CORS preflight endpoint.",
|
|
@@ -72,7 +72,7 @@ function openAPIJson(version) {
|
|
|
72
72
|
"204": { "description": "No Content" }
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
|
-
"
|
|
75
|
+
"post": {
|
|
76
76
|
"summary": "MCP request",
|
|
77
77
|
"operationId": "PostMcp",
|
|
78
78
|
"parameters": [
|
|
@@ -122,8 +122,8 @@ function openAPIJson(version) {
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
},
|
|
125
|
-
"
|
|
126
|
-
"summary": "
|
|
125
|
+
"get": {
|
|
126
|
+
"summary": "get MCP session",
|
|
127
127
|
"operationId": "GetMcp",
|
|
128
128
|
"description": "Retrieves information for an MCP session.",
|
|
129
129
|
"parameters": [
|
|
@@ -145,7 +145,7 @@ function openAPIJson(version) {
|
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
},
|
|
148
|
-
"
|
|
148
|
+
"delete": {
|
|
149
149
|
"summary": "Delete MCP session",
|
|
150
150
|
"operationId": "DeleteMcp",
|
|
151
151
|
"parameters": [
|
|
@@ -169,7 +169,7 @@ function openAPIJson(version) {
|
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
-
}
|
|
172
|
+
}
|
|
173
173
|
spec.info.version = version;
|
|
174
174
|
return spec;
|
|
175
175
|
};
|