samiulhq/sastool-mcp
3.2
If you are the rightful owner of sastool-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
sastool is a minimal Model Context Protocol (MCP) server designed to run SAS code via SASPy, providing tools for listing SAS libraries and executing SAS code.
Tools
2
Resources
0
Prompts
0
sastool β A Tiny MCP Server for Running SAS Code via SASPy
This repository contains a minimal Model Context Protocol (MCP) server that exposes two SAS-powered tools to an MCP-compatible client (e.g., Claude Desktop):
listlibraries
β lists assigned SAS libraries (including CAS libs)runsascode
β executes SAS code and returns SAS log and listing output
Itβs built with FastMCP
and saspy
.
βοΈ Features
- β Clean MCP through SAS log and listing output
- β
Returns
LOG
andLST
from SASPy - β Easy integration with Claude Desktop
SASPy Configuration
SASPy requires a configuration that specifies how it connects to SAS. To configure SASPy follow the instructions here.
βοΈ Use with Claude Desktop
Click to see the demo
Edit your claude_desktop_config.json:
{
"mcpServers": {
"sastool": {
"command": ",/absolute/path/to/.venv/bin/python or uv>",
"args": ["run", "--with", "mcp[cli]","/absolute/path/to/server.py"],
"env": {
"SAS_CONFIG_NAMES": "default",
"PYTHONUNBUFFERED": "1"
},
"disabled": false
}
}
}
Example flow with Claude
sequenceDiagram
autonumber
participant U as User
participant C as Claude Desktop<br/>(Sonnet 4.5)
participant M as MCP Server<br/>(server.py / FastMCP)
participant P as SASPy
participant VC as SAS Viya Compute
participant CAS as CAS / CASLIBs
U->>C: Analysis request from user
C->>C: Generate SAS Code:code
C->>M: MCP tool call: runsascode(code)
M->>P: sas.submit(code, results='HTML')
P->>VC: Start compute session
VC->CAS: CAS Initiate
CAS-->>VC: Data access / processing
VC-->>P: Return LOG and ODS results
P-->>M: {"LOG": "...", "LST": "<html>...</html>"}
M-->>C: Return MCP JSON
C->>C: Evaluate and generate additional SAS code if needed
C-->>U: Display results (HTML tables/graphs)