Desktop vs. Platform How It Works Supported Stacks Deployment About Us
Book a Demo Download Desktop

Bounded AI Harness · MCP Servers · BYO Model or Air-Gapped

How the SAS2PY AI harness works—and how your own agents call our parsers.

Deterministic parsers convert 90%+ of SAS without touching an LLM. When a block fails row-level parity, our bounded AI harness proposes a targeted fix from the mismatch log, waits for a named engineer’s diff approval, and re-validates every row. Plus, MCP servers let Cursor, GitHub Copilot, Claude, and Databricks agents invoke our parsers directly on local files.

1 · Why Parser-First

A chat window guesses. A parser + bounded AI harness knows.

An enterprise migration spans thousands of blocks, datasets that flow across files, and implicit rounding or date rules. Pasting raw legacy code into an LLM prompt sees none of that—and produces different code on every run. SAS2PY separates deterministic compilation from bounded AI exception handling.

The parser is the compiler

Deterministic facts, identical every run

AST blocks, input/output datasets, cross-file lineage, and target schemas come from source-specific deterministic parsers. Re-run it 100 times and you get the exact same code.

The AI harness is for exceptions

Invoked only where parity fails

AI is never used where a deterministic parser already succeeded. It is called only on unresolved edge cases or row-level parity mismatches, pulling parser lineage and the exception diff via tools.

Verification-gated acceptance

Human approval + row-level re-check

The harness enforces your project RBAC, requires a named engineer to approve the before/after diff, and rejects the change unless row-by-row Data Matching passes.

CapabilityRaw LLM prompting or generic coding assistantSAS2PY (Deterministic Parsers + Bounded AI Harness)
90%+ standard codeLLM re-generates every line from scratch; output changes between runs.Converted by deterministic parsers—repeatable, fast, zero LLM tokens required.
Cross-file lineageMissed when files exceed context windows or are prompted one by one.Extracted up front by the parser so table dependencies and wave order are exact.
Exception remediationEngineer copy-pastes stack traces into chat and hopes the rewrite works.Bounded AI harness reads the original source AST, lineage, and exact row mismatch delta.
Row-by-row validationManual spot-checking by eye.Automated Data Matching checks every row and aggregate before and after any AI fix.
Audit & model-risk evidenceEphemeral chat history on a developer’s laptop.Signed evidence pack recording the parity result, code diff, model used, and named approver.

2 · Human-in-the-Loop Governance

How the harness fixes a failing block—and proves the fix held.

  1. Verify RBAC

    Confirms the engineer’s own login token and project permissions before reading any block.

  2. Load parser facts

    Pulls the source block, cross-file lineage, schema, and exact row-level parity mismatch.

  3. Propose a diff

    Reasons against the original legacy source and presents a side-by-side before/after diff.

  4. Approve & re-check

    A named engineer allows or denies the write, then Data Matching re-validates every row.

Strict guardrails for regulated estates

  • The engineer’s own login. Every call carries that person’s token and project rights. There is no master key, and no approval can grant what RBAC refused.
  • Nobody watching means no. By default every write waits for a named engineer. If no one is connected to approve, the write is denied—never silently applied.
  • Scoped to converted code only. Original legacy files and baseline datasets are read-only; the harness can only propose edits to the target block inside the engineer’s project.
  • Read-back & row re-validation. Every saved block is read back to verify integrity and immediately re-run through Data Matching against the legacy baseline.

Every run ends with one honest status

  • fixed
  • healthy
  • blocked
  • needs review
Permission requiredsave converted code · write
Beforedf = spark.table(src)
out = df.filter(
  col('amt') > 0)
out.write.save(t)
Afterdf = spark.table(src)
out = df.filter(
  col('amt').isNotNull()
  & (col('amt') > 0))
out.write.save(t)
AllowAllow for this runDeny
Every decision is logged to the block’s audit evidence pack:
  • parity.resultrow-by-row match against the original: rows, columns, exceptions
  • auth.checkwhich engineer, which project
  • model.selectedwhich approved model proposed the change
  • code.changeexact before and after diff
  • permission.decisionallow or deny, signed by a named engineer
  • parity.recheckvalidated again after the save (0 exceptions)

3 · MCP Servers & REST API

Call SAS2PY deterministic parsers from Cursor, Copilot, Claude, or Databricks.

Every SAS2PY parser is packaged as a local Model Context Protocol (MCP) server and REST API. Your IDE or agent passes a local file path; the deterministic parser runs on disk and writes converted SQL, PySpark, notebooks, lineage, and gap reports to a shared work folder. Only file paths and status cross MCP—your source code and converted code never pass through the LLM context window.

An AI client calls a SAS2PY MCP server Pipelines and scripts can call the same functions over a REST API. The MCP client sends a tool call with a file path. The SAS2PY MCP server parses, analyzes, and converts the file, and writes code, lineage, dependencies, and reports to a shared work folder. Only paths and a short status return to the client. MCP client Your IDE or Agent Cursor, Claude, Copilot, Databricks agents “Convert this to SQL” Pipelines, scripts, CI/CD Opens the results REST API tool call + path paths + status convert_*(path) paths + status SAS2PY MCP + REST API Parsers Deterministic, same output every run Analysis and lineage Dependencies, complexity, mappings Conversion SQL, PySpark, notebooks, dbt Lands in the work folder Python / PySpark SQL Lineage and mappings File dependencies Analysis and gap reports Shared work folder Source files go in, results come out. Only paths cross MCP, so the code never passes through the model.

What an agent can call

  • parse_*List what a source contains: jobs, mappings, scripts, blocks, stored procedures.
  • analyze_*Complexity, dependencies, and the constructs that need review. Also workload assessment, readiness, and gap reports.
  • atlas_bundleSource-to-target mapping and lineage, written beside the converted code. Also lineage reports for dbt projects and BusinessObjects.
  • convert_*Deterministic conversion to SQL, PySpark, notebooks, or dbt, for the dialect you choose.
  • validate_*Checks on generated SQL, dbt projects, and migrated scripts.

Each server reads and writes only inside the folder you give it.

One config entry per server

// mcp.json in Cursor, VS Code, Claude, or your agent
{
  "mcpServers": {
    "datastage": {
      "type": "stdio",
      "command": "python",
      "args": ["/path/to/datastage_parser/mcp/datastage_server.py"],
      "env": {
        "DATASTAGE_SHARED_ROOT": "/path/to/workdir"
      }
    }
  }
}
  • Cursor
  • VS Code / GitHub Copilot
  • Claude Code
  • Databricks agents
  • Snowflake Cortex agents
  • Custom CI/CD pipelines
Runs beside the platform or locally

Deploys next to SAS2PY with Docker, Podman, Kubernetes, or OpenShift, or locally alongside your IDE. In your own installation, nothing leaves your network.

Same access and approvals

Every MCP or API call carries the caller’s own token and project rights. Writes still wait for a named engineer.

Same evidence pack

Calls from outside agents land in the same record as SAS2PY AI: the diff, the approver, and the parity result.

IDE & Notebook Workflow

Ask your AI client. Open a notebook with lineage already wired.

Click any legacy source on the left (or watch it cycle). Your AI client calls the SAS2PY MCP server, which parses structure, lineage, and dependencies on disk and writes the converted SQL and Python notebook.

From a legacy file to a Databricks notebook through SAS2PY MCP Click any legacy source SAS to preview the AI client prompt, MCP server parse/analyze/convert steps, and the resulting Databricks SQL and Python notebook. AI client asked: Convert orders_summary.yxmd to Databricks SQL and Python SAS.sas .yxmd SAS2PY MCP server 1. Parse42 Alteryx nodes & expressions 2. AnalyzeLineage and file dependencies 3. ConvertDatabricks SQL & PySpark files Files stay on disk. Only paths cross MCP. Databricks notebook orders_summary.yxmd SQL -- generated by SAS2PY (Alteryx MCP) CREATE VIEW orders_summary AS SELECT region, SUM(amount) AS total FROM main.sales.orders GROUP BY region; PySpark df = spark.table("main.sales.orders") out = df.groupBy("region").sum("amount") out.write.saveAsTable("orders_summary") Lineage Dependencies Analysis

Anything the deterministic parser cannot convert is flagged explicitly in the gap report—never silently guessed.

Supported MCP Servers

MCP servers. One per legacy source or SQL tool.

Each server wraps a deterministic SAS2PY parser. Tool names below are what your IDE or agent sees; target dialects are set per call.

SourceAn agent can callProduces
SAS
extract_jobsparse_jobsconvertanalyzesql_to_datastage
SQL or PySpark for Databricks, Snowflake, BigQuery, Oracle, or Fabric. Analysis reports, mapping bundles, and Databricks Asset Bundles.

SAS is converted and remediated through the SAS2PY platform and Desktop analyzer. Row-by-row Data Matching runs in the SAS2PY Enterprise Platform.

4 · Approved Models & Air-Gapped Mode

Use the model your security team already approved—or turn AI off completely.

SAS2PY AI calls the model endpoint you configure inside your own cloud tenant. A private self-hosted model inside your VPC works out of the box, and every change is still checked row by row.

  • Azure OpenAIOpenAI models in your Azure tenant
  • Amazon BedrockClaude and other models in your AWS account
  • Google Vertex AIGemini in your Google Cloud project
  • DatabricksModel Serving in your workspace
  • Snowflake CortexInside your Snowflake account
  • Self-hosted / Air-GappedPrivate models you run—or AI completely off

Air-gapped estates can run with AI turned off (`AI_ENABLED=false`). The deterministic parsers still convert 90%+ of the workload and Data Matching still validates every row.

Databricks ISV Partner

Every legacy source lands as native Databricks code

SAS2PY works alongside Databricks Lakebridge to emit native PySpark, Delta Lake SQL, Unity Catalog table names, and Databricks Asset Bundles—with the same row-level parity check whether a block came from a deterministic parser or the AI harness.

Preview all source → target routes →  ·  Self-hosted deployment specs →

See the AI harness and MCP servers on your own code.

Run local analysis with SAS2PY Desktop for free, or bring a legacy file to a 30-minute Platform Demo.