BookmarkSubscribeRSS Feed

Putting the SAS MCP Server to Work in Claude Code CLI

Started yesterday by
Modified yesterday by
Views 60

The SAS MCP Server connects an AI coding assistant, such as Claude Code CLI, directly to your SAS Viya environment.

 

You can run SAS code, submit batch jobs. You can also ask for in plain language about your models, decision, rule sets, CAS tables and reports. You get back an answer, in plain language, from SAS Viya.

 

This post is a tour of what that looks like in Claude Code CLI, paired with a demo video.

 

If you need the setup details, see Connecting Claude Code CLI to SAS Viya with the SAS MCP Server. This post picks up where that one leaves off: what to do once it's running.

 

 

Why This Matters

 

In an earlier post about GitHub Copilot, I sketched what a unified agent experience over SAS Viya could feel like. Same principle here. You stay in your terminal, talk to Claude Code CLI, and SAS Viya responds. Authentication, REST payload formatting, endpoint discovery, log parsing, they’re all handled.

 

What's left is the part that actually matters: asking the right questions, and validating the results.


(view in My Videos)

 

 

Scoring: Models, Decisions, Rule Sets

 

The SAS Micro Analytic Service (MAS) hosts published rule sets, decisions, and models. For now, the SAS MCP Server supports only this publishing destination. Through the SAS MCP Server, Claude Code CLI can:

 

  • Browse what's published in MAS.
  • Pick an item, for example, a rule set.
  • Score it against data you provide.

 

Notably, you don't need to write API specs or hand-format JSON payloads. You don't need to hand nicely formatted JSON payloads. The agent works out the required structure and sends it correctly. Results come back in the same conversation, where you can immediately ask follow-up questions about what they actually mean.

 

 

Scoring Decisions without Test Data

 

Suppose you want to score a decision in SAS Intelligent Decisioning, but you don't have any data on hand. You know the inputs exist; you just don't know what they're called or what types they expect.

 

Ask the agent. It calls the relevant API, returns the required columns and data types, generates synthetic data that matches, and scores the decision on the spot.

 

This used to be a multi-tab, multi-tool exercise. Now it's a sentence.

 

 

Two Models, Side by Side

 

For models from SAS Model Manager, the pattern extends naturally. List published models, hand the agent a record or a small dataset, and ask it to score two models in parallel. Then ask which one is more conservative. Or what they agree on. Or where they diverge.

 

In my opinion, the conversational loop around the result is where the real value lives. Of course, beware of the model’s limitations and hallucinations.

 

 

Cloud Analytic Services (CAS) Tools

 

CAS, the in-memory engine that makes SAS Viya fast, gets the same conversational treatment.

 

You can list CAS servers, browse caslibs, list tables, and pull table metadata: row counts, column counts, types, lengths. Trust but verify: cross-check anything important in SAS Data Hub (SAS Data Explorer).

 

The metadata step is more important than it looks. Ask the agent to get the actual column names, types, and lengths before generating any SAS code. Then, because the agent uses the conversation history, the generated code is far more likely to be correct on the first try. Skip it, and you're inviting confidently wrong guesses.

 

Need to load a file into memory? Ask. Need to bring in local data stored in your repository or project folder? The SAS MCP Server handles that too. You can load a local file into CAS and promote it as a global table in a couple of conversational steps that used to involve more clicking than they had any right to.

 

 

Discover Data

 

Once it's in memory, fetch sample records, run ad hoc queries, or just ask: what is this table actually about? The agent figures out an approach and runs the SAS code underneath.

 

The result is not as good nor as structured as the data discovery from SAS Data Governance (SAS Information Catalog), but sometimes good and fast enough.

 

You need to ask the right questions. The responsibility of correctly interpreting the data lies with you. Use the agent to look at the data and content from different angles. Same end goal as writing exploratory queries to understand your data.

 

 

Built-in Prompts

 

Some tasks you may run every time you discover a new table: a statistical summary, a profiling pass, a data quality assessment. The SAS MCP Server ships with built-in prompt templates for exactly these. Think of them as shortcuts for the chores you'd otherwise type out from scratch each time.

 

You can also chain them into something larger. A custom workflow might be: identify personal data in a table, then generate and submit a job that masks it. That kind of task normally takes real effort and a few tools. Now it can become a conversation with a few well-placed checkpoints.

 

 

Plain English, not ‘Log-ish’

 

For anything heavier, wrap the work in a proper batch job. Ask the agent to generate the code. Review the code. Submit it as a job. Monitor the job status. List the running jobs. Pull the logs.

 

When something goes wrong (and something always goes wrong, even in well-curated demos) ask what happened. The agent reads the log and explains the error in plain language. No more scanning walls of NOTE and WARNING entries looking for the one ERROR line that actually matters. From ‘Log-ish’ to plain English.

 

Want to double-check the work? Ask the agent to cross-check its own output. Query the result table. Verify the row counts. Run a sanity check against another table. The kind of validation you'd normally do manually at the end of every pipeline becomes another sentence in the same conversation.

 

 

SAS Visual Analytics Reports

 

For SAS Visual Analytics users, a few MCP tools allow you to: list your reports, pull their metadata, identify specific report elements. Then, using a combination of MCP tools and REST APIs, the agent can extract those elements as images and download them locally.

 

Perfect for dropping a chart into a slide deck or committing it to a GitHub repository, without ever opening the report manually.

 

 

The Practical Takeaway

 

Everything in the demo follows the same pattern that worked well in GitHub Copilot:

 

  • Discover
  • Generate
  • Review
  • Execute
  • Validate

 

Stay in control. Let the agent handle the repetitive work: metadata lookup, payload formatting, code generation, job monitoring, log summarization. Keep yourself in the loop for the parts that need judgment.

 

Code execution, data management, model and decision scoring, report extraction, all from a conversational interface, building bridges across SAS products along the way.

 

 

What's Next?

 

  • More SAS MCP tools, I hope.
  • The repository is open source, you can contribute directly. See the Contributing page on GitHub.
  • Try the same patterns with other clients (GitHub Copilot, Gemini CLI, others) and see which one fits your workflow.

 

 

Conclusion

 

The setup is a one-time cost. What comes after is a conversation with SAS Viya, conducted from your terminal, in plain language.

 

The SAS MCP Server empowers from one interface SAS code execution, job submission, monitoring and log triage, scoring, CAS work, report object export.

 

 

Acknowledgements

 

Acknowledging David Weik @DavidHD , Reza Soleimani, Eric Qi, Kevin Scott, Bryan Behrenshausen, and Harry Keen for their excellent work.

 

 

Additional Resources

 

 

 

Further Viewing

 

Watch on YouTube: A broader look at the SAS MCP Server concept: what it means to give AI agents real analytical tools, what SAS exposes through MCP, and use cases where embedding advanced analytics into an agent workflow adds genuine value. Good context before or after the hands-on setup above.

 

For further guidance, reach out for assistance.

 

 

Find more articles from SAS Global Enablement and Learning here.

Contributors
Version history
Last update:
yesterday
Updated by:

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore Now →

SAS AI and Machine Learning Courses

The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.

Get started