@sassoftware/sas-score-mcp-serverjs 0.4.1-1 → 0.4.1-15
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/cli.js +111 -31
- package/package.json +4 -2
- package/skills/sas-list-tables-smart/SKILL.md +123 -0
- package/skills/sas-read-and-score/SKILL.md +54 -53
- package/skills/sas-read-strategy/SKILL.md +10 -10
- package/skills/sas-score-workflow/SKILL.md +19 -2
- package/skills/sas-spec-migration/SKILL.md +303 -0
- package/src/authpkce.js +219 -0
- package/src/createMcpServer.js +11 -8
- package/src/expressMcpServer.js +354 -338
- package/src/oauthHandlers/authorize.js +46 -0
- package/src/oauthHandlers/baseUrl.js +8 -0
- package/src/oauthHandlers/callback.js +93 -0
- package/src/oauthHandlers/getMetadata.js +27 -0
- package/src/oauthHandlers/index.js +7 -0
- package/src/oauthHandlers/token.js +37 -0
- package/src/processHeaders.js +88 -0
- package/src/toolHelpers/_listLibrary.js +0 -1
- package/src/toolHelpers/getLogonPayload.js +5 -1
- package/src/toolHelpers/refreshTokenOauth.js +3 -3
- package/src/toolSet/.claude/settings.local.json +13 -0
- package/src/toolSet/devaScore.js +61 -61
- package/src/toolSet/findJob.js +1 -1
- package/src/toolSet/findJobdef.js +2 -2
- package/src/toolSet/findLibrary.js +68 -67
- package/src/toolSet/findModel.js +2 -2
- package/src/toolSet/findTable.js +3 -2
- package/src/toolSet/getEnv.js +8 -4
- package/src/toolSet/listJobdefs.js +61 -61
- package/src/toolSet/listJobs.js +61 -61
- package/src/toolSet/listLibraries.js +78 -78
- package/src/toolSet/listModels.js +56 -56
- package/src/toolSet/listTables.js +66 -65
- package/src/toolSet/modelInfo.js +2 -2
- package/src/toolSet/modelScore.js +6 -5
- package/src/toolSet/readTable.js +63 -65
- package/src/toolSet/runCasProgram.js +7 -6
- package/src/toolSet/runJob.js +81 -81
- package/src/toolSet/runJobdef.js +82 -82
- package/src/toolSet/runMacro.js +81 -80
- package/src/toolSet/runProgram.js +4 -8
- package/src/toolSet/sasQuery.js +77 -78
- package/src/toolSet/scrInfo.js +1 -1
- package/src/toolSet/scrScore.js +69 -68
- package/src/toolSet/setContext.js +65 -65
- package/src/toolSet/superstat.js +61 -59
- package/src/toolSet/tableInfo.js +58 -57
package/src/toolSet/superstat.js
CHANGED
|
@@ -1,59 +1,61 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright © 2025, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
- compute superstat for
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
run;
|
|
48
|
-
|
|
49
|
-
run;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright © 2025, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { type } from 'node:os';
|
|
6
|
+
import _submitCode from '../toolHelpers/_submitCode.js';
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
|
|
9
|
+
function superstat(_appContext) {
|
|
10
|
+
let desc = `
|
|
11
|
+
## superstat: compute superstat for two numbers using SAS programming
|
|
12
|
+
|
|
13
|
+
## Details
|
|
14
|
+
This is a tool to demonstrate using SAS programming to score. The SAS program for suprestat is
|
|
15
|
+
below. In a real application this would be a more complex program that is
|
|
16
|
+
available to the SAS server.
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
ods html style=barrettsblue;
|
|
20
|
+
data temp;
|
|
21
|
+
superstat = (&a + &b) * 42;
|
|
22
|
+
run;
|
|
23
|
+
proc print data=temp;
|
|
24
|
+
run;
|
|
25
|
+
ods html close;
|
|
26
|
+
run;
|
|
27
|
+
|
|
28
|
+
## Sample Prompt
|
|
29
|
+
|
|
30
|
+
- compute superstat for 1 and 2
|
|
31
|
+
- compute superstat for 3,5
|
|
32
|
+
|
|
33
|
+
`;
|
|
34
|
+
let spec = {
|
|
35
|
+
name: 'superstat',
|
|
36
|
+
description: desc,
|
|
37
|
+
inputSchema: z.object({
|
|
38
|
+
a: z.number().optional()
|
|
39
|
+
}),
|
|
40
|
+
required: ['a', 'b']
|
|
41
|
+
},
|
|
42
|
+
handler: async (params) => {
|
|
43
|
+
let src = `
|
|
44
|
+
ods html style=barrettsblue;
|
|
45
|
+
data temp;
|
|
46
|
+
superstat = (&a + &b) * 42;
|
|
47
|
+
run;
|
|
48
|
+
proc print data=temp;
|
|
49
|
+
run;
|
|
50
|
+
ods html close;
|
|
51
|
+
run;
|
|
52
|
+
`;
|
|
53
|
+
params.src = src;
|
|
54
|
+
let r = await _submitCode(params);
|
|
55
|
+
return r;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
};
|
|
59
|
+
return spec;
|
|
60
|
+
}
|
|
61
|
+
export default superstat;
|
package/src/toolSet/tableInfo.js
CHANGED
|
@@ -1,57 +1,58 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright © 2025, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
import { z } from 'zod';
|
|
6
|
-
import debug from 'debug';
|
|
7
|
-
|
|
8
|
-
import _tableInfo from '../toolHelpers/_tableInfo.js';
|
|
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
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright © 2025, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import debug from 'debug';
|
|
7
|
+
|
|
8
|
+
import _tableInfo from '../toolHelpers/_tableInfo.js';
|
|
9
|
+
import { type } from 'node:os';
|
|
10
|
+
function tableInfo(_appContext) {
|
|
11
|
+
|
|
12
|
+
let describe = `
|
|
13
|
+
table-info — retrieve metadata about a table in a CAS or SAS library.
|
|
14
|
+
|
|
15
|
+
USE when: what columns, describe structure, show schema, table statistics, column info
|
|
16
|
+
DO NOT USE for: read data (use read-table), list tables (use list-tables), find table (use find-table), queries (use sas-query)
|
|
17
|
+
|
|
18
|
+
PARAMETERS
|
|
19
|
+
- table: string — table name (required)
|
|
20
|
+
- lib: string — caslib or libref (required)
|
|
21
|
+
- server: string (default: 'cas') — 'cas' or 'sas'
|
|
22
|
+
|
|
23
|
+
ROUTING RULES
|
|
24
|
+
- "what columns are in cars" → { table: "cars", lib: "<lib>", server: "cas" }
|
|
25
|
+
- "describe table sales in Public" → { table: "sales", lib: "Public", server: "cas" }
|
|
26
|
+
- "show schema for mylib.iris on sas" → { table: "iris", lib: "mylib", server: "sas" }
|
|
27
|
+
|
|
28
|
+
EXAMPLES
|
|
29
|
+
- "what columns in cars" → { table: "cars", lib: "<lib>", server: "cas" }
|
|
30
|
+
- "describe structure of customers in Public" → { table: "customers", lib: "Public", server: "cas" }
|
|
31
|
+
|
|
32
|
+
NEGATIVE EXAMPLES (do not route here)
|
|
33
|
+
- "read table cars" (use read-table)
|
|
34
|
+
- "list tables in Public" (use list-tables)
|
|
35
|
+
- "does table exist" (use find-table)
|
|
36
|
+
- "query table" (use sas-query)
|
|
37
|
+
|
|
38
|
+
ERRORS
|
|
39
|
+
Returns columns array (name, type, label, format, length) and tableInfo (rowCount, fileSize, created, modified).
|
|
40
|
+
`;
|
|
41
|
+
|
|
42
|
+
let specs = {
|
|
43
|
+
name: 'table-info',
|
|
44
|
+
description: describe,
|
|
45
|
+
inputSchema: z.object({
|
|
46
|
+
table: z.string(),
|
|
47
|
+
lib: z.string().optional(),
|
|
48
|
+
server: z.string().optional()
|
|
49
|
+
}),
|
|
50
|
+
handler: async (params) => {
|
|
51
|
+
params.describe = true;
|
|
52
|
+
let r = await _tableInfo(params);
|
|
53
|
+
return r;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return specs;
|
|
57
|
+
}
|
|
58
|
+
export default tableInfo;
|