BookmarkSubscribeRSS Feed

A ModelContextProtocol Server(mcp) for Scoring with SAS Viya - Part 2: Persistence

Started ‎07-31-2025 by
Modified ‎07-31-2025 by
Views 262

Introduction:

 

In the previous article I introduced a mcp server for scoring with SAS Viya. The next logical step is to persist scoring results  for post processing. The old me would have added added some code to the  scoring tool to persist the data. But with mcp servers I can pick and choose how and where I want to persist the data with little  or no coding. See this link for some mcp servers for data bases.

 

In this article, I am using the mcp/redis server to publish the scoring results to a SAS Viya CAS table. This allows me to post process the results immediately with SAS Viya. The picture below shows the flow. Given the architecture, I can replace the entire persistence flow with different set of mcp servers.

 

Why Redis? A few years ago, I worked on a POC which required streaming the scores (using SCR) via Redis. The solution consisted of a small set of custom docker containers in a pipeline.

 

Score and Persist.png

Key points:

  • The boxes in blue are the custom code I developed for this article
  • The viyascoring mcp is the custom mcp server that was described in the previous article.
  • mcp/redis is an open-source server from Redis. It requires a Redis server 
  • The Redis server is the non-commercial version of Redis. This is ok for the demo, but you know the drill - for production systems get a commercial license.
  • The subscriber is custom code 
    • Subscribes to a specific channel( "score" in this demo)
    • The received message is used to update a master table in SAS Viya
  • The mcp server code is available on github at this link
  • The redis subscriber code is available at this link

 

 

Solution in Action

 

Finally

Hopefully I have convinced my fellow  SAS developers to enable their users to access the models using prompts.

 If you do not know JavaScript or Python partner with an expert in those languages. 

 

 

Contributors
Version history
Last update:
‎07-31-2025 06:07 PM
Updated by:

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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