Skip to main content
Glama
SPSS-MCP

SPSS-MCP

by Exekiel179

SPSS-MCP

License: MIT Python 3.10+ Platform: Windows MCP

A Model Context Protocol (MCP) server that gives AI assistants direct access to IBM SPSS Statistics for statistical analysis.

Describe your analysis in plain language — SPSS-MCP translates it into SPSS syntax, runs it against the real SPSS engine, and returns Markdown-formatted results.

🚀 快速开始: 查看 QUICK_START.md 或直接运行 install.bat 一键安装


Presentation Page

配套网页主题:Claude Code 与 SPSS-MCP:从概念到一键配置

适合培训、汇报和课堂演示,内容覆盖:

  • 什么是 Claude Code,以及它和网页对话式协作的区别

  • 什么是 MCP 协议

  • Claude Code 的安装与配置

  • GLM key 获取

  • SPSS-MCP 的安装、配置与一键接入

  • 简单统计分析示例与现场演示路径

Related MCP server: SPSS-MCP Extended

Contact

  • 公众号:人类变量

  • 微信:Exekiel179


Requirements

  • Windows 10/11

  • Python 3.10+

  • IBM SPSS Statistics (version 20-31)

  • Claude Code with MCP support


Quick Install

git clone https://github.com/Exekiel179/SPSS-MCP.git
cd SPSS-MCP
install.bat

Then restart Claude Code. Done!

Manual Install

# 1. Install
pip install -e .

# 2. Auto-configure Claude Code
spss-mcp configure-claude

# 3. Restart Claude Code

Configuration

Basic Setup

Recommended: let SPSS-MCP auto-configure Claude Code for you:

spss-mcp configure-claude

This command:

  • detects your SPSS installation

  • merges mcpServers.spss into Claude Code's user config (~/.claude.json)

  • creates a timestamped backup before updating existing settings

If you prefer manual setup, add this to Claude Code settings (Ctrl+, → search mcpServers):

{
  "mcpServers": {
    "spss": {
      "command": "spss-mcp",
      "args": ["serve", "--transport", "stdio"]
    }
  }
}

SPSS Path (if not auto-detected)

Create .env file:

SPSS_INSTALL_PATH=C:\Program Files\IBM\SPSS Statistics\31

Slow SPSS startup?

If SPSS itself launches slowly on your machine, increase the engine startup timeout:

SPSS_STARTUP_TIMEOUT=300

This is separate from SPSS_TIMEOUT, which controls the timeout for each analysis job after the engine is already running.

Optional: Install Skills

Skills make analysis more reliable and auto-save results:

set SKILLS_DIR=%USERPROFILE%\.claude\skills
xcopy /E /I skills\spss-analyst "%SKILLS_DIR%\spss-analyst"
xcopy /E /I skills\spss-mcp-guard "%SKILLS_DIR%\spss-mcp-guard"

Restart Claude Code after installation.


Usage

Just describe your analysis in natural language:

请对 data.sav 进行描述性统计
分析 age 和 income 的相关性
用 t 检验比较男女收入差异

Claude will:

  1. Read your data file

  2. Generate SPSS syntax

  3. Execute the analysis

  4. Return formatted results

  5. Save .spv and .sps files


Output Files

Every analysis produces:

File

Description

.spv

SPSS Viewer file (open in SPSS for full charts)

.sps

SPSS syntax file (the exact commands that ran)

Default location: %TEMP%\spss-mcp\results\

With skills installed: spss_result/ in your working directory


Available Tools

File & Data (9 tools)

  • spss_check_status - Check server capabilities

  • spss_list_files - List .sav files

  • spss_list_variables - List variables with labels

  • spss_read_metadata - Read variable types and labels

  • spss_read_data - Preview data rows

  • spss_file_summary - Get file statistics

  • spss_import_csv - Convert CSV to .sav

Basic Statistics (9 tools)

  • spss_frequencies - Frequency tables

  • spss_descriptives - Mean, SD, min, max

  • spss_crosstabs - Contingency tables with chi-square

  • spss_t_test - Independent/paired/one-sample t-tests

  • spss_anova - One-way ANOVA with post-hoc

  • spss_correlations - Pearson/Spearman correlations

  • spss_regression - Linear regression

  • spss_normality_outliers - Normality tests

  • spss_nonparametric_tests - Mann-Whitney, Wilcoxon, Kruskal-Wallis

Advanced Analysis (18 tools)

  • Logistic regression (binary/multinomial/ordinal)

  • Generalized linear models (GLM, GENLIN, GENLINMIXED)

  • Mixed models (MIXED)

  • Survival analysis (Cox regression, Kaplan-Meier)

  • Multivariate analysis (Factor, MANOVA, Discriminant)

  • Clustering (Hierarchical, Two-step)

  • Reliability (Cronbach's α)

  • And more...

Total: 36 tools across 8 categories


Troubleshooting

SPSS not detected

Run spss-mcp status. If SPSS shows ✗:

  1. Create .env file with SPSS path

  2. Restart Claude Code

Analysis timeout

Increase timeout in .env:

SPSS_TIMEOUT=300

Skills not working

  1. Verify files exist:

    %USERPROFILE%\.claude\skills\spss-analyst\SKILL.md
    %USERPROFILE%\.claude\skills\spss-mcp-guard\SKILL.md
  2. Restart Claude Code

MCP server not connecting

  1. Check JSON syntax in settings

  2. Verify spss-mcp command works in terminal

  3. Re-run spss-mcp configure-claude

  4. Restart Claude Code


Platform Support

Platform

File Tools

Analysis Tools

Windows 10/11

✓

✓ (requires SPSS)

macOS

✓

✗

Linux

✓

✗

Analysis tools require SPSS XD API (Windows-only).


Development

# Compile check
python -m compileall src/spss_mcp

# Run tests
pytest

# Format code
black src/ tests/
isort src/ tests/

# CLI commands
spss-mcp status       # Check environment
spss-mcp setup-info   # Generate config
spss-mcp configure-claude  # Auto-update Claude Code settings

License

MIT — see LICENSE


Available Tools

37 tools
spss_anovaSpss AnovaB

Run SPSS one-way ANOVA (ONEWAY). Optionally includes post-hoc tests (e.g., TUKEY, BONFERRONI, LSD). Requires IBM SPSS Statistics to be installed.

Inputs: factor (required), dependent (required), file_path (required), post_hoc. Returns: result

spss_check_statusSpss Check StatusA

Check the SPSS MCP server status: which capabilities are available (SPSS installed vs file-only mode), SPSS path, library versions, and configuration. Call this first to understand what tools are available.

Inputs: no named parameters. Returns: result

spss_cluster_hierarchicalSpss Cluster HierarchicalC

Run hierarchical cluster analysis with dendrogram. Supports multiple linkage methods and distance measures. Requires IBM SPSS Statistics to be installed.

Inputs: file_path (required), variables (required), method, measure, +2 more. Returns: result

spss_compute_scale_scoreSpss Compute Scale ScoreC

Compute a scale score (SUM or MEAN) from multiple item variables, with optional reverse coding and minimum valid item count. Requires IBM SPSS Statistics to be installed.

Inputs: items (required), file_path (required), new_variable (required), method, +4 more. Returns: result

spss_correlationsSpss CorrelationsC

Run SPSS CORRELATIONS to compute Pearson or Spearman correlation matrix. Requires IBM SPSS Statistics to be installed.

Inputs: file_path (required), variables (required), method, two_tailed. Returns: result

spss_cox_regressionSpss Cox RegressionC

Run Cox proportional hazards regression for survival analysis. Supports time-dependent covariates, stratification, and model diagnostics. Requires IBM SPSS Statistics to be installed.

Inputs: file_path (required), predictors (required), time_variable (required), status_variable (required), +5 more. Returns: result

spss_crosstabsSpss CrosstabsA

Run SPSS CROSSTABS to create a contingency table between two categorical variables. Optionally includes chi-square test and row/column percentages. Requires IBM SPSS Statistics to be installed.

Inputs: file_path (required), row_variable (required), column_variable (required), include_col_pct, +2 more. Returns: result

spss_descriptivesSpss DescriptivesB

Run SPSS DESCRIPTIVES for numeric variables. Returns N, mean, std deviation, min, max, and optional statistics. Requires IBM SPSS Statistics to be installed.

Inputs: file_path (required), variables (required), statistics. Returns: result

spss_discriminantSpss DiscriminantC

Run discriminant analysis to classify cases into groups. Supports stepwise selection and cross-validation. Requires IBM SPSS Statistics to be installed.

Inputs: groups (required), file_path (required), predictors (required), method, +3 more. Returns: result

spss_factorSpss FactorC

Run SPSS FACTOR analysis (principal components or principal axis factoring). Includes eigenvalues, variance explained, and rotated factor matrix. Requires IBM SPSS Statistics to be installed.

Inputs: file_path (required), variables (required), method, rotation, +1 more. Returns: result

spss_file_summarySpss File SummaryA

Get a summary of an SPSS .sav file: case count, variable count, variable list, and basic descriptive statistics computed locally (no SPSS needed). Does not require SPSS to be installed.

Inputs: file_path (required). Returns: result

spss_frequenciesSpss FrequenciesB

Run SPSS FREQUENCIES on one or more variables. Returns frequency tables with counts, percentages, and optional statistics. Requires IBM SPSS Statistics to be installed.

Inputs: file_path (required), variables (required), statistics. Returns: result

spss_genlinSpss GenlinC

Run generalized linear model (GENLIN) with flexible distribution and link functions. Supports Poisson, binomial, gamma, negative binomial, and other distributions. Requires IBM SPSS Statistics to be installed.

Inputs: dependent (required), file_path (required), predictors (required), link, +4 more. Returns: result

spss_genlinmixedSpss GenlinmixedC

Run generalized linear mixed model combining GLM with random effects. Supports non-normal outcomes with hierarchical structure. Requires IBM SPSS Statistics to be installed.

Inputs: dependent (required), file_path (required), fixed_effects (required), link, +3 more. Returns: result

spss_get_method_schemaSpss Get Method SchemaA

Get the JSON schema for a registry-backed SPSS method. Useful for structured orchestration and parameter inspection before execution.

Inputs: tool_name (required). Returns: result

spss_get_method_supportSpss Get Method SupportB

Get support metadata for a registry-backed SPSS method, including command family, support tier, coverage assertions, and documentation tags.

Inputs: tool_name (required). Returns: result

spss_glm_univariateSpss Glm UnivariateB

Run univariate general linear model (GLM) with factorial designs. Supports estimated marginal means, contrasts, and post-hoc tests. Requires IBM SPSS Statistics to be installed.

Inputs: factors (required), dependent (required), file_path (required), emmeans, +4 more. Returns: result

spss_import_csvSpss Import CsvA

Convert a CSV file to SPSS .sav format directly using pandas + pyreadstat — no IBM SPSS Statistics installation required. Much faster than going through SPSS syntax because it bypasses the SPSS engine entirely. Saves the .sav file next to the CSV by default, or to a custom output_path.

Inputs: csv_path (required), encoding, delimiter, output_path, +1 more. Returns: result

spss_kaplan_meierSpss Kaplan MeierC

Run Kaplan-Meier survival analysis with log-rank test. Produces survival curves and compares groups. Requires IBM SPSS Statistics to be installed.

Inputs: file_path (required), time_variable (required), status_variable (required), status_event_value (required), +3 more. Returns: result

spss_list_filesSpss List FilesB

List SPSS .sav files in a directory. Useful for discovering available datasets when the user hasn't specified a file path.

Inputs: directory (required), recursive. Returns: result

spss_list_supported_methodsSpss List Supported MethodsA

List registry-backed SPSS methods available for structured execution. Use this to discover cold methods that have schemas, templates, and coverage assertions.

Inputs: no named parameters. Returns: result

spss_list_variablesSpss List VariablesB

List all variable names and their labels from an SPSS .sav file. Optionally filter by a search term. Does not require SPSS to be installed.

Inputs: file_path (required), search. Returns: result

spss_logistic_regressionSpss Logistic RegressionB

Run binary or multinomial logistic regression. Supports stepwise selection, categorical predictors, and model diagnostics. Requires IBM SPSS Statistics to be installed.

Inputs: dependent (required), file_path (required), predictors (required), method, +4 more. Returns: result

spss_manovaSpss ManovaB

Run multivariate analysis of variance (MANOVA) for multiple dependent variables. Tests multivariate effects and provides univariate follow-ups. Requires IBM SPSS Statistics to be installed.

Inputs: factors (required), file_path (required), dependents (required), method, +3 more. Returns: result

spss_mixedSpss MixedC

Run linear mixed-effects model (multilevel model) with random effects. Supports nested and crossed random effects, repeated measures structures. Requires IBM SPSS Statistics to be installed.

Inputs: dependent (required), file_path (required), fixed_effects (required), method, +5 more. Returns: result

spss_nonparametric_testsSpss Nonparametric TestsC

Run common nonparametric tests in SPSS: Mann-Whitney U, Wilcoxon signed-rank, or Kruskal-Wallis. Requires IBM SPSS Statistics to be installed.

Inputs: file_path (required), test_type (required), variables (required), group_values, +1 more. Returns: result

spss_normality_outliersSpss Normality OutliersA

Run SPSS EXAMINE to check normality and outliers for numeric variables, with optional diagnostic plots. Requires IBM SPSS Statistics to be installed.

Inputs: file_path (required), variables (required), plots. Returns: result

spss_ordinal_regressionSpss Ordinal RegressionB

Run ordinal regression (PLUM) for ordered categorical outcomes. Supports multiple link functions and parallel lines test. Requires IBM SPSS Statistics to be installed.

Inputs: dependent (required), file_path (required), predictors (required), link, +3 more. Returns: result

spss_read_dataSpss Read DataB

Read rows of data from an SPSS .sav file as a Markdown table. Optionally filter to specific variables and limit row count. Does not require SPSS to be installed.

Inputs: file_path (required), max_rows, variables, apply_value_labels. Returns: result

spss_read_metadataSpss Read MetadataB

Read variable names, types, labels, and value labels from an SPSS .sav file. Returns a detailed Markdown report of the file's structure. Does not require SPSS to be installed.

Inputs: file_path (required). Returns: result

spss_regressionSpss RegressionB

Run SPSS linear regression. Specify a dependent variable and one or more predictors. Returns coefficients, R-squared, ANOVA table, and significance tests. Requires IBM SPSS Statistics to be installed.

Inputs: dependent (required), file_path (required), predictors (required), method, +1 more. Returns: result

spss_reliability_alphaSpss Reliability AlphaC

Run SPSS RELIABILITY analysis (Cronbach's alpha). Returns scale reliability and item statistics for psychometric workflows. Requires IBM SPSS Statistics to be installed.

Inputs: file_path (required), variables (required), model, scale_name. Returns: result

spss_repeated_measures_anovaSpss Repeated Measures AnovaB

Run SPSS repeated-measures ANOVA (within-subject GLM). Provide within-factor name, number of levels, and one variable per level. Requires IBM SPSS Statistics to be installed.

Inputs: levels (required), file_path (required), variables (required), within_factor_name (required), +1 more. Returns: result

spss_run_syntaxSpss Run SyntaxA

Execute arbitrary SPSS syntax commands and return the output as Markdown. Optionally specify a data_file to automatically prepend GET FILE. By default, this also persists .spv (SPSS viewer) and .sps (executed syntax) files. Requires IBM SPSS Statistics to be installed.

Inputs: syntax (required), data_file, select_if, filter_variable, +2 more. Returns: result

spss_t_testSpss T TestC

Run SPSS t-test. Supports one_sample, independent, and paired test types. Requires IBM SPSS Statistics to be installed.

Inputs: file_path (required), test_type (required), variables (required), test_value, +1 more. Returns: result

spss_twostep_clusterSpss Twostep ClusterB

Run two-step cluster analysis with automatic cluster number determination. Handles large datasets and mixed variable types. Requires IBM SPSS Statistics to be installed.

Inputs: file_path (required), distance, continuous, categorical, +3 more. Returns: result

spss_validate_syntaxSpss Validate SyntaxA

Validate SPSS syntax without executing it. Checks for basic syntax errors. Requires IBM SPSS Statistics to be installed.

Inputs: syntax (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 37 tools

    Disambiguation4/5

    Each statistical procedure (ANOVA, regression, factor, clustering, survival) targets a clearly distinct analysis, and the registry/status tools are separate concerns. Minor overlaps: spss_list_variables and spss_read_metadata both return variable names/labels, and spss_run_syntax is a generic escape hatch that can subsume nearly every analytical tool.

    Naming Consistency4/5

    All tools share a consistent spss_ prefix and snake_case, mostly following an action_or_method pattern (spss_list_files, spss_run_syntax, spss_validate_syntax). The deviations are statistical procedures named after SPSS commands (spss_anova, spss_frequencies), which is still predictable within the domain.

    Tool Count3/5

    37 tools is heavy, but the breadth of SPSS procedures justifies many distinct entries. Still, there is redundancy (spss_genlin vs spss_glm_univariate vs spss_anova, spss_genlinmixed vs spss_mixed) and spss_run_syntax could cover several, pushing it above a comfortable scoped set.

    Completeness4/5

    The surface covers data import/metadata, descriptives, t-tests, ANOVA family, a wide range of regressions, mixed models, factor/reliability, nonparametric, clustering, discriminant, MANOVA, and survival analysis. Gaps exist around data manipulation (variable transforms, merge/split, case filtering), exporting .sav or results, and chart output beyond diagnostics.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Enables AI agents to drive IBM SPSS Statistics for statistical analysis and publication-quality chart generation through natural language, returning structured results and ensuring safe execution.
      2
      51
      9
      MIT
    • A
      license
      B
      quality
      C
      maintenance
      Enables AI agents to run IBM SPSS Statistics on macOS for statistical analyses, generate paper-ready charts, extract structured results, and execute mediation/moderation analyses with safety controls.
      51
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Enables 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.
      51
      26 PyPI
      1
      MIT