Skip to main content
Glama
flupke91

spss-studio-mcp

by flupke91

SPSS Studio MCP

让 SPSS 成为 Agent 的「统计引擎 + 制图工厂」:论文级图片、深度结果解析、方法真机验证、安全执行。

License: MIT Python Tests

spss-studio-mcp 是一个面向 IBM SPSS Statistics 的 MCP(Model Context Protocol)服务器,为 Codex / Claude Code / Cursor 等 Agent 客户端提供:

  • 论文级出图:11 类 spss_chart_* 工具,一键导出 PNG / TIFF / EMF(1950×1500 @300 dpi),路径回传可直接投稿;

  • 深度结果解析:OMS 文本 → Markdown 表格 + 结构化 JSON + 16 类分析统计摘要(t / F / r / B / Wald / α / χ² / p / 效应量);

  • 方法真机验证:37 个分析方法 + 11 个补充工具全部在真实 SPSS 32 验收通过;

  • 中介 / 调节spss_mediation(Baron & Kenny 三步回归 + Sobel)、spss_moderation(中心化交互回归);

  • 安全执行层:危险命令拦截、数据路径白名单、dry_run 预检、JSONL 审计日志。

全部能力已在 IBM SPSS Statistics 32.0.0(Windows) 真机验证(109 个单元测试全部通过)。


快速开始

cd spss-studio-mcp
pip install -e ".[dev]"
spss-studio-mcp status                     # 应显示 SPSS batch: OK

spss-studio-mcp configure-codex            # 写入 Codex 客户端配置(~/.codex/config.toml)
spss-studio-mcp configure-claude           # 写入 Claude Code 配置(~/.claude.json)

然后在客户端里直接用自然语言驱动,例如:

对 examples/data/survey_study.sav 做描述统计和可靠性分析
用 examples/data/experiment_study.sav 做独立样本 t 检验(group 分组,posttest)
用 examples/data/mediation_study.sav 做中介分析:autonomy → satisfaction → performance
画 examples/data/survey_study.sav 学习投入总分的直方图(带正态密度),PNG 300dpi

Related MCP server: Stata MCP Server

论文级图表(核心卖点)

工具

用途

spss_chart_histogram / spss_chart_histogram_density

分布直方图 / 直方图 + 正态密度

spss_chart_scatter

两变量散点图

spss_chart_bar / spss_chart_bar_error

分类均值条形 / 条形 + 95% CI 误差须

spss_chart_line / spss_chart_area

时间序列折线 / 面积图

spss_chart_boxplot

分组箱线图

spss_chart_errorbar

均值 ± CI 误差条

spss_chart_qqplot

正态 Q-Q 图

spss_chart_km_curve

Kaplan-Meier 生存曲线

spss_chart_histogram_density(
    variable="engagement_total",
    title="学习投入总分分布(带正态密度)",
    image_format="PNG",            # PNG / TIFF / EMF
    width_px=1950, height_px=1500, dpi=300,
    data_file="examples/data/survey_study.sav",
)
# → 返回图片文件路径,可直接投稿

样例输出(SPSS 32 真机导出,1950×1500 @300 dpi):

学习投入总分直方图(带正态密度) 不同专业学习投入总分(均值 + 95% CI) 实验后测成绩箱线图 按治疗分组的 KM 生存曲线 满意度与绩效散点图

结构化结果与统计摘要

spss_structured_result(
    syntax="T-TEST GROUPS=group(1 2) /VARIABLES=posttest.",
    data_file="examples/data/experiment_study.sav",
)
# → {markdown, json: {tables, summary}, files, warnings}

run_syntax 返回的 Markdown 末尾自动附加 ### 统计摘要(自然语言结论 + 关键统计量), 16 类分析的摘要抽取细节见 docs/result_parsing.md

样例数据

examples/data/ 提供 5 组贴近论文场景的样例数据(固定随机种子,可复现):

文件

场景

关键变量

survey_study.sav

问卷:200 人学习投入

gender / major / q1q12 / engagement_total

experiment_study.sav

实验:120 人记忆训练前后测

group / pretest / posttest / gain

survival_study.sav

生存:150 例随访

treatment / time / status

mediation_study.sav

中介:300 员工

autonomy / satisfaction / performance

longitudinal_study.sav / long_study.sav

纵向:60 人 3 次测量

id / group / time / score

安全执行

  • 危险命令(HOST / ERASE / DELETE FILE 等)行首匹配拦截;

  • 数据文件路径白名单(SPSS_ALLOWED_DIRS,默认 examples/ + 系统临时目录);

  • spss_run_syntax(..., dry_run=True) 先校验不执行;

  • 审计日志默认写入 logs/audit.jsonl(可用 SPSS_AUDIT_LOG 改路径)。

详见 docs/security.md

文档

生态收录与发布

许可证

MIT(上游:Exekiel179/SPSS-MCP,MIT)。

A
license - permissive license
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
1Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    Enables AI assistants to perform statistical analysis on MySQL databases, generating formatted Excel reports with t-tests and effect sizes, and creating thesis-quality Word documents with AI-powered insights.
    Last updated
    MIT
  • A
    license
    -
    quality
    C
    maintenance
    Enables AI agents to perform statistical process control calculations using validated, deterministic tools such as control charts, capability analysis, and tolerance intervals.
    Last updated
    3
    MIT

View all related MCP servers

Related MCP Connectors

  • The statistical analyst in your AI chat — validated, citable, re-runnable analysis of your data.

  • Renders interactive Chart.js charts and dashboards inline in AI conversations.

  • Give your agent web search and authoritative datasets: S&P Global, FRED, OECD, SimilarWeb & more.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/flupke91/spss-studio-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server