SAS

A Model Context Protocol (MCP) server for executing SAS code on SAS Viya environments
  • python

9

GitHub Stars

python

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs

You can execute SAS code on SAS Viya compute contexts through a dedicated MCP (Model Context Protocol) server. It handles authentication, runs your SAS snippets, and returns logs and results to your MCP client, enabling streamlined SAS workflows within your environment.

How to use

You interact with the SAS MCP Server through an MCP client. Start by connecting to the MCP endpoint exposed by the server, then send SAS code snippets for execution. The server processes the code in a Viya compute context and returns the resulting log and listing output so you can review results, iterate, and adjust your SAS programs in a tight development loop. The server supports OAuth2 authentication with PKCE, so you can securely authorize clients without exposing credentials. By default, you access the MCP endpoint at the local host and port where the server runs.

Typical usage patterns include: running small SAS code blocks to validate ideas, executing data steps against Viya compute contexts, and retrieving both the log traces and the produced output tables. You can integrate SAS code execution into automation scripts, notebooks, or development tooling that supports MCP clients.

For client configuration, point your MCP client to the server URL and enable the appropriate authentication flow. Example client configuration shows how to designate the server endpoint and the HTTP-based connection type so your client can initiate MCP sessions and execute SAS code through the MCP API.

How to install

git clone <repository-url>
cd sas-mcp-server

Install dependencies using the supported tool. This process creates a virtual environment by default in the project root named .venv. If the environment is not created automatically, run the following to create and activate it, then re-run the sync step.

uv sync

Note: By default, a virtual environment called .venv is created in the project root. If it is not created, run uv venv and then re-run uv sync.


Configure environment variables needed by the server, then start the MCP server.

cp .env.sample .env

Edit `.env` and set

VIYA_ENDPOINT=https://your-viya-server.com

uv run app

The server will be available at `http://localhost:8134/mcp` by default.

Additional notes

Prerequisites include a Python 3.12+ runtime and a compatible uv (version 0.8+). Your SAS Viya environment must provide a compute service and be configured for MCP usage. Optional Docker-based deployment is available as a separate setup path.

Available tools

execute_sas_code

Executes SAS code snippets on SAS Viya compute contexts and returns the execution log and listing output.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational