sastool-mcp

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 dayong@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 — MCP Server for SAS Integration Using SASPy

This repository contains a minimal Model Context Protocol (MCP) server that exposes following SAS-powered tools to an MCP-compatible client (e.g., Claude Desktop, GitHub CoPilot):

Tool NameDescription
run_sas(code)Runs SAS code and returns LOG + HTML results
list_libs()Lists assigned SAS/CAS libraries
list_tables(libname)Lists tables in a SAS library
list_directory(path)Lists files on SAS server
save_code(path, filename, content)Save SAS code remotely

Features

  • ✅ Clean MCP through SAS log and listing output
  • ✅ Returns LOG and LST 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

##Watch the video

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)

Use with GitHub Desktop

Edit User mcp.json configuration

{
	"servers": {
		"sastoolmcp": {
			"type": "stdio",
			"command": "uv",
			"args": [
				"run",
				"--with",
				"mcp[cli]",
				"mcp",
				"run",
				"<absolute path to server.py>"				
			]
		}
	},
	"inputs": []
}