BookmarkSubscribeRSS Feed

Putting the SAS MCP Server to Work in GitHub Copilot

Started yesterday by
Modified yesterday by
Views 49

The SAS MCP Server empowers an AI coding assistant, such as GitHub Copilot, with SAS Viya tools: execute code, manage data, score models, work with reports, all from a conversational interface in Visual Studio Code.

 

This post shares a demonstration video and what I learned from actually using it.

 

As of April 2026, the MCP server exposed 26 tools across code execution, CAS management, file operations, batch jobs, SAS Visual Analytics reports, model and decision scoring, plus a few built-in prompt templates for common SAS tasks.

 

 

Why this matters

 

Back in August 2025, I posted about what I would like to see as a SAS Viya user:

 

  • A unified agent interface that connects all SAS Viya capabilities: SAS Data & AI Studio, SAS Data Hub, SAS Intelligent Decisioning, SAS Visual Analytics, SAS Model Manager, without having to think about which product, API, or language powers each step.
  • The freedom to use any LLM or agentic framework.
  • Natural interactions, not point-and-click workflows.
  • REST APIs, Python packages, and SAS/CAS code all accessible through a single, cohesive experience.

 

The SAS MCP Server is real, tangible progress toward that vision, although we're not fully there yet. It doesn't require you to switch tools, learn the layout of a new interface, or memorize API shapes. You stay in Visual Studio (VS) Code, talk to your AI assistant of choice, and SAS Viya responds.

 

The underlying complexity, including authentication, REST calls, payload formatting, and log parsing, is handled for you. What remains is the work that actually matters: asking the right questions and validating the results.

 

 

(view in My Videos)

 

 

First: Confirm the tools are active

 

To use the SAS MCP server, there are a few configuration steps, which were described in detail in Connecting GitHub Copilot to SAS Viya with the SAS MCP Server.

 

Before anything else, make sure you're in Agent Mode and the SAS MCP tools are visible.

 

 

Generate first, execute second

 

The habit that made the biggest difference: ask GitHub Copilot to show you the SAS code before running it.

 

Prompts:

 

Create SAS code to filter only Meters='External' from CASUSER.WATER_CLUSTER.
Save the result as CASUSER.WATER_CLUSTER_EXTERNAL.
Show me the code first. Do not submit it yet.

 

Then, after reviewing:

 

Submit this as a batch job and return the job status and log.

 

Surprise parties are fun. Surprise production code is not.

 

Unlike the original Master Control Program (MCP) from Tron, this one won't execute anything without your permission.

 

 

Discover before you operate

 

For CAS tables, reports, or models ask the agent to list what exists before touching anything. GitHub Copilot can guess object names. Sometimes the guess is reasonable. Sometimes it's confidently wrong.

 

A reliable CAS workflow:

 

List CAS libraries.
List tables in the Samples caslib.
Get column metadata for WATER_CLUSTER.
Fetch three sample records.

 

Then ask for code that uses the real column names. This single habit prevents most errors.

 

Even the most powerful program on the Grid shouldn't be trusted to guess your table names.

 

 

Logs as conversation

 

One of the most underrated features: instead of scrolling through a dense SAS log, just ask:

 

Retrieve the job log. What failed, where, and what should I fix first?

 

The agent summarizes errors, suggests root causes, and can propose corrected code. It doesn't replace your judgment or expertise, but it removes a lot of scrolling.

 

 

Scoring models and decisions

 

This is where things get genuinely interesting. You can list models in SAS Model Manager, browse what's published to the SAS Micro Analytic Service, and score directly from the chat, without manually formatting a REST payload.

 

List published MAS modules.
Score the published model homeloan with this data: ...

 

The agent figures out the required input format and sends it correctly. But what I found most useful was what comes after scoring: you can keep the conversation going.

 

Which model appears more conservative and why?
What do these results suggest about …?

 

The same applies to deployed decisions and rule sets: provide your variables, and the agent handles endpoint discovery, payload formatting, and returns scored outcomes with decision labels. The conversational loop around the result is interesting.

 

 

Reports and file operations

 

The MCP server supports listing SAS Visual Analytics reports, retrieving report metadata, and rendering report elements as images. There are also tools for uploading files to the SAS Viya Files Service, loading CSVs into CAS, and downloading content. I didn't have time to explore these properly during this session, but they're on the list. From what I could see, the same pattern applies: discover first, then operate.

 

 

The practical takeaway

 

The most effective pattern isn't "do everything at once." It's following this pattern:

 

Discover → Generate → Review → Execute → Validate.

 

Stay in control. Let the agent handle the repetitive work: metadata lookup, code generation, job monitoring, log summarization, payload formatting.

 

For SAS users, this is a meaningful step toward a single conversational workflow across SAS Viya.

 

 

What’s Next?

 

  • More SAS MCP tools, I hope.
  • You can directly contribute to the GitHub repository. See the Contributing page on GitHub.

 

 

Plan mode: conversation-driven orchestration

 

GitHub Copilot recently introduced a Plan mode, which sits between asking a question and executing actions.

 

In Plan mode, you describe what you want to accomplish, for example, a data management task with fifteen steps: discover a CAS table, filter it, promote the result, test the number of records, etc. GitHub Copilot produces a structured plan, a sequence of steps, before doing anything.

 

You review and approve the plan, then switch to Agent mode to execute it, at which point Copilot invokes the relevant SAS Viya MCP tools in sequence, rather than orchestrating each step manually yourself.

 

For SAS Viya workflows, this could mean a new way of orchestrating tasks using agents.

 

I have tested this combination with a simple pattern, and the pattern is promising: natural language intent, structured plan, controlled execution. Even some resilience when the user provides incorrect inputs, such as the wrong column name (see bottom right).

 

A step closer to the unified agent experience I described earlier.

 

01_BT_sas_mcp_server_app_github_copilot_plan_mode.png

 

 

Conclusion

 

Using the SAS MCP Server felt less like working with a tool and more like having a fast, knowledgeable colleague sitting next to you, one that knows SAS Viya inside out, never tires of looking up metadata, and can read a log faster than you can scroll it.

 

The rough edges are still there: you need to be deliberate with your prompts, verify results, and stay in control of what gets executed.

 

But the core experience, describing what you want in plain language and watching it happen across SAS Viya, is already real. That's not a small thing.

 

The original Master Control Program (MCP) said "I've got better things to do than play games with you." This one [SAS MCP] disagrees and will happily work through every SAS task you throw at it, and try to get it right.

 

End of line.

 

 

Acknowledgements

 

Acknowledging David Weik, Bryan Behrenshausen, and Harry Keen for their excellent work.

 

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

Dive into keynotes, announcements and breakthroughs on demand.

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

Article Tags