StatsPAI 是 AI Skill Hub 本期精选MCP工具之一。综合评分 8.0 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。
StatsPAI 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
StatsPAI 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/brycewang-stanford/StatsPAI
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"statspai": {
"command": "npx",
"args": ["-y", "statspai"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 StatsPAI 执行以下任务... Claude: [自动调用 StatsPAI MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"statspai": {
"command": "npx",
"args": ["-y", "statspai"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
<p align="center"> <img src="https://raw.githubusercontent.com/brycewang-stanford/StatsPAI/main/docs/logo/readme-1.png" alt="StatsPAI - Python-native Stata and R replacement for applied causal inference" width="780"> </p>
pip install statspai
Then:
import statspai as sp
print(sp.datasets.list_datasets()[["name", "design", "n_obs"]].head())
StatsPAI ships teaching datasets such as Card (1995), Callaway-Sant'Anna mpdta, Lee (2008) RD, LaLonde/NSW, and California Proposition 99. The examples below run offline after installation.
At a glance: 1,182 registered functions across 87 submodules; 352k LOC (core) + 200k LOC (tests). Run python scripts/registry_stats.py to reproduce these numbers.
---
The outputs below are rounded from the bundled examples in this repository using StatsPAI 1.20.0.
import statspai as sp
card = sp.datasets.card_1995()
r1 = sp.regress(
"lwage ~ educ + exper + expersq + black + south + smsa",
data=card,
robust="hc1",
)
r2 = sp.ivreg("lwage ~ (educ ~ nearc4) + exper + expersq + black + south + smsa", data=card)
print(r1.summary()) # human-readable table
print(r1.tidy().head()) # broom-style dataframe
sp.modelsummary(r1, r2, output="table.docx") # Word table
sp.outreg2(r1, r2, filename="results.xlsx") # Stata-style export
Useful docs:
---
StatsPAI is meant to be the broad Stata/R-style workbench for applied empirical research, not only a single modeling family.
| Package | Best fit | Where StatsPAI is different |
|---|---|---|
[causallib](https://github.com/BiomedSciAI/causallib) | Observational causal inference with a scikit-learn-style workflow: IPW, matching, standardization, doubly robust estimation, and evaluation. | StatsPAI is broader for Stata/R migration: OLS, IV, high-dimensional FE, DiD, RD, synthetic control, matching, diagnostics, validation metadata, and publication-table export in one API. |
[CausalPy](https://github.com/pymc-labs/CausalPy) | Bayesian causal analysis for quasi-experimental settings, built around PyMC models, uncertainty, and visual diagnostics. | StatsPAI prioritizes familiar Stata/R econometrics commands, frequentist workflows, cross-language parity evidence, bundled teaching datasets, and agent-ready result summaries. |
Use causallib when you mainly want sklearn-style treatment-effect pipelines. Use CausalPy when you want Bayesian causal modeling in PyMC. Use StatsPAI when you want one Python package to replace the everyday Stata/R empirical workflow.
---
高质量的开源MCP工具,适用于因果推断和数据科学应用
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
经综合评估,StatsPAI 在MCP工具赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | StatsPAI |
| 原始描述 | 开源MCP工具:StatsPAI is the first agent-native Python platform for causal inference and appl。⭐216 · Python |
| Topics | mcpagent-nativeai-agentscausal-discoverycausal-inferencedata-sciencepython |
| GitHub | https://github.com/brycewang-stanford/StatsPAI |
| License | MIT |
| 语言 | Python |
收录时间:2026-06-04 · 更新时间:2026-06-05 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端