# StatsPAI

> StatsPAI is an open-source MCP server for analytics and data. Econometrics and causal inference toolkit for agents, with Stata and R parity grades. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Linux, macOS, Windows
- **Website:** https://brycewang-stanford.github.io/StatsPAI/
- **Repository:** https://github.com/brycewang-stanford/statspai
- **MCP Registry name:** io.github.brycewang-stanford/statspai
- **Categories:** analytics and data
- **Listing updated:** 2026-11-14

## About

The distinctive thing about StatsPAI is its evidence grading: each function says whether its numbers were checked against Stata or R on identical data, against a known truth, or not yet. The site's own count is 1,687 registered functions, of which 576 were compared with R or Stata and 452 against known truths, while many have no numerical check yet.

It is a Python package first: regression with robust and clustered errors, high-dimensional fixed effects, IV, staggered difference-in-differences, regression discontinuity, synthetic control, matching and double machine learning, with tables exported to Word, Excel and LaTeX. The bundled MCP server exposes the estimators to clients like Claude Code and Cursor.

Environment variables limit which directories the server reads data from and choose a core, curated or full tool list. It suits researchers who want an agent to run analyses reproducibly.

## Features

- **Evidence grades:** Each function reports how its output was validated.
- **Causal methods:** DiD, IV, RD, synthetic control, matching and DML.
- **Schema-registered functions:** Every function has a machine-readable schema.
- **Table export:** Results export to Word, Excel and LaTeX.
- **Tool profiles:** Core, curated or full tool lists via an environment variable.

## Good for

- Run staggered difference-in-differences with an agent
- Move a Stata workflow to Python
- Check how well a method has been validated
- Export regression tables for a paper

## Install

### Claude Code (Terminal)

```sh
claude mcp add statspai -- uvx statspai
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "statspai": {
      "command": "uvx",
      "args": [
        "statspai"
      ]
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "statspai": {
      "command": "uvx",
      "args": [
        "statspai"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "statspai": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "statspai"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "statspai": {
      "command": "uvx",
      "args": [
        "statspai"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "statspai": {
      "command": "uvx",
      "args": [
        "statspai"
      ]
    }
  }
}
```

## FAQ

### How do I limit file access?

Set STATSPAI_MCP_DATA_ROOTS to the allowed directories.

### How many tools are advertised?

Set STATSPAI_MCP_PROFILE to core, curated (default) or full.

### How is correctness shown?

Functions carry an evidence grade against Stata, R or known truths.

### Is StatsPAI free?

Yes. StatsPAI is open source, so you can use and self-host it for free.

### How do I add StatsPAI to Claude Code?

Run this command in your terminal: claude mcp add statspai -- uvx statspai

### What are the best alternatives to StatsPAI?

The closest alternatives to StatsPAI are Agent-Native Analytics, Google Ads + Meta Ads + SEO/GEO MCP, Tapetide - Indian Stock Market MCP, World Monitor and CompanyData.

## Alternatives

- [Agent-Native Analytics](https://ai-powered.com/mcp/agent-native-analytics): Agent-Native Analytics is an open-source MCP server for analytics and data.
- [Google Ads + Meta Ads + SEO/GEO MCP](https://ai-powered.com/mcp/google-ads-meta-ads-seo-geo-mcp): Google Ads + Meta Ads + SEO/GEO MCP is a freemium MCP server for marketing and seo.
- [Tapetide - Indian Stock Market MCP](https://ai-powered.com/mcp/tapetide-indian-stock-market-mcp): Tapetide - Indian Stock Market MCP is a freemium MCP server for finance and payments.
- [World Monitor](https://ai-powered.com/mcp/world-monitor): World Monitor is a freemium MCP server for analytics and data.
- [CompanyData](https://ai-powered.com/mcp/companydata): CompanyData is a paid MCP server for analytics and data.
- [ChartAnt](https://ai-powered.com/mcp/chartant): ChartAnt is a freemium MCP server for design and media.
- [Quantivex Research](https://ai-powered.com/mcp/quantivex-research): Quantivex Research is a free MCP server for finance and payments.
- [Provyan](https://ai-powered.com/mcp/provyan): Provyan is a free MCP server for finance and payments.

---
Source: https://ai-powered.com/mcp/statspai
