@sassoftware/sas-score-mcp-serverjs 1.0.1-0 → 1.0.1-3

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 (31) hide show
  1. package/.skills_claude/README.md +303 -0
  2. package/.skills_claude/TESTING_GUIDE.md +252 -0
  3. package/.skills_claude/claude-desktop-config.json +16 -0
  4. package/.skills_claude/claude-desktop-system-prompt.md +127 -0
  5. package/{.skills → .skills_claude}/copilot-instructions.md +1 -1
  6. package/.skills_claude/instructions.md +184 -0
  7. package/{.skills → .skills_claude}/skills/sas-find-library-smart/SKILL.md +11 -8
  8. package/.skills_claude/skills/sas-find-resource-strategy/SKILL.md +105 -0
  9. package/.skills_claude/skills/sas-list-resource-strategy/SKILL.md +124 -0
  10. package/{.skills → .skills_claude}/skills/sas-list-tables-smart/SKILL.md +2 -3
  11. package/{.skills → .skills_claude}/skills/sas-read-and-score/SKILL.md +4 -3
  12. package/{.skills → .skills_claude}/skills/sas-read-strategy/SKILL.md +11 -13
  13. package/{.skills → .skills_claude}/skills/sas-request-classifier/SKILL.md +1 -1
  14. package/.skills_claude/skills/sas-score-workflow/SKILL.md +200 -0
  15. package/.skills_claude/skills-index.md +345 -0
  16. package/.skills_github/agents/sas-viya-scoring-expert.md +58 -0
  17. package/.skills_github/copilot-instructions.md +177 -0
  18. package/.skills_github/skills/sas-find-library-smart/SKILL.md +155 -0
  19. package/.skills_github/skills/sas-find-resource-strategy/SKILL.md +105 -0
  20. package/.skills_github/skills/sas-list-resource-strategy/SKILL.md +124 -0
  21. package/.skills_github/skills/sas-list-tables-smart/SKILL.md +128 -0
  22. package/.skills_github/skills/sas-read-and-score/SKILL.md +113 -0
  23. package/.skills_github/skills/sas-read-strategy/SKILL.md +154 -0
  24. package/.skills_github/skills/sas-request-classifier/SKILL.md +74 -0
  25. package/{.skills → .skills_github}/skills/sas-score-workflow/SKILL.md +5 -5
  26. package/README.md +72 -207
  27. package/cli.js +34 -66
  28. package/package.json +3 -2
  29. package/scripts/setup-skills.js +2 -2
  30. package/src/setupSkills.js +26 -15
  31. /package/{.skills → .skills_claude}/agents/sas-viya-scoring-expert.md +0 -0
@@ -0,0 +1,303 @@
1
+ # Claude Desktop — SAS Agent Setup & Deployment Guide
2
+
3
+ This guide explains how to set up the SAS agent in Claude Desktop using the `.claude` folder.
4
+
5
+ ## What's Included
6
+
7
+ The `.claude` folder contains:
8
+ - ✅ Complete SAS agent configuration (same as `.github/` but organized for Claude)
9
+ - ✅ All 6 specialized SAS skills
10
+ - ✅ MCP server configuration template
11
+ - ✅ System prompt for Claude Desktop
12
+ - ✅ Setup and usage documentation
13
+
14
+ ## Prerequisites
15
+
16
+ Before you start:
17
+ - ✅ Claude Desktop installed (latest version recommended)
18
+ - ✅ Node.js installed and in your PATH
19
+ - ✅ SAS Viya environment with OAuth credentials
20
+ - ✅ Access to your SAS Viya server from your machine
21
+ - ✅ (Optional) CA certificate file if using self-signed TLS
22
+
23
+ ## Setup Steps
24
+
25
+ ### Step 1: Gather Your SAS Viya Credentials
26
+
27
+ You'll need:
28
+ - **VIYA_URL** — Your SAS Viya server URL (e.g., `https://sas-viya.example.com`)
29
+ - **VIYA_CLIENT_ID** — OAuth client ID
30
+ - **VIYA_CLIENT_SECRET** — OAuth client secret
31
+ - **VIYA_TLS_CERT** — (Optional) Path to CA certificate file
32
+
33
+ ### Step 2: Configure the MCP Server Connection
34
+
35
+ 1. Open `.claude/claude-desktop-config.json`
36
+ 2. Update the configuration with your credentials:
37
+
38
+ ```json
39
+ {
40
+ "mcpServers": {
41
+ "sas-mcp-server": {
42
+ "command": "node",
43
+ "args": [
44
+ "/absolute/path/to/7-skill-integration/cli.js"
45
+ ],
46
+ "env": {
47
+ "VIYA_URL": "https://your-sas-viya-url.com",
48
+ "VIYA_CLIENT_ID": "your-client-id",
49
+ "VIYA_CLIENT_SECRET": "your-client-secret",
50
+ "VIYA_TLS_CERT": "/path/to/ca-cert.pem"
51
+ }
52
+ }
53
+ }
54
+ }
55
+ ```
56
+
57
+ **Important notes:**
58
+ - Use **absolute paths** for both the CLI path and certificate
59
+ - Ensure the path to `cli.js` is correct for your system
60
+ - Include the leading `/` for Unix/Mac paths; for Windows, use `C:\path\to\...`
61
+
62
+ ### Step 3: Place Configuration in Claude Desktop Directory
63
+
64
+ Copy the updated `claude_desktop_config.json` to your Claude Desktop config location:
65
+
66
+ **macOS/Linux:**
67
+ ```bash
68
+ cp /path/to/7-skill-integration/.claude/claude-desktop-config.json ~/.claude/claude_desktop_config.json
69
+ ```
70
+
71
+ **Windows:**
72
+ ```powershell
73
+ Copy-Item "C:\path\to\7-skill-integration\.claude\claude-desktop-config.json" "$env:APPDATA\Claude\claude_desktop_config.json"
74
+ ```
75
+
76
+ **Note:** If you have other MCP servers configured, merge the `mcpServers` sections instead of replacing the entire file.
77
+
78
+ ### Step 4: Add System Prompt to Claude
79
+
80
+ 1. Open **Claude Desktop**
81
+ 2. Go to **Settings** → **Custom Instructions**
82
+ 3. Open `.claude/claude-desktop-system-prompt.md`
83
+ 4. Copy the entire contents
84
+ 5. Paste into the custom instructions field in Claude
85
+ 6. Save
86
+
87
+ ### Step 5: Restart Claude Desktop
88
+
89
+ Restart Claude Desktop to activate the new configuration and system prompt.
90
+
91
+ ## Verification
92
+
93
+ After setup, verify the connection works:
94
+
95
+ 1. Start a chat with Claude
96
+ 2. Ask: **"list jobs"**
97
+ 3. You should see available SAS jobs from your Viya environment
98
+ 4. If successful, the MCP connection is working ✅
99
+
100
+ ## Configuration Details
101
+
102
+ ### MCP Server Configuration (claude-desktop-config.json)
103
+
104
+ The configuration tells Claude Desktop how to:
105
+ - Start the SAS MCP server (using Node.js)
106
+ - Connect to your SAS Viya environment
107
+ - Pass credentials securely
108
+
109
+ **Key fields:**
110
+ - `command` — The Node.js interpreter
111
+ - `args` — Path to the MCP server CLI
112
+ - `env` — Environment variables for authentication and TLS
113
+
114
+ ### System Prompt (claude-desktop-system-prompt.md)
115
+
116
+ The system prompt instructs Claude to:
117
+ - Treat itself as a SAS domain specialist
118
+ - Load skills before using MCP tools
119
+ - Classify ambiguous SAS terms
120
+ - Verify assets before execution
121
+ - Never hallucinate SAS resources
122
+
123
+ ## Using the SAS Agent
124
+
125
+ Once configured, you can start using the agent:
126
+
127
+ ### Basic Commands
128
+
129
+ ```
130
+ You: "Find library Public"
131
+ Agent: Loads sas-find-library-smart skill, checks CAS and SAS, returns result
132
+
133
+ You: "List tables in Public"
134
+ Agent: Loads sas-list-tables-smart skill, enumerates tables
135
+
136
+ You: "Score customers in Public.customers with model churn.mas"
137
+ Agent: Loads sas-read-and-score + sas-score-workflow, returns predictions
138
+ ```
139
+
140
+ ### Available Skills
141
+
142
+ See `skills-index.md` for quick reference, or each skill's file for details:
143
+
144
+ 1. **sas-request-classifier** — Disambiguate SAS terms
145
+ 2. **sas-find-library-smart** — Find CAS or SAS libraries
146
+ 3. **sas-list-tables-smart** — List tables in a library
147
+ 4. **sas-read-strategy** — Choose right read tool (raw vs. analytical)
148
+ 5. **sas-read-and-score** — Read table data + score with model
149
+ 6. **sas-score-workflow** — Route scoring by model type (.job, .mas, etc.)
150
+
151
+ ## Troubleshooting
152
+
153
+ ### "MCP Server Not Found"
154
+
155
+ **Symptom:** Claude says the MCP server can't be found.
156
+
157
+ **Solutions:**
158
+ 1. Verify the path to `cli.js` is absolute and correct
159
+ 2. Check that Node.js is installed: `node --version`
160
+ 3. Ensure Node.js is in your PATH: `which node` (Mac/Linux) or `where node` (Windows)
161
+ 4. Restart Claude Desktop
162
+ 5. Check the file permissions on `cli.js`
163
+
164
+ ### "Authentication Failed"
165
+
166
+ **Symptom:** Claude connects but SAS operations fail with auth errors.
167
+
168
+ **Solutions:**
169
+ 1. Verify `VIYA_CLIENT_ID` and `VIYA_CLIENT_SECRET` are correct
170
+ 2. Ensure credentials are still valid (check if they've expired)
171
+ 3. Verify `VIYA_URL` is accessible from your machine: `curl https://your-viya-url`
172
+ 4. Check network connectivity and firewall rules
173
+ 5. If using a proxy, configure it in your environment
174
+
175
+ ### "TLS Certificate Error"
176
+
177
+ **Symptom:** SSL/certificate verification fails.
178
+
179
+ **Solutions:**
180
+ 1. Verify the path in `VIYA_TLS_CERT` is correct and absolute
181
+ 2. Ensure the certificate file is readable
182
+ 3. If using self-signed cert, try `VIYA_TLS_SKIP_VERIFY=true` (development only, not recommended for production)
183
+ 4. Request the correct CA certificate from your SAS administrator
184
+
185
+ ### "No Tools Available"
186
+
187
+ **Symptom:** Claude says no SAS tools are available.
188
+
189
+ **Solutions:**
190
+ 1. Restart Claude Desktop
191
+ 2. Check the MCP server logs for errors
192
+ 3. Verify the SAS Viya server is running and accessible
193
+ 4. Try a simple test: ask "list jobs"
194
+ 5. Check your custom instructions are loaded correctly
195
+
196
+ ### "Claude Doesn't Load Skills"
197
+
198
+ **Symptom:** Claude doesn't automatically load the right skill for your request.
199
+
200
+ **Solutions:**
201
+ 1. Explicitly reference the skill: "Use sas-find-library-smart to find library Public"
202
+ 2. Check that `claude-desktop-system-prompt.md` is loaded in custom instructions
203
+ 3. Restart Claude Desktop to reload the system prompt
204
+ 4. Verify the skill files exist in `.claude/skills/`
205
+
206
+ ## Advanced Configuration
207
+
208
+ ### Using Multiple MCP Servers
209
+
210
+ If you have other MCP servers configured:
211
+
212
+ ```json
213
+ {
214
+ "mcpServers": {
215
+ "sas-mcp-server": {
216
+ "command": "node",
217
+ "args": ["/path/to/cli.js"],
218
+ "env": { ... }
219
+ },
220
+ "other-server": {
221
+ "command": "...",
222
+ "args": [...],
223
+ "env": { ... }
224
+ }
225
+ }
226
+ }
227
+ ```
228
+
229
+ ### Environment Variables
230
+
231
+ You can also set environment variables system-wide instead of in the config:
232
+
233
+ ```bash
234
+ export VIYA_URL="https://your-sas-viya.com"
235
+ export VIYA_CLIENT_ID="your-client-id"
236
+ export VIYA_CLIENT_SECRET="your-client-secret"
237
+ export VIYA_TLS_CERT="/path/to/ca-cert.pem"
238
+ ```
239
+
240
+ Then simplify the config to just reference `cli.js`.
241
+
242
+ ### Debugging
243
+
244
+ To debug MCP server issues, check:
245
+ 1. Claude Desktop logs: `~/Library/Logs/Claude Desktop` (Mac) or `%APPDATA%\Claude\logs` (Windows)
246
+ 2. MCP server output: Check if there are error messages from Node.js
247
+ 3. Test the CLI directly: `node /path/to/cli.js`
248
+
249
+ ## File Structure Reference
250
+
251
+ ```
252
+ .claude/
253
+ ├── copilot-instructions.md ← Core SAS instructions
254
+ ├── claude-desktop-system-prompt.md ← Claude Desktop prompt
255
+ ├── claude-desktop-config.json ← MCP config (customize this)
256
+ ├── README.md ← This file
257
+ ├── instructions.md ← Usage instructions
258
+ ├── skills-index.md ← Skills quick reference
259
+ ├── agents/
260
+ │ └── sas-viya-scoring-expert.md ← Agent definition
261
+ └── skills/
262
+ ├── sas-request-classifier/SKILL.md
263
+ ├── sas-find-library-smart/SKILL.md
264
+ ├── sas-list-tables-smart/SKILL.md
265
+ ├── sas-read-and-score/SKILL.md
266
+ ├── sas-read-strategy/SKILL.md
267
+ └── sas-score-workflow/SKILL.md
268
+ ```
269
+
270
+ ## Deployment
271
+
272
+ ### Local Development
273
+
274
+ For local development:
275
+ 1. Keep the `.claude` folder in the repository
276
+ 2. Update `claude-desktop-config.json` locally (don't commit credentials)
277
+ 3. Share setup steps with team members
278
+
279
+ ### Production Deployment
280
+
281
+ For production use:
282
+ 1. Store credentials in environment variables, not in config file
283
+ 2. Use a secrets management system for OAuth credentials
284
+ 3. Commit only the `.claude` template without sensitive data
285
+ 4. Have users configure their own credentials locally
286
+
287
+ ## Support & Documentation
288
+
289
+ - **Setup issues?** See "Troubleshooting" above
290
+ - **Want to use a skill?** Open `.claude/skills-index.md`
291
+ - **Need usage guidance?** See `.claude/instructions.md`
292
+ - **SAS domain details?** See `.claude/copilot-instructions.md`
293
+ - **Skill specifics?** Open the skill's file directly: `.claude/skills/<name>/SKILL.md`
294
+
295
+ ## Next Steps
296
+
297
+ 1. ✅ Complete the setup steps above
298
+ 2. ✅ Verify the connection ("list jobs" test)
299
+ 3. ✅ Read `instructions.md` for how to use the agent
300
+ 4. ✅ Try a simple task: "Find library Public"
301
+ 5. ✅ Explore skills: See `skills-index.md`
302
+
303
+ Happy SAS Viya scoring! 🎯
@@ -0,0 +1,252 @@
1
+ # Testing Guide: Local Claude Desktop Setup
2
+
3
+ This guide explains how to test the SAS agent locally by placing configuration in your home directory (`~/.claude/`).
4
+
5
+ ## Quick Start
6
+
7
+ ### 1. Create the `.claude` directory in your home folder
8
+
9
+ ```bash
10
+ mkdir -p ~/.claude
11
+ ```
12
+
13
+ ### 2. Copy the configuration file
14
+
15
+ ```bash
16
+ cp /path/to/7-skill-integration/.claude/claude-desktop-config.json ~/.claude/
17
+ ```
18
+
19
+ ### 3. Edit the configuration with your credentials
20
+
21
+ ```bash
22
+ nano ~/.claude/claude-desktop-config.json
23
+ ```
24
+
25
+ Update the following fields with your SAS Viya environment details:
26
+
27
+ ```json
28
+ {
29
+ "mcpServers": {
30
+ "sas-mcp-server": {
31
+ "command": "node",
32
+ "args": [
33
+ "/absolute/path/to/7-skill-integration/cli.js"
34
+ ],
35
+ "env": {
36
+ "VIYA_URL": "https://your-sas-viya.com",
37
+ "VIYA_CLIENT_ID": "your-client-id",
38
+ "VIYA_CLIENT_SECRET": "your-client-secret",
39
+ "VIYA_TLS_CERT": "/path/to/ca-cert.pem"
40
+ }
41
+ }
42
+ }
43
+ }
44
+ ```
45
+
46
+ **Important:**
47
+ - Use the **absolute path** to `cli.js` in your repository
48
+ - Include the leading `/` for Unix/Mac paths; for Windows, use `C:\path\to\...`
49
+
50
+ ### 4. Add the system prompt to Claude Desktop
51
+
52
+ 1. Open **Claude Desktop**
53
+ 2. Go to **Settings** → **Custom Instructions**
54
+ 3. Open `.claude/claude-desktop-system-prompt.md` from the repository
55
+ 4. Copy the entire contents
56
+ 5. Paste into the custom instructions field
57
+ 6. Save
58
+
59
+ ### 5. Restart Claude Desktop
60
+
61
+ Close and reopen Claude Desktop to load the new configuration and system prompt.
62
+
63
+ ### 6. Test the connection
64
+
65
+ In a chat with Claude, ask:
66
+
67
+ ```
68
+ list jobs
69
+ ```
70
+
71
+ You should see a list of available SAS jobs from your Viya environment. If successful, the MCP connection is working! ✅
72
+
73
+ ---
74
+
75
+ ## What Files Go Where?
76
+
77
+ ### Files that must go in `~/.claude/`:
78
+ - ✅ `claude-desktop-config.json` — **Required** for MCP server connection
79
+
80
+ ### Files that don't need to be copied:
81
+ - ❌ Skills files — They live in the repository and are referenced in documentation
82
+ - ❌ Agent definitions — Documentation only
83
+ - ❌ Skill markdown files — For reference, not needed for execution
84
+
85
+ ### System prompt:
86
+ - **Option A** — Copy `claude-desktop-system-prompt.md` contents to Claude Desktop Settings → Custom Instructions (recommended)
87
+ - **Option B** — Keep it in the repository and reference it
88
+
89
+ ---
90
+
91
+ ## Directory Structure After Setup
92
+
93
+ Your home directory will look like this:
94
+
95
+ ```
96
+ ~/
97
+ ├── .claude/
98
+ │ └── claude-desktop-config.json ← Your configuration
99
+ ├── ... (other home directory files)
100
+ ```
101
+
102
+ The repository stays intact:
103
+
104
+ ```
105
+ /path/to/7-skill-integration/
106
+ ├── .claude/
107
+ │ ├── README.md
108
+ │ ├── instructions.md
109
+ │ ├── skills-index.md
110
+ │ ├── copilot-instructions.md
111
+ │ ├── claude-desktop-system-prompt.md
112
+ │ ├── claude-desktop-config.json ← Template (not modified)
113
+ │ ├── agents/
114
+ │ └── skills/
115
+ ├── cli.js
116
+ ├── ... (other repo files)
117
+ ```
118
+
119
+ ---
120
+
121
+ ## How It Works
122
+
123
+ 1. Claude Desktop reads `~/.claude/claude-desktop-config.json`
124
+ 2. It starts the MCP server (Node.js process running `cli.js`)
125
+ 3. The MCP server connects to your SAS Viya environment using the credentials you provided
126
+ 4. Claude loads the system prompt from custom instructions
127
+ 5. You can now use the SAS agent with all skills available
128
+
129
+ The repository's `.claude/` folder serves as the **template and documentation** — it doesn't need to be in your home directory.
130
+
131
+ ---
132
+
133
+ ## Troubleshooting
134
+
135
+ ### "MCP Server Not Found"
136
+
137
+ **Check:**
138
+ 1. Verify the path to `cli.js` is absolute and correct
139
+ 2. Test Node.js is available: `node --version`
140
+ 3. Verify the file exists: `ls -la /path/to/cli.js`
141
+ 4. Restart Claude Desktop
142
+
143
+ **Solution:**
144
+ ```bash
145
+ # Verify the path works
146
+ node /absolute/path/to/7-skill-integration/cli.js --help
147
+ ```
148
+
149
+ ### "Authentication Failed"
150
+
151
+ **Check:**
152
+ 1. Verify credentials in `~/.claude/claude-desktop-config.json`
153
+ 2. Ensure SAS Viya is accessible: `curl https://your-viya-url`
154
+ 3. Verify credentials are still valid
155
+
156
+ ### "No SAS Tools Available"
157
+
158
+ **Check:**
159
+ 1. System prompt is loaded in Claude Custom Instructions
160
+ 2. Restart Claude Desktop after adding the system prompt
161
+ 3. Try a simple test: "list jobs"
162
+
163
+ ---
164
+
165
+ ## Testing Different Configurations
166
+
167
+ ### Test with a local development environment:
168
+
169
+ ```json
170
+ {
171
+ "mcpServers": {
172
+ "sas-mcp-server": {
173
+ "command": "node",
174
+ "args": ["/Users/yourname/projects/7-skill-integration/cli.js"],
175
+ "env": {
176
+ "VIYA_URL": "http://localhost:7480",
177
+ "VIYA_CLIENT_ID": "dev-client",
178
+ "VIYA_CLIENT_SECRET": "dev-secret"
179
+ }
180
+ }
181
+ }
182
+ }
183
+ ```
184
+
185
+ ### Test with production environment:
186
+
187
+ ```json
188
+ {
189
+ "mcpServers": {
190
+ "sas-mcp-server": {
191
+ "command": "node",
192
+ "args": ["/opt/7-skill-integration/cli.js"],
193
+ "env": {
194
+ "VIYA_URL": "https://sas-viya-prod.company.com",
195
+ "VIYA_CLIENT_ID": "prod-client-id",
196
+ "VIYA_CLIENT_SECRET": "prod-client-secret",
197
+ "VIYA_TLS_CERT": "/etc/ssl/certs/company-ca.pem"
198
+ }
199
+ }
200
+ }
201
+ }
202
+ ```
203
+
204
+ ---
205
+
206
+ ## Next Steps After Testing
207
+
208
+ ### If testing is successful:
209
+ 1. Document your setup
210
+ 2. Share the setup steps with your team (without credentials)
211
+ 3. Consider using environment variables instead of config file for production
212
+ 4. Document any team-specific customizations
213
+
214
+ ### If testing fails:
215
+ 1. Check troubleshooting section above
216
+ 2. Review MCP server logs
217
+ 3. Verify SAS Viya environment is accessible
218
+ 4. Check credentials are correct and current
219
+
220
+ ---
221
+
222
+ ## Important Notes
223
+
224
+ ### Security
225
+
226
+ - ⚠️ **Never commit credentials** to version control
227
+ - ⚠️ **Never share** your `~/.claude/claude-desktop-config.json` file
228
+ - ✅ Use environment variables for sensitive data when possible
229
+ - ✅ Use a secrets management system for team deployments
230
+
231
+ ### Paths
232
+
233
+ - ✅ Use absolute paths (starting with `/` or `C:\`)
234
+ - ❌ Don't use relative paths like `./cli.js`
235
+ - ❌ Don't use `~` in the config file (Claude Desktop may not expand it correctly)
236
+
237
+ ### File Permissions
238
+
239
+ Ensure the config file is readable:
240
+
241
+ ```bash
242
+ chmod 600 ~/.claude/claude-desktop-config.json
243
+ ```
244
+
245
+ ---
246
+
247
+ ## Support
248
+
249
+ - **Setup questions?** See the main `README.md` in `.claude/`
250
+ - **How to use the agent?** See `instructions.md` in `.claude/`
251
+ - **Which skill to use?** See `skills-index.md` in `.claude/`
252
+ - **Domain guidance?** See `copilot-instructions.md` in `.claude/`
@@ -0,0 +1,16 @@
1
+ {
2
+ "mcpServers": {
3
+ "sas-mcp-server": {
4
+ "command": "node",
5
+ "args": [
6
+ "/path/to/7-skill-integration/cli.js"
7
+ ],
8
+ "env": {
9
+ "VIYA_URL": "https://your-sas-viya-url.com",
10
+ "VIYA_CLIENT_ID": "your-client-id",
11
+ "VIYA_CLIENT_SECRET": "your-client-secret",
12
+ "VIYA_TLS_CERT": "/path/to/ca-cert.pem"
13
+ }
14
+ }
15
+ }
16
+ }
@@ -0,0 +1,127 @@
1
+ # SAS Agent System Prompt for Claude Desktop
2
+
3
+ You are a specialized SAS agent powered by an MCP server that exposes SAS Viya capabilities including jobs, code artifacts, CAS and SAS server resources, MAS models, and scoring assets.
4
+
5
+ ## Core Responsibilities
6
+
7
+ 1. **Help users complete SAS-related tasks safely and accurately**
8
+ 2. **Select the right skill first before invoking MCP tools**
9
+ 3. **Classify ambiguous requests into the correct SAS domain**
10
+ 4. **Never hallucinate SAS assets, job names, model identifiers, or resources**
11
+
12
+ ## Operating Model
13
+
14
+ - Treat yourself as a **domain-specialized SAS agent**, not a generic coding assistant
15
+ - Prefer **domain interpretation and skill-based guidance** before directly invoking low-level tools
16
+ - When a request is ambiguous, **resolve the ambiguity before taking action**
17
+
18
+ ## Request Classification
19
+
20
+ Before using SAS MCP tools, classify the request into one of these categories:
21
+
22
+ - SAS job or flow execution
23
+ - SAS code or program analysis
24
+ - CAS data, caslibs, tables, or resources
25
+ - SAS data, librefs, tables, or resources
26
+ - MAS model, SAS job model, SAS jobdef model
27
+ - Score model / scoring artifact / scoring execution
28
+ - General SAS content or metadata discovery
29
+ - Authentication, connection, or environment issue
30
+
31
+ If the request could belong to multiple categories, ask ONE clarifying question unless lightweight discovery can resolve it safely.
32
+
33
+ ## Skill-First Behavior
34
+
35
+ Available skills (load the most relevant one first):
36
+
37
+ ### sas-request-classifier
38
+ - **Purpose:** Classify ambiguous SAS or Viya requests
39
+ - **Use when:** Request mentions jobs, code, models, scoring, CAS tables, content, or resources and the domain is unclear
40
+ - **Trigger phrases:** "find my model", "run scoring", "open the table"
41
+
42
+ ### sas-find-library-smart
43
+ - **Purpose:** Find a SAS Viya library (libref or caslib) with intelligent server detection
44
+ - **Use when:** User needs to verify a library exists before accessing tables
45
+ - **Trigger phrases:** "find library", "does library exist", "locate library"
46
+
47
+ ### sas-list-tables-smart
48
+ - **Purpose:** List all tables in a SAS Viya library
49
+ - **Use when:** User wants to browse or explore available tables
50
+ - **Trigger phrases:** "list tables in", "show tables in", "what tables are in"
51
+
52
+ ### sas-read-strategy
53
+ - **Purpose:** Guide data retrieval tool selection (raw vs. analytical queries)
54
+ - **Use when:** User wants to fetch records from a SAS/CAS table
55
+ - **Trigger phrases:** "read records from", "get data where", "fetch rows from", "query the table", "aggregate by"
56
+
57
+ ### sas-read-and-score
58
+ - **Purpose:** Guide the full read → score workflow
59
+ - **Use when:** User wants to score records from a table or run a model on query results
60
+ - **Trigger phrases:** "score these records", "score results of my query", "run the model on this table", "predict for these customers"
61
+
62
+ ### sas-score-workflow
63
+ - **Purpose:** Mandatory routing logic for scoring requests
64
+ - **Use when:** User requests scoring with model names containing type suffixes (.job, .jobdef, .mas, .scr)
65
+ - **Trigger phrases:** "score with model X.job", "score X.jobdef scenario"
66
+
67
+ ## MCP Tools
68
+
69
+ These tools are available via your MCP connection to the SAS server:
70
+
71
+ - `mcp_sasmcpx_sas-score-list-jobs` — List available SAS jobs
72
+ - `mcp_sasmcpx_sas-score-run-job` — Execute a specific job
73
+ - `mcp_sasmcpx_sas-score-list-jobdefs` — List job definitions
74
+ - `mcp_sasmcpx_sas-score-run-jobdef` — Execute a job definition
75
+ - `mcp_sasmcpx_sas-score-mas-score` — Score with a MAS model
76
+ - `mcp_sasmcpx_sas-score-sas-query` — Execute analytical SQL queries
77
+ - `mcp_sasmcpx_sas-score-run-program` — Run SAS code or programs
78
+ - And more tools for finding libraries, tables, models, and metadata
79
+
80
+ ## Tool Usage Policy
81
+
82
+ 1. **Use MCP tools only after identifying the most likely domain**
83
+ 2. **Prefer read/discovery operations before write, execute, deploy, or destructive operations**
84
+ 3. **When a user asks to run, publish, deploy, or score something:**
85
+ - Confirm you have identified the correct SAS asset type first
86
+ - Ask clarifying questions if the asset type is ambiguous
87
+ 4. **If a tool response reveals the original interpretation was wrong**, correct course explicitly and continue
88
+
89
+ ## Ambiguity Handling
90
+
91
+ These terms are ambiguous and must be disambiguated from context or by asking a question:
92
+
93
+ - **"model"** → MAS models, SAS job models, SAS jobdef models, or SCR models?
94
+ - **"score"/"scoring"** → Running a model on data (not measuring test coverage)
95
+ - **"job"** → SAS job/flow (not CI job)
96
+ - **"code"**, **"table"**, **"content"**, **"resource"** → Clarify context
97
+
98
+ Examples:
99
+ - "find my model" → Could be a MAS model, model repository entry, or scoring asset
100
+ - "run scoring" → Could be a job, MAS model, jobdef, or SCR model
101
+ - "open the table" → Could be a CAS table or SAS dataset
102
+
103
+ ## Response Style
104
+
105
+ - Be **concise, precise, and domain-aware**
106
+ - **Explain which SAS concept you are acting on** when ambiguity is possible
107
+ - **Do not pretend certainty** when the asset type or environment is unclear
108
+ - **Prefer structured answers with short steps** when guiding the user
109
+
110
+ ## Safety and Correctness
111
+
112
+ - ✅ **Never make up SAS assets, job names, model identifiers, or CAS resources**
113
+ - ✅ **Verify environment-specific details first** if a requested action depends on them
114
+ - ✅ **Prefer inspection and discovery over assumption**
115
+ - ✅ **Use lightweight discovery** (find/list operations) before attempting execution
116
+
117
+ ## Configuration
118
+
119
+ To use this agent with Claude Desktop:
120
+
121
+ 1. Copy the provided `claude_desktop_config.json` template
122
+ 2. Update the `VIYA_URL`, `VIYA_CLIENT_ID`, `VIYA_CLIENT_SECRET`, and `VIYA_TLS_CERT` with your SAS Viya environment details
123
+ 3. Update the command path to point to your installation of this repository
124
+ 4. Place the config file in your Claude Desktop configuration directory (typically `~/.claude/claude_desktop_config.json` on macOS/Linux or `%APPDATA%\Claude\claude_desktop_config.json` on Windows)
125
+ 5. Restart Claude Desktop
126
+
127
+ For more details, see the [MCP localhost configuration guide](../docs/mcp-localhost-config-guide.md).
@@ -152,4 +152,4 @@ This repository provides specialized skills for SAS-focused workflows. Load the
152
152
 
153
153
  **Use when:** User requests scoring with a model name that may require routing to different execution engines.
154
154
 
155
- **Trigger phrases:** "score with model X.job", "score X.jobdef scenario", "score with model X.mas", "score with model X.scr", any request with "score" + model name containing a dot (.) + type suffix.
155
+ **Trigger phrases:** "score with model X.job", "score X.jobdef scenario", "score with model X.mas", "score with model X.scr", any request with "score" + model name containing a dot (.) + type suffix.