sas
A Model Context Protocol (MCP) server for executing SAS code on SAS Viya environments
claude mcp add --transport stdio sassoftware-sas-mcp-server uvx run app \ --env VIYA_ENDPOINT="URL to your SAS Viya endpoint (e.g., https://your-viya-server.com)"
How to use
This MCP server provides a HTTP-based interface to execute SAS code on a SAS Viya compute context. It authenticates clients using OAuth2 with PKCE and exposes an MCP endpoint that accepts SAS code submissions and returns execution results, including logs and listing output. The primary tool available through this server is execute_sas_code, which lets clients send SAS snippets and receive the resulting logs and output. Clients can configure an MCP client to point to http://localhost:8134/mcp and use the SAS MCP endpoint to run code against a connected Viya environment.
How to install
Prerequisites:
- Python 3.12+ installed
- uv 0.8+ installed
- SAS Viya environment with a compute service configured for MCP
- Optional: Docker if you prefer containerized setup
Installation steps:
- Clone the repository:
git clone <repository-url>
cd sas-mcp-server
- Install dependencies via uv:
uv sync
Note: This will by default create a virtual environment named .venv in the project root. If the virtual environment is not created, run uv venv and then re-run uv sync.
Configuration:
- Copy the environment sample and set your Viya endpoint:
cp .env.sample .env
Edit .env and set:
VIYA_ENDPOINT=https://your-viya-server.com
Run the server:
uv run app
The MCP server will be available at http://localhost:8134/mcp by default.
Optional Docker-based setup:
- If you prefer Docker, follow docker/setup.md in the examples folder (not shown in this README).
Additional notes
Environment variables and configuration:
- VIYA_ENDPOINT must point to your SAS Viya instance with MCP configuration enabled.
- The server uses PKCE-based OAuth2 flow for client authentication; ensure your MCP clients are configured accordingly.
- If you encounter issues starting the server, ensure the .venv is created and dependencies are installed via
uv sync. - The default MCP URL is http://localhost:8134/mcp; adjust if you change the port or host in configuration.
- If using Docker, ensure the container has access to the Viya endpoint and proper network permissions.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP