SPSS-MCP
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
SPSS-MCP
An MCP server that lets Claude (or any MCP client) run statistics on SPSS data files and report the results as SPSS-style tables.
Two ways to compute. By default (the Python backend), results are calculated in Python with the formulas SPSS uses. They are not produced by SPSS. If IBM SPSS Statistics is installed, switch on the SPSS backend and every procedure runs in SPSS itself. You also get
.spvand
Opens
.sav,.zsav,.por,.csvand.tsvfiles, with variable labels, value labels and user-missing values.Every analysis can select cases first: structured filters (like
FILTER BY) and exclusion of straight-liners, with case counts before and after.Shows the SPSS syntax for every result.
Locked down by design. See Security.
What it can do
Area | Tools |
Explore |
|
Describe |
|
Compare means |
|
Relationships |
|
Nonparametric |
|
Assumptions |
|
Scales |
|
Prepare data |
|
Related MCP server: SPSS-MCP Extended
Install
You need Python 3.12 or newer.
git clone https://github.com/irfanabdulhameed/SPSS-MCP.git
cd SPSS-MCP
python3 -m venv .venv
.venv/bin/python -m pip install --upgrade pip
.venv/bin/pip install . # Windows: .venv\Scripts\pip install .Tested on macOS with Python 3.12 and 3.15. Windows and Linux should work but haven't been fully tested yet. requirements.lock records the exact versions from the macOS test environment, for reference.
Connect it
Put your data files in one folder, for example ~/Documents/SPSS-MCP. The server can only see that folder.
Claude Desktop: open Settings → Developer → Edit Config and add:
{
"mcpServers": {
"spss": {
"command": "/full/path/to/SPSS-MCP/.venv/bin/spss-mcp",
"env": { "SPSS_MCP_DATA_DIRS": "/Users/you/Documents/SPSS-MCP" }
}
}
}On Windows, use C:\\path\\to\\SPSS-MCP\\.venv\\Scripts\\spss-mcp.exe and a Windows folder path. Restart Claude Desktop afterwards.
Claude Code:
claude mcp add spss --env SPSS_MCP_DATA_DIRS="$HOME/Documents/SPSS-MCP" -- /full/path/to/SPSS-MCP/.venv/bin/spss-mcpThen ask, for example: "Using survey.sav, keep only cases with consent = Yes and drop straight-liners on q1–q12, then give me Cronbach's alpha for each construct."
Run in IBM SPSS (SPSS backend)
Status: experimental. The full pipeline is tested on our side with a stand-in for SPSS's spss module: syntax building, the SPSS process, output capture and saved files. It has not yet been confirmed against a real SPSS installation, so please report how it goes.
Turn it on with two extra settings. SPSS ships its own Python, which can import spss and run syntax in the SPSS engine without opening the SPSS window:
"env": {
"SPSS_MCP_DATA_DIRS": "C:\\Users\\you\\Documents\\SPSS-MCP",
"SPSS_MCP_BACKEND": "spss",
"SPSS_MCP_SPSS_PYTHON": "C:\\Program Files\\IBM\\SPSS Statistics\\Python3\\python.exe"
}On Windows, find Python3\python.exe inside your SPSS installation folder. The server sets SPSS_HOME and PATH for it automatically. On a Mac, SPSS's Python is usually at <SPSS folder>/Resources/Python3/bin/python3; the Mac setup is unverified. Then ask Claude to run check_spss, which starts SPSS and reports its version.
With the SPSS backend:
Every analysis tool runs in SPSS. The server builds the syntax from checked variable names, opens the file with
GET FILE, applies any case selection withFILTER BY, and runs the procedure.Results come back through OMS. Every table is captured as text and shown as a Markdown table.
SPSS output is saved.
.spvand.pdffiles go into the output folder. Change this withSPSS_MCP_SPSS_SAVE(spv,pdf,spv,pdfornone).The data file is only read. No syntax this server writes contains a
SAVEcommand.Only these file types. The SPSS backend opens
.sav,.zsavand.porfiles. Save CSV data as.savfirst.Each call starts SPSS. Expect some start-up time per analysis: a few seconds, up to a minute on slower machines.
Case counts come from the server. The before-and-after counts are worked out by the server; SPSS applies the same selection with the syntax shown.
Data open in SPSS: the server reads files, not SPSS's open session. Save the dataset (File → Save As… → .sav) into the data folder and point the server at that file.
Selecting cases
Every analysis tool takes two optional inputs.
case_filter is a structured filter, never an expression:
{"all": [
{"var": "consent", "op": "eq", "value": "Yes"},
{"var": "employed", "op": "eq", "value": "Yes"},
{"any": [{"var": "age", "op": "ge", "value": 18}, {"var": "role", "op": "in", "values": [1, 2]}]}
]}Groups:
allmeans AND andanymeans OR. Groups can be nested.Operators:
eq,ne,gt,ge,lt,le,inandnot_in(withvalues),missing,not_missing.Value labels: a text value such as
"Yes"is matched to its numeric code through the value labels.Missing values: as with SPSS
FILTER BY, a condition on a missing value excludes the case, except formissingandnot_missing.
exclude_straightliners is a list of items. Cases that gave the same answer to every one of them (standard deviation 0) are excluded.
The output shows the case counts after each step, for example 41 in file → 37 after filter → 36 after excluding straight-liners. It also shows the matching syntax:
COMPUTE mcp_sd = SD(q1, q2, q3, q4).
COMPUTE mcp_filter = (consent = 1 AND employed = 1) AND (MISSING(mcp_sd) OR mcp_sd > 0).
FILTER BY mcp_filter.Settings
Variable | Default | Meaning |
|
| Folders the server may read. Separate several with |
|
| Where new files are written. Must be inside a data folder. |
|
| Largest file the server will open. |
|
|
|
| Path to the Python bundled with SPSS. Required for the SPSS backend. | |
|
| SPSS output files to keep: |
|
| Seconds before an SPSS run is stopped. |
Security
No free-form code or syntax. There is no "run syntax" or "run Python" tool, and no expression language. Filters are structured data. Each tool is a fixed procedure with typed, range-checked inputs.
Syntax built from checked parts only. For the SPSS backend, variable names must be plain SPSS names that exist in the file. Numbers must be finite. Text values and paths are single-quoted with quotes doubled, and line breaks are refused. The syntax this server writes never contains
SAVE,HOST,INSERT,INCLUDEorBEGIN PROGRAM, and a test enforces that.One fixed process. The SPSS backend starts only the configured SPSS Python with the package's own worker script: a fixed argument list, no shell, and a timeout. Nothing else in the server can start a process.
Folder sandbox. The server reads only inside the configured folders. Paths are resolved with symlinks followed before they are checked, so
../, absolute paths and symlinks that point outside are all refused. It also refuses unknown file types, oversized files and files that would expand too far in memory.No overwrites. New files go only into the output folder, under plain file names. An existing file is never replaced.
Safe CSV export. Text cells that start with
=,+,-or@get a leading', so a spreadsheet won't run them as formulas.Untrusted text. Labels, column names and SPSS output text are cleaned and shortened before they reach the model. The model is also told to treat them as data, never instructions.
No network. The server uses stdio only. It opens no port and makes no outbound connections.
Limited data sharing. Analyses send summary tables to the model. Only
preview_rowssends raw cases, at most 50 rows.Checked automatically. The tests cover traversal, symlink escapes, overwrites, hostile names, labels and filter values, syntax injection and CSV injection. They fail if dangerous calls appear in the source. Bandit reports no issues, and
pip-auditfinds no known vulnerabilities in the pinned dependencies.
See SECURITY.md to report a problem.
Accuracy (Python backend)
tests/test_matches_spss.py checks results against IBM SPSS Statistics output for the same files:
paired t-test
Wilcoxon signed ranks
Mann-Whitney U
crosstabs with chi-square
Kruskal-Wallis
Cronbach's alpha
tests of normality
binary logistic regression
UNIANOVA (Type III)
principal components
Not yet checked against SPSS output: frequencies, descriptives, one-sample and independent t-tests, one-way ANOVA (Welch, Tukey), correlations, linear regression, Friedman, varimax rotation, and the newer reliability tables (scale statistics, inter-item correlations, squared multiple correlations). They use the standard SPSS formulas and pass internal consistency checks.
Details worth knowing:
User-defined missing values are treated as missing, as SPSS does.
Correlations use pairwise deletion. Regression, reliability and factor analysis use listwise deletion. These are the SPSS defaults.
Factor loadings can differ from SPSS in sign, because the sign of each component is arbitrary.
Exact p-values for small-sample nonparametric tests are not provided. The asymptotic p-values match SPSS.
When results must come from SPSS itself, use the SPSS backend.
Development
.venv/bin/pip install -e ".[test]"
.venv/bin/python -m pytestLicence
MIT. See LICENSE. The sample data in tests/fixtures comes from another MIT-licensed project; see tests/fixtures/NOTICE.md.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Ask questions of SPSS .sav survey data: crosstabs with significance, and AI coding of open ends.
Governed data discovery, exact queries, decisions, simulations, and runtime utilities over MCP.
Query, join, profile, clean and convert CSV/JSON/Parquet with server-side DuckDB over MCP.
MCP server for the Seline Analytics API
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP server for safe batch execution of IBM SPSS Statistics syntax (.sps) via stats.exe Production mode, with static security checks and sandboxed output.MIT
- AlicenseBqualityCmaintenanceEnables AI assistants to execute IBM SPSS Statistics workflows via natural language, covering data management, restructuring, analysis, charting, and report export.6936 PyPI2MIT
- AlicenseBqualityBmaintenanceEnables AI agents to safely execute statistical analyses, parse results into Markdown and JSON, and generate publication-ready charts through a local IBM SPSS Statistics installation on macOS and Windows.5126 PyPI1MIT
- AlicenseBqualityBmaintenanceEnables AI agent clients to drive IBM SPSS Statistics for analysis, paper-grade chart export, structured result parsing, Hayes PROCESS mediation/moderation, and safe audited syntax execution on Windows.52MIT