1. Conduid
  2. AI
  3. Sas MCP Server
MCP server · AI

Sas MCP Server

AIOT MCP Server

Unclaimed ai
34Low

Scored 14 days ago · breakdown

About Sas MCP Server

Sas MCP Server is an MCP server published by sassoftware in the AI category: aIOT MCP Server.

The repository has 66 stars and 25 forks, with the last commit yesterday. Recent commit activity is the strongest signal that reported issues will get attention.

Install

From source
git clone https://github.com/sassoftware/sas-mcp-server

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Tools (77)

activate_lookup_tableMake a version the active one and wait for the publish to settle (`active`, `running` or `failed` with the reason); an earlier version (a rollback) or one whose activation failed is activated as a new version with its entries; `republish` copies the active version to MAS and CAS again

Parameters not published.

apply_report_operationsThe authoring workhorse — apply an ordered batch of native VA operations (`addData`, `addPage`, `addObject`, `updateObject`, `setParameterValue`, `updateData`, `changeData`, `applyDataView`) to a report. Give a page a **title** with `addPage`'s `title` field (a text band at the top of the page body — VA headers are controls-only); title every chart at add time via `options.object.title`; arrange objects with **placement** — `page`, `relativeToObject` (left/right/top/bottom for columns, rows, and grids), `container` (group into a `standardContainer`), or `report` (`new_page` creates-and-names a page inline for one-batch multi-page reports). The batch is atomic. Validates every operation, object key, and placement against the catalog first (reporting all errors at once), supports `dry_run`, handles the ETag concurrency handshake, and — with `save_as=true` plus `result_report_name`/`result_folder` — applies the batch **save-as** to a new report, leaving the source untouched. The flag alone decides the mode: without it the report is edited in place, and a name or folder given without it is refused rather than acted on. Typical loop: `describe_report_objects` → `get_castable_columns` → `apply_report_operations` → `get_report_outline` / `export_report` (png, page-by-page) to verify.

Parameters not published.

cancel_jobCancel a running job

Parameters not published.

catalog_download_table_profileDownload a table's data dictionary and column profile as CSV, identified by either `instance_id` or `resource_uri`.

Parameters not published.

catalog_find_instanceResolve the catalog *instance* for a source-asset `resource_uri`, bridging a search hit to the profiling and download tools without handling an instance id by hand.

Parameters not published.

catalog_get_adhoc_analysisPoll a profiling job and cross-check the target instance, reporting `profile_ready` once results have landed on the asset — so a download isn't fired too early.

Parameters not published.

catalog_get_agent_historyInspect an agent's run history — status and how much metadata each run enumerated/added/updated/removed.

Parameters not published.

catalog_list_agentsList the catalog's discovery agents (the crawlers that populate metadata).

Parameters not published.

catalog_run_adhoc_analysisSubmit an ad-hoc profiling job for a table. NLP enrichment (language, sentiment, semantic IDs) is on by default, populating `informationPrivacy`, `nlpTerms`, `nlpTags`, and `mostImportantFields`.

Parameters not published.

catalog_run_agentStart a discovery agent run (asynchronous) to crawl its data source and refresh catalog metadata.

Parameters not published.

Show all 77 tools
catalog_searchSearch the catalog for assets (tables, columns, reports, …) using the SAS catalog search grammar (free text, facets like `AssetType:Report`, ranges). Each hit carries a `resource_uri` you can hand to the matching tool (e.g. `get_report`, `get_castable_data`).

Parameters not published.

catalog_search_helperDiscover how to query the catalog — list the available facets, or the valid values for one facet — so you can build precise `catalog_search` queries.

Parameters not published.

copy_decisioning_assetCopy a rule set (with its rules), decision, segmentation tree, code file, value list or lookup table into a folder

Parameters not published.

copy_reportCopy a report to a new one (optionally renaming/refoldering). Pairs with a `changeData` operation for the copy-and-replace pattern.

Parameters not published.

create_glossary_termCreate a term. **Publishes by default** — the underlying API creates an invisible draft unless told otherwise; `update_glossary_term(publish=true)` promotes one later

Parameters not published.

create_lookup_tableCreate one from `{"key": "value"}` or a list of entries, with optional column labels, in a folder; `activate` publishes it right away

Parameters not published.

create_ml_projectCreate a new AutoML project from a loaded, global-scope CAS table (caslib + table + optional CAS server)

Parameters not published.

create_reportCreate a Visual Analytics report and return its id. Optionally pass an `operations` array to build the whole report in one atomic call; the result carries the created page/object names+labels and a verify hint.

Parameters not published.

create_segmentation_tree_from_tableBuild one tree from a strategy table — one row per branch, a column per decision key — as FICO-style exports (TRIAD, Blaze) describe a strategy. Keys are tested in column order and only where they split; values are range lower bounds (`split="lower_bound"`) or exact values. Reads inline rows, a CSV, or a CAS table (load an Excel sheet with **upload_data**), can create a value list per variable, and reports leaves, outcomes and any rows whose path is identical but whose outcome differs

Parameters not published.

delete_glossary_termPermanently delete a term and every assignment that referenced it. There is no cascade — a term with children is refused, so delete a subtree leaf-first

Parameters not published.

delete_reportDelete a report and its content.

Parameters not published.

describe_report_objectsDiscover what a report can contain — the eight report operations and every addable object (bar chart, list table, geo map, key value, …) with a one-line purpose, its data roles, common options, and an example payload. Call with no arguments for the catalog (including an intent→object map, placement guide, layout recipes, and the API's hard limits), `object_type=` for one object's contract (colloquial aliases like `kpi` resolve), `category=` to filter, or `operation=` for one operation's full shape — `operation="addData"` documents `dataItems` (column renames, SAS formats, aggregations, geography classification). Backs the `apply_report_operations` loop.

Parameters not published.

download_fileDownload file content

Parameters not published.

execute_sas_codeExecute SAS code snippets and retrieve execution results (log and listing output), plus a link to the [HTML results](#html-results) unless `html_results=false`. Runs in a reusable compute session that is kept warm across calls, so SAS state (WORK tables, macro variables, assigned librefs) persists between successive calls

Parameters not published.

export_reportexport a report (or specific report objects) in any format the VA service supports — `package` (zip), `pdf`, `png`, `svg`, `csv`, `tsv`, `xlsx`, or `summary`. Text formats come back inline, `png` as image content, and binary formats (`package`/`pdf`/`xlsx`) as an embedded file with the right MIME type.

Parameters not published.

find_folderLook up a SAS Content folder by path (`/Public/Content/Decisions`, `My Folder`, `My Folder/Risk`), ID or URI, and return its ID, URI, name and full path — for confirming a folder the user named, or getting the URI that `upload_file` and `MCP_DEFAULT_FOLDER` take

Parameters not published.

get_castable_columnsGet column names, types, labels, formats

Parameters not published.

get_castable_dataFetch sample rows from a CAS table

Parameters not published.

get_castable_infoGet table metadata (row count, columns, size)

Parameters not published.

get_compute_table_dataFetch a page of rows from a table in a SAS library, values formatted as SAS displays them — the compute-tier counterpart of `get_castable_data`

Parameters not published.

get_decision_flow_codeRetrieve the generated DS2 execution code for a flow

Parameters not published.

get_decisioning_asset_codeThe DS2 Viya generates for a rule set, decision or segmentation tree, or a code file's source

Parameters not published.

get_glossary_termOne term in full, with its custom attributes named rather than hashed

Parameters not published.

get_job_logRetrieve job log

Parameters not published.

get_job_statusCheck job state

Parameters not published.

get_lookup_tableVersions (which one is active, which failed to activate and why), one version's entries — paged, filtered by key — and the rule sets that use the table

Parameters not published.

get_mas_module_step_signatureInspect a published MAS module step's input/output variable signature before scoring

Parameters not published.

get_reportGet report metadata and definition

Parameters not published.

get_report_outlineRead a report's structure back — pages → objects with the handles the other tools need (object `name` for placement/`updateObject` targets, `label` for `export_report`, page `label` for page placement).

Parameters not published.

import_glossary_termsCreate many terms, and their hierarchy, in one call. Children name their parent instead of needing its id, so rows can be given in any order and no id is threaded between levels; per-row failures are reported individually. Returns the `term_id` of each row's term, so the next step needs no lookup, and separates rows that were genuinely new from rows whose term already existed — the import job counts both as successful. A row is written whole, so `update_existing` *replaces* the term at that path rather than merging into it. `dry_run=true` shows the resolved rows without importing — the interactive view turns that into a table with an Import button

Parameters not published.

list_business_ruleset_revisionsList a rule set's locked revisions

Parameters not published.

list_cas_serversList available CAS servers

Parameters not published.

list_caslibsList CAS libraries on a server

Parameters not published.

list_castablesList tables in a CAS library

Parameters not published.

list_compute_columnsList the columns of a table in a SAS library

Parameters not published.

list_compute_contextsList available compute contexts

Parameters not published.

list_compute_librariesList the SAS libraries (librefs) assigned in a compute context

Parameters not published.

list_compute_tablesList the tables in a SAS library within a compute context

Parameters not published.

list_filesList files in the Viya Files Service

Parameters not published.

list_glossary_termsExact structural listing — by term type, by parent (the authoritative hierarchy), or by name fragment. `include_attributes` returns each term's attribute values (free — the listing already carries them), and `attribute_filter` keeps only the terms matching, e.g. `{"Used in Risk": true}`. The glossary cannot filter on attributes server-side, so that filter is applied here and the result reports how much of the dictionary it scanned

Parameters not published.

list_jobsList recent/running jobs

Parameters not published.

list_mas_modulesList published MAS modules

Parameters not published.

list_ml_projectsList AutoML projects

Parameters not published.

list_publishing_destinationsList available scoring/publishing destinations, for use with **publish_ml_champion_model**

Parameters not published.

list_registered_modelsList models in repository

Parameters not published.

list_reportsList Visual Analytics reports

Parameters not published.

list_source_tablesList source tables not yet loaded into memory (candidates for promotion)

Parameters not published.

list_table_termsThe reverse — every column of a table and the term assigned to it, with the term's definition inline. The fastest read on whether a table is governed

Parameters not published.

list_term_assetsThe columns a term is attached to, with their tables. The authoritative answer to "where is this term used?"

Parameters not published.

lock_business_ruleset_revisionLock the current rule set state as an immutable revision (what a decision step references)

Parameters not published.

promote_table_to_memoryLoad a source table into memory at global scope (idempotent)

Parameters not published.

publish_decision_flowPublish a locked decision revision to a MAS destination, polling to completion and returning the server-generated MAS `moduleId` (directly usable with **get_mas_module_step_signature** / **score_data**). The code is generated for MAS, as SAS Intelligent Decisioning publishes it, so lookup tables work; the module's inputs keep the decision's variable names (the UI would add a trailing underscore, `credit_score_`)

Parameters not published.

publish_ml_champion_modelPublish an AutoML project's champion model to a scoring destination

Parameters not published.

query_dataRun a FedSQL `SELECT` against CAS or compute data and get the rows back — one SQL surface over both storage tiers. Pick the tier with `target` (`cas` for `caslib.table`, `compute` for `libref.table`); joins, subqueries, aggregation, and `UNION` all work, and the row cap is applied server-side by the tool (a `LIMIT` you write is ignored, since a malformed one is silently discarded by CAS). Optionally returns the query as `CREATE VIEW` text for you to run yourself. Reads only: writes are refused pre-flight, and SAS macro triggers (`%`/`&`) are rejected because the macro processor would expand them outside SQL. Note the two tiers cannot be joined in one statement.

Parameters not published.

register_ml_champion_modelRegister an AutoML project's champion model to the Model Repository

Parameters not published.

reset_compute_sessionDelete the cached compute session for a context, discarding its SAS state and forcing a fresh session on the next call

Parameters not published.

run_ml_projectRun pipeline automation

Parameters not published.

score_dataScore data against a published model or decision; for a decision published from the Intelligent Decisioning UI, whose inputs carry a trailing underscore, the plain names are accepted and mapped (`inputs_renamed`)

Parameters not published.

search_glossary_termsFree-text, ranked search over term names and definitions — the way in when you know a word rather than an id. Reports `assigned_asset_count`, so you can see whether a term is actually in use

Parameters not published.

submit_batch_jobSubmit a SAS job for async execution

Parameters not published.

update_glossary_termChange a term's text, parent or attributes. Merges onto the current term, so omitted fields are left alone rather than blanked; `parent_id` moves it in the hierarchy, and `publish` promotes a draft. A draft is a separate resource in the API, so this routes the write accordingly — editing one otherwise fails with a bare 404

Parameters not published.

update_lookup_tableAdd or overwrite entries, remove keys, or replace them all; rename; relabel. An active version is never changed — a new version is started from it — and rules keep the active one until the new one is activated (`activate` does that in the same call)

Parameters not published.

upload_dataUpload a data file into a CAS table — read **server-side** so the data never passes through the model's context — from `file_path` (the server reads it off disk) or `url` (the server fetches it and converts it to the multipart upload the endpoint requires). Ingests the formats the casManagement `uploadTable` API accepts — csv, tsv (csv + tab delimiter), xls, xlsx (single sheet), sas7bdat, sashdat — auto-detected from the extension or set with `data_format`. parquet is not accepted by that endpoint and is rejected up front with guidance (load via a path-based caslib + `promote_table_to_memory`, or convert to csv/sas7bdat).

Parameters not published.

upload_fileUpload a file to the Viya Files Service, optionally into a Content folder (`parent_folder_uri`). Content comes from exactly one of `content` (inline text), `file_path` (read **server-side**, binary-safe — xlsx, zip, images — gated by `ALLOW_LOCAL_FILE_UPLOAD`), or `url` (server-side fetch)

Parameters not published.

upload_inline_dataCreate a *small* CAS table from inline csv/tsv text passed as a string (a lookup/mapping table the model builds on the fly, or a quick test table). The payload travels through the model's context, so it's for tiny tables only — use **upload_data** for files or anything larger.

Parameters not published.

validate_custom_functionCompile a custom function without saving it and return the compiler's error lines

Parameters not published.

validate_decision_expressionCompile a DS2 expression — a rule condition or action, a branch, a condition step — against a signature and return the compiler's error lines, before it goes into a rule set or decision

Parameters not published.

Ask AI

✦

Ask AI about Sas MCP Server

Powered by Claude · Grounded in docs

I know everything about Sas MCP Server. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

  • ✓README presentThe repository ships documentation.

5 checks have not been run yet.

README

SAS MCP Server

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

Features

  • Execute SAS code on SAS Viya compute contexts
  • OAuth2 authentication with PKCE flow
  • HTTP-based MCP server compatible with MCP clients

Getting Started

Prerequisites

Installation

  1. Clone the repository:
git clone <repository-url>
cd sas-mcp-server
  1. Install dependencies
uv sync

NOTE: This will by default create a virtual environment called .venv in the project's root directory.

If for some reason the virtual environment is not created, please run uv venv and then re-run uv sync.

Usage

  1. Configure environment variables:
cp .env.sample .env

Edit .env and set

VIYA_ENDPOINT=https://your-viya-server.com
  1. Start the MCP server (see Choosing a deployment mode below):

Option A: HTTP mode (pre-run the server, connect from MCP client)

uv run app

The server will be available at http://localhost:8134/mcp by default. Authentication is handled via OAuth2 PKCE flow in the browser.

Option B: Stdio mode (MCP client starts the server on demand)

Set VIYA_USERNAME and VIYA_PASSWORD in your .env file, then configure your MCP client to launch the server directly (see below).

Option C: Docker / Podman (containerized deployment)

docker build -t sas-mcp-server .
docker run -e VIYA_ENDPOINT=https://your-viya-server.com -p 8134:8134 sas-mcp-server

Choosing a deployment mode

HTTP Stdio Docker
How it runs Long-running server you start separately MCP client spawns it on demand Containerized HTTP server
Authentication OAuth2 PKCE flow (browser popup) Password grant (credentials in .env) OAuth2 PKCE flow (browser popup)
Best for Multi-user or shared setups; production-like environments Single-user local development; quick experimentation Team deployments; CI/CD; environments without Python installed
Requires Python + uv Python + uv Docker or Podman only
Credentials stored? No — user authenticates interactively Yes — username/password in .env No — user authenticates interactively
MCP client config Point client to http://localhost:8134/mcp Client runs uv run app-stdio Point client to http://host:8134/mcp

Quick guidance:

  • Starting out or exploring? Use stdio — zero setup beyond .env, and your MCP client manages the server lifecycle.
  • Need secure, interactive auth? Use HTTP — no stored passwords, each user authenticates via browser.
  • Deploying for a team or on a server? Use Docker — portable, no Python dependency on the host, easy to integrate with orchestrators.
  • Using Gemini CLI? Use stdio — Gemini CLI does not support HTTP mode or browser-based OAuth. See Gemini CLI configuration.

Available Tools

Code Execution

  • execute_sas_code: Execute SAS code snippets and retrieve execution results (log and listing output)

Data Discovery (CAS Management)

  • list_cas_servers: List available CAS servers
  • list_caslibs: List CAS libraries on a server
  • list_castables: List tables in a CAS library
  • get_castable_info: Get table metadata (row count, columns, size)
  • get_castable_columns: Get column names, types, labels, formats
  • get_castable_data: Fetch sample rows from a CAS table

Data Operations & Files

  • upload_data: Upload CSV data into a CAS table
  • promote_table_to_memory: Promote a table to global scope in CAS
  • list_files: List files in the Viya Files Service
  • upload_file: Upload a file to Viya Files Service
  • download_file: Download file content

Reports & Visualization

  • list_reports: List Visual Analytics reports
  • get_report: Get report metadata and definition
  • get_report_image: Render a report section as an image

Batch Jobs

  • submit_batch_job: Submit a SAS job for async execution
  • get_job_status: Check job state
  • list_jobs: List recent/running jobs
  • cancel_job: Cancel a running job
  • get_job_log: Retrieve job log

Model Management & Scoring

  • list_ml_projects: List AutoML projects
  • create_ml_project: Create a new AutoML project
  • run_ml_project: Run pipeline automation
  • list_registered_models: List models in repository
  • list_models_and_decisions: List published MAS modules
  • score_data: Score data against a published model

Prompt Templates

  • debug_sas_log: Analyze SAS log for errors with root-cause explanations
  • explore_dataset: Generate data-profiling SAS code
  • data_quality_check: Generate DQ assessment code
  • statistical_analysis: Set up a statistical workflow with diagnostics
  • optimize_sas_code: Review and optimize SAS code
  • explain_sas_code: Block-by-block code explanation
  • sas_macro_builder: Build production-quality SAS macros
  • generate_report: Generate ODS/PROC REPORT code

MCP Client Configuration

Example configurations are provided in the examples/ folder. Below are quick-start snippets for common clients.

VS Code / Cursor / Claude Code (.vscode/mcp.json)

HTTP mode (requires uv run app running separately):

{
    "servers": {
        "sas-execution-mcp": {
            "url": "http://localhost:8134/mcp",
            "type": "http"
        }
    }
}

Stdio mode (starts the server on demand):

{
    "servers": {
        "sas-execution-mcp": {
            "command": "uv",
            "args": ["run", "app-stdio"],
            "cwd": "${workspaceFolder}"
        }
    }
}

Gemini CLI (.gemini/settings.json)

Gemini CLI only supports stdio mode. Add to your ~/.gemini/settings.json or project-level .gemini/settings.json:

{
    "mcpServers": {
        "sas-viya-mcp": {
            "command": "uv",
            "args": ["run", "app-stdio"],
            "cwd": "/path/to/sas-mcp-server",
            "timeout": 60000
        }
    }
}

Note: The timeout field (in milliseconds) is important — SAS Viya API calls can take longer than the Gemini CLI default of 10 seconds. A value of 60000 (60s) is recommended. Set cwd to the absolute path of your sas-mcp-server checkout.

Example

Execute SAS code through the MCP tool:

data work.students;
input Name $ Age Grade $;
datalines;
Alice 20 A
Bob 22 B
;
run;

proc print data=work.students;
run;

For more details, configuration options, and deployment options, please refer to the examples folder and follow the instructions listed there.

Testing

The project includes two layers of tests: unit tests (fast, no credentials required) and integration tests (run against a real SAS Viya instance).

Running Unit Tests

Unit tests verify tool schemas, request payloads, and internal logic without making any network calls:

./run_tests.sh

Or directly via pytest:

uv run python -m pytest -m "not integration" -v

Running Integration Tests

Integration tests call every tool against a live Viya environment. They require credentials, which can be provided via CLI arguments or .env:

Using .env (set VIYA_ENDPOINT, VIYA_USERNAME, VIYA_PASSWORD):

./run_tests.sh --integration

Using CLI arguments:

./run_tests.sh --integration \
    --endpoint https://your-viya-server.com \
    --username youruser \
    --password yourpassword

Integration tests only (skip unit tests):

./run_tests.sh --integration-only

Test Structure

File Description
tests/test_tool_payloads.py Payload assertions for all 26 tools — verifies URL paths, JSON body structure, query params, and headers
tests/test_integration.py End-to-end workflow tests against a real Viya instance
tests/test_tools.py Unit tests for HTTP helper functions (_get_json, _post_json, etc.)
tests/test_viya_utils.py Unit tests for Viya compute session and job utilities
tests/test_mcp_server.py Unit tests for MCP server and auth middleware
tests/test_prompts.py Unit tests for prompt template rendering
tests/test_config.py Unit tests for configuration loading

Contributing

Maintainers are accepting patches and contributions to this project. Please read CONTRIBUTING.md for details about submitting contributions to this project.

License & Attribution

Except for the the contents of the /static folder, this project is licensed under the Apache 2.0 License. Elements in the /static folder are owned by SAS and are not released under an open source license. SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration.

Separate commercial licenses for SAS software (e.g., SAS Viya) are not included and are required to use these capabilities with SAS software.

All third-party trademarks referenced belong to their respective owners and are only used here for identification and reference purposes, and not to imply any affiliation or endorsement by the trademark owners.

This project requires the usage of the following:

  • Python, see the Python license here
  • FastMCP, under the Apache 2.0 License
  • uvicorn, under the BSD 3-Clause
  • starlette, under the BSD 3-Clause
  • httpx, under the MIT license

README copy captured when this server was indexed; it may lag the repository. The original is authoritative.

Questions

About Sas MCP Server

How do I install Sas MCP Server?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is Sas MCP Server safe to use with an AI agent?

Its trust score is 34 out of 100 (low). It passes 1 of the 1 static security checks run so far. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Sas MCP Server still maintained?

Yes — the last commit was yesterday. The repository has 66 stars and 25 forks.