Pingouin-MCP
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Pingouin-MCP run an ANOVA on my three groups and check assumptions"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Pingouin-MCP
A Model Context Protocol server that exposes statistical analysis through Pingouin to AI research agents (Claude Code, OpenCode, and any MCP-capable assistant).
It is a companion to MNE-MCP: MNE-MCP covers neurophysiological signal processing; Pingouin-MCP covers the statistical inference that follows it. Together they cover the path from raw data to a reported result.
Why this exists
An LLM will run whatever test you ask for. It will also, far more often than a trained analyst, run the wrong one: a t-test on three groups, ANOVA on repeated measures without checking sphericity, a parametric test on badly non-normal data, or an independent-samples test on paired observations.
Three design decisions follow:
The correct choice is made computable.
stat_decision_assistantmaps a study design to a test, states why, lists what to check first and gives the alternatives. When the design is ambiguous it asks a question instead of guessing.Assumptions are never silently skipped.
stat_assumption_reportruns the checklist for a design in one call and reports which assumptions failed. An assumption reported only when it fails is not a check.Every result carries its assumptions, effect size and reproducible code. Tool output includes the equivalent Pingouin snippet, so any analysis can be reproduced outside the server.
Related MCP server: rigor-mcp
Requirements
Component | Requirement | Notes |
Python | 3.12 or newer | Verified with 3.13 |
Pingouin | 0.6.1 | Pinned to |
pandas / NumPy / SciPy | pandas >= 2.0, NumPy >= 1.23, SciPy >= 1.9 | Installed as dependencies |
OS | Windows, macOS, Linux | stdio transport; no platform-specific code |
Install
git clone https://github.com/weichuguang/pingouin-mcp.git
cd pingouin-mcp
python -m venv .venv
# Windows
.venv\Scripts\python -m pip install -e .
# macOS / Linux
.venv/bin/python -m pip install -e .Verify:
pingouin-mcp status # JSON capability report; exits non-zero if Pingouin is missing
pingouin-mcp tools # list the 43 registered toolsRegister with an MCP client
Use the absolute path to the virtual environment's Python.
{
"mcpServers": {
"pingouin": {
"command": "/absolute/path/to/pingouin-mcp/.venv/bin/python",
"args": ["-m", "pingouin_mcp.cli", "serve"]
}
}
}On Windows use ...\\.venv\\Scripts\\python.exe.
VS Code (.vscode/mcp.json):
{
"servers": {
"pingouin": {
"type": "stdio",
"command": "/absolute/path/to/pingouin-mcp/.venv/bin/python",
"args": ["-m", "pingouin_mcp.cli", "serve"]
}
}
}Configuration
Optional file at ~/.pingouin-mcp/config.json, or environment variables:
Variable | Purpose | Default |
| Seconds before a tool call is abandoned | 300 |
| Where figures are written |
|
| Directory searched by data tools | current directory |
| Path to a config file |
|
pingouin-mcp show-config prints the resolved values.
Tools (43)
Organised by research task rather than by Pingouin function name. The full list with
when-to-use guidance is in TOOLS_REFERENCE.md.
Group | Tools |
Data management |
|
Decision support |
|
Assumptions |
|
Two groups |
|
Three or more groups |
|
Post-hoc |
|
Association |
|
Regression and mediation |
|
Effect size, power, reliability |
|
Categorical |
|
Visualisation |
|
Session |
|
A worked exchange
User: I have two groups, 20 people each, and I want to compare their
anxiety scores.
Agent: [calls stat_decision_assistant(dv_type="continuous", n_groups=2,
repeated=False)]
-> recommends an independent-samples t-test and says to check
normality and homogeneity of variance first.
Agent: [calls stat_assumption_report(df, dv="anxiety", between="group")]
-> normality met, but Levene's test is significant (p = .01)
Agent: [calls stat_ttest(df, dv="anxiety", group="group", correction=True)]
-> Welch's t-test, reports t, df, p, Cohen's d and the 95% CI, and
notes that Welch's was used because variances differed.The third call differs from the naive one because the second call was made. That is the whole design.
Reproducibility contract
Every tool returns the equivalent Pingouin code alongside the result. An analysis performed through this server can therefore be reproduced, audited or moved into a script without the server. An agent-driven analysis should not be a black box.
Verification
python -m pytest tests -q # 29 tests: correctness, tool binding, end-to-end calls
python experiments/exp1_decision_correctness.pyCurrent results on the reference environment (Python 3.13, Pingouin 0.6.1, pandas 3.x):
pytest: 29 passedDecision-assistant evaluation: 21/21 valid recommendations, 21/21 runnable in Pingouin, 3/3 abstentions on under-specified designs, deterministic across repeated runs. See
experiments/andexperiments/results_exp1.json.
CI runs the test suite on Ubuntu and Windows with Python 3.12 and 3.13.
Scope and limitations
Pingouin only. Tools wrap functions that exist in Pingouin. Capabilities absent from Pingouin (for example MANOVA as a standalone procedure, moderation analysis) are not approximated.
No arbitrary code path is required, but one exists.
stat_run_codeexecutes Python in the server's session for workflows not covered by a dedicated tool. It is intentionally visible and should be treated as a privileged escape hatch; the other 42 tools are parameter-validated.stat_run_coderuns in-process. It is not a sandbox. Do not expose the server to untrusted clients.File paths are not sandboxed.
stat_load_datareads the path it is given; use the server under an account whose file access matches the data you intend to analyse.Assumption checks are reported, not enforced. The server tells you what failed; it does not silently switch methods unless the tool's parameters ask it to.
Verified versions. Pingouin 0.6.1, pandas 3.x and Python 3.13; other versions may work but are not part of CI.
Repository layout
Path | Contents |
| CI workflow and issue / pull-request templates |
| Server, 43 tools, decision rules, session kernel, figures and summaries |
| Correctness, MCP binding and end-to-end tests |
| Two Claude skills: statistical analyst and MCP guard |
|
|
| Self-contained evaluation of the decision assistant |
Contributing
Issues and pull requests are welcome. Read CONTRIBUTING.md and run the
tests before submitting. Security reports should follow SECURITY.md.
License
MIT. See LICENSE.
Available Tools
43 toolsstat_ancovaStat AncovaA
ANCOVA — compare groups while statistically controlling a continuous covariate.
WHEN TO USE: a continuous variable is expected to influence the outcome and differs between groups (e.g. age, baseline score).
WHEN NOT TO USE — two conditions that are frequently violated:
The covariate was affected by the manipulation. Controlling a variable the treatment changed removes part of the effect you are measuring.
The covariate was measured after the outcome, or with substantial error.
The tool tests homogeneity of regression slopes automatically and tells you if ANCOVA is inappropriate.
Inputs: dv (required), name (required), covar (required), between (required), +1 more. Returns: result
stat_anovaStat AnovaA
One-way ANOVA — three or more independent groups, continuous outcome.
WHEN TO USE
3+ independent groups; normality and homogeneity plausible.
Instead of running multiple t-tests, which inflates the Type I error rate.
WHEN NOT TO USE
Variances unequal →
stat_welch_anova.Same participants in every condition →
stat_rm_anova.Both a between and a within factor →
stat_mixed_anova.Badly non-normal →
stat_nonparametric_k.
A significant omnibus F says only that some groups differ, not which. Always
follow with stat_pairwise_tests and a multiple-comparison correction.
Inputs: dv (required), name (required), between (required), effsize, +1 more. Returns: result
stat_assumption_reportStat Assumption ReportA
Run every assumption check implied by a design in one pass.
Use this instead of checking assumptions one at a time, so that none is silently skipped. Report the output whether or not the assumptions pass — a check reported only when it fails is not a check.
When to use: after loading and before the main test, for any parametric test. When NOT to use: for purely non-parametric analyses (normality is irrelevant there), or for descriptive work.
Inputs: dv (required), name (required), covar, within, +2 more. Returns: result
stat_bayes_ttestStat Bayes TtestA
Bayesian t-test — quantifies evidence for the null as well as the alternative.
WHEN TO USE
When a non-significant result needs interpreting. A frequentist p > .05 does not mean the null is true; BF₀₁ directly quantifies evidence for it.
When the researcher wants to state "the groups are comparable".
WHEN NOT TO USE
As a way to find significance after a non-significant t-test. Decide on the analysis approach in advance.
Report BF₁₀ and BF₀₁, and state the prior scale (r).
Inputs: dv (required), name (required), group (required), r, +3 more. Returns: result
stat_chi2_independenceStat Chi2 IndependenceA
Chi-square test of independence between two categorical variables.
WHEN TO USE: two categorical variables from independent observations.
WHEN NOT TO USE
The same participants measured twice on a categorical variable →
stat_chi2_mcnemar.Any expected cell count < 5 → Fisher's exact test (the tool flags this).
Report Cramér's V as the effect size.
Inputs: x (required), y (required), name (required), correction. Returns: result
stat_chi2_mcnemarStat Chi2 McnemarA
McNemar's test — paired categorical data (before/after, matched pairs, twins).
WHEN TO USE: the same units contribute a categorical value under two conditions (pre/post intervention, two raters, matched pairs).
WHEN NOT TO USE: for independent groups — use stat_chi2_independence.
Only the two discordant cells contribute to the statistic.
Inputs: x (required), y (required), name (required), correction. Returns: result
stat_correlationStat CorrelationA
Correlation between two continuous variables.
WHEN TO USE
pearson: both continuous, relationship linear, no severe outliers.
spearman: ordinal data, monotonic but non-linear relationships, or outliers.
kendall: small n with many ties.
percbend / shepherds / bicor: robust alternatives when outliers are a concern.
WHEN NOT TO USE
Repeated measurements on the same participants →
stat_rm_correlation; a plain correlation is inflated by between-subject variance.To establish agreement between two measurement methods →
stat_plot_blandaltman; correlation measures association, not agreement.To claim "no relationship" from a non-significant r → check
stat_distance_correlation, which detects non-linear dependence.
Always report r (or rho) with its CI, not just the p-value.
Inputs: x (required), y (required), name (required), method, +1 more. Returns: result
stat_correlation_matrixStat Correlation MatrixA
Correlation matrix across several variables, optionally with p-value correction.
WHEN TO USE: exploratory screening across a set of variables, or a correlation table for a paper.
WHEN NOT TO USE: as a basis for causal claims, or when the number of variables is large relative to n — correlations become unstable.
With more than two variables, always pass padjust (e.g. "fdr_bh"). A matrix
of 10 variables implies 45 comparisons; several will be significant by chance
alone.
Inputs: name (required), columns (required), method, padjust, +1 more. Returns: result
stat_cronbach_alphaStat Cronbach AlphaA
Cronbach's alpha — internal consistency of a multi-item scale.
WHEN TO USE: reporting the reliability of a questionnaire or scale in the current sample.
WHEN NOT TO USE
As the sole evidence of unidimensionality — alpha can be high for a multidimensional scale. Confirm with factor analysis.
For binary items (use KR-20) or for inter-rater agreement (use ICC).
Alpha rises with the number of items regardless of their quality: report the item count and the CI, and consider the mean inter-item correlation.
Inputs: name (required), items (required), ci. Returns: result
stat_data_quality_checkStat Data Quality CheckB
Screen a dataset for missingness, outliers and distribution shape.
Run this on every new dataset before planning any analysis: it determines whether the planned analysis is even possible (e.g. a between-subjects test needs enough complete cases per group).
When to use: first thing after loading real data. Returns: missing counts per column, outliers flagged by the robust MAD rule, skewness and kurtosis.
Inputs: name (required), columns. Returns: result
stat_decision_assistantStat Decision AssistantA
Recommend which statistical test fits a study design — call this BEFORE running a test.
This exists because choosing the wrong test is the most consequential error in statistical analysis, and it invalidates the p-value rather than merely producing a suboptimal number. If you are not certain which test applies, call this first.
Inputs: n_dv, dv_type, n_groups, repeated, +6 more. Returns: result
stat_describe_dataStat Describe DataA
Descriptive statistics, optionally broken down by group.
Use this to report the sample before any inference: means, SDs, medians and group sizes are expected in every results section.
When to use: immediately after loading, and again when writing up.
When NOT to use: as a substitute for checking assumptions — use
stat_data_quality_check and stat_assumption_report for that.
Inputs: name (required), dv, group. Returns: result
stat_distance_correlationStat Distance CorrelationA
Distance correlation — detects any dependence, linear or not.
WHEN TO USE
Before concluding "no relationship" from a non-significant Pearson r. Distance correlation is zero if and only if the variables are independent.
When a non-linear or non-monotonic relationship is plausible.
WHEN NOT TO USE: as a replacement for interpretable effect sizes — the coefficient has no simple direction or magnitude reading.
Bootstrap-based, so it is slower; reduce n_boot for exploratory passes.
Inputs: x (required), y (required), name (required), seed, +1 more. Returns: result
stat_effect_sizeStat Effect SizeA
Effect size with a confidence interval for a two-group comparison.
WHEN TO USE: alongside every t-test and every pairwise comparison. A p-value says whether an effect is distinguishable from zero; the effect size says whether it matters.
WHEN NOT TO USE: for 3+ groups in a single call — use the effect sizes
reported by ANOVA or by stat_pairwise_tests.
Note on paired designs: the standardiser is the SD of the difference scores, not the pooled SD. Cohen's d and dz are different quantities — state which you report.
Inputs: dv (required), name (required), group (required), eftype, +2 more. Returns: result
stat_equivalence_testStat Equivalence TestA
TOST equivalence test — for demonstrating that two groups are equivalent.
WHEN TO USE: the research claim is that there is no meaningful difference (e.g. a new measure matches an established one).
WHEN NOT TO USE: as a post-hoc rescue of a non-significant t-test. TOST answers a different question and needs its bound specified in advance.
A non-significant difference is not evidence of equivalence — absence of
evidence is not evidence of absence. The bound must be justified on
substantive grounds (the largest difference that would still be negligible),
ideally before data collection.
Inputs: dv (required), name (required), bound (required), group (required), +2 more. Returns: result
stat_homogeneity_testStat Homogeneity TestA
Test equality of variances across groups.
When to use: before an independent-samples t-test or a one-way ANOVA. When it fails: use Welch's t-test or Welch's ANOVA, which do not assume equal variances.
Inputs: dv (required), name (required), group (required), method. Returns: result
stat_intraclass_correlationStat Intraclass CorrelationA
Intraclass correlation — agreement or consistency between raters or measurements.
WHEN TO USE: inter-rater reliability, test-retest reliability, agreement between measurement devices.
WHEN NOT TO USE: as a substitute for Bland-Altman when the question is whether two methods agree in absolute terms — ICC is bounded by the range of the sample and can look excellent while agreement is poor.
Choosing the form matters and is often got wrong:
ICC2 — absolute agreement, raters treated as random and interchangeable.
ICC3 — consistency only (do raters rank the same way?), raters fixed.
the "k" variants — reliability of the mean of k raters, which is higher.
Inputs: name (required), raters (required), ratings (required), targets (required), +1 more. Returns: result
stat_linear_regressionStat Linear RegressionA
Ordinary least-squares regression with coefficients, CIs and model fit.
WHEN TO USE: continuous outcome predicted from one or more continuous or dummy-coded predictors; or when adjusting for covariates in a continuous-outcome model.
WHEN NOT TO USE:
Binary outcome →
stat_logistic_regression.Repeated measures / clustered data → a mixed-effects model; OLS standard errors will be wrong.
Severe multicollinearity → address it before interpreting coefficients.
The output includes R² and adjusted R². Check the assumptions listed in the output before interpreting coefficients; a significant coefficient is not evidence of a causal effect.
Inputs: x (required), y (required), name (required), alpha. Returns: result
stat_load_dataStat Load DataA
Load a tabular dataset (CSV/TSV/Excel/JSON/Parquet/SPSS) into the session.
Use this as the first step for any dataset stored as a file. The loaded
object is stored under name and every other tool refers to it by that name.
When to use: at the start of an analysis session, once per dataset.
When NOT to use: if the data are already in the session (check with
stat_session_info first), or if you need to construct a small example —
use stat_make_dataframe instead.
Inputs: path (required), name. Returns: result
stat_logistic_regressionStat Logistic RegressionA
Binary logistic regression with odds ratios and confidence intervals.
WHEN TO USE: a binary outcome (yes/no, present/absent) predicted from one or more variables.
WHEN NOT TO USE:
Continuous outcome →
stat_linear_regression.Ordinal outcome with 3+ levels → an ordinal model, not this.
Rare events (fewer than ~10 outcomes per predictor) → the estimates are biased; use penalised regression (Firth).
An odds ratio is not a risk ratio: for common outcomes it exaggerates the effect. Report predicted probabilities alongside when the substantive question is about risk.
Inputs: x (required), y (required), name (required), alpha. Returns: result
stat_make_dataframeStat Make DataframeA
Build a DataFrame from a {column: [values]} mapping.
Use this for worked examples, sanity checks, and illustrating a method with hypothetical data.
When NOT to use: never for real analysis — fabricated data must not enter an analysis of real results.
Inputs: name (required), columns (required). Returns: result
stat_mediationStat MediationA
Mediation analysis — does x affect y through m?
WHEN TO USE: a plausible causal chain x → m → y, with m measured after x and before y, and a theoretical reason to expect transmission.
WHEN NOT TO USE
Cross-sectional data where the temporal order is only assumed. A significant indirect effect from cross-sectional data does not establish a mechanism; the output states this.
As a fishing expedition across many candidate mediators — with enough mediators, one will show a significant indirect effect by chance.
The indirect effect's bootstrap CI excluding zero is the evidence for mediation. Report that CI, not the Sobel test.
Inputs: m (required), x (required), y (required), name (required), +3 more. Returns: result
stat_mixed_anovaStat Mixed AnovaB
Mixed-design ANOVA — one between-subjects factor crossed with one within-subjects factor.
WHEN TO USE: e.g. two groups measured at three time points; group × time designs.
Read the interaction first. A significant interaction means the effect of one factor depends on the level of the other, and the main effects must not be interpreted in isolation.
Inputs: dv (required), name (required), within (required), between (required), +3 more. Returns: result
stat_multicomp_correctionStat Multicomp CorrectionA
Correct a list of p-values for multiple comparisons.
WHEN TO USE: when you have a set of p-values computed outside Pingouin, or when applying a correction across several tests reported together.
Choosing a method:
holm — controls family-wise error rate; more powerful than Bonferroni. Default.
fdr_bh — controls false discovery rate; for many comparisons or exploratory work.
bonf — most conservative; only when any false positive is unacceptable.
none — no correction; only for a single pre-registered comparison.
State the method by name in the write-up; "we corrected for multiple comparisons" without naming the method is not reproducible.
Inputs: pvals (required), alpha, method. Returns: result
stat_nonparametric_2Stat Nonparametric 2A
Mann-Whitney U (independent) or Wilcoxon signed-rank (paired) — two groups, no normality assumption.
WHEN TO USE
Ordinal outcomes.
Continuous outcomes that are badly non-normal with small n.
Outliers that cannot be justified for removal.
Any time the mean is not a meaningful summary of the data.
WHEN NOT TO USE
Three or more groups →
stat_nonparametric_k.When the data are normal: the parametric test is more powerful, and using ranks discards information.
Report the rank-biserial correlation (RBC) as the effect size — the p-value alone says nothing about magnitude.
Inputs: dv (required), name (required), x, y, +4 more. Returns: result
stat_nonparametric_kStat Nonparametric KA
Kruskal-Wallis (independent) or Friedman (repeated) — three or more groups, no normality assumption.
WHEN TO USE: 3+ groups with ordinal outcomes, or continuous outcomes where normality is badly violated. WHEN NOT TO USE: when the parametric assumptions hold — the rank test is less powerful.
Follow a significant result with stat_pairwise_tests(parametric=False) and
a correction.
Inputs: dv (required), name (required), within, between, +1 more. Returns: result
stat_normality_testStat Normality TestA
Test whether a variable is normally distributed, optionally within each group.
When to use: before any parametric test (t-test, ANOVA, Pearson correlation). When NOT to use: as a gatekeeper that alone decides parametric vs non-parametric. With large n the test detects trivial deviations; with small n it has low power. Judge with the QQ plot and skewness too.
Inputs: dv (required), name (required), group, method. Returns: result
stat_pairwise_testsStat Pairwise TestsB
Pairwise comparisons with optional multiple-comparison correction.
WHEN TO USE
After a significant ANOVA / RM-ANOVA / mixed ANOVA, to identify which pairs differ.
For planned pairwise comparisons, including for main effects and interactions.
WHEN NOT TO USE: as an exploratory scan of every possible pair without a correction — that is p-hacking.
Set padjust to control the error rate. Reporting only the significant pairs
from an uncorrected set is the most common mistake in post-hoc reporting; the
tool warns when padjust='none' with multiple comparisons.
Inputs: dv (required), name (required), alpha, within, +6 more. Returns: result
stat_pairwise_tukeyStat Pairwise TukeyA
Tukey HSD or Games-Howell post-hoc tests after a one-way ANOVA.
WHEN TO USE
Tukey HSD: equal variances and roughly equal group sizes (the standard default).
Games-Howell (
method="gameshowell"): unequal variances or unequal group sizes — i.e. whenever Levene's test is significant.
WHEN NOT TO USE: for within-subjects designs — use stat_pairwise_tests with
the subject argument instead.
Inputs: dv (required), name (required), between (required), method. Returns: result
stat_partial_correlationStat Partial CorrelationA
Partial correlation — association between two variables after removing covariates.
WHEN TO USE: a third variable plausibly drives both x and y, and you want the association net of it.
WHEN NOT TO USE: as a substitute for modelling. If several covariates are involved, regression gives a clearer picture. Partial correlation also assumes the covariate is measured without error.
Inputs: x (required), y (required), name (required), covar (required), +1 more. Returns: result
stat_plot_blandaltmanStat Plot BlandaltmanA
Bland-Altman plot — agreement between two measurement methods.
WHEN TO USE: method comparison studies, test-retest agreement, comparing a new device or scale against a criterion.
WHEN NOT TO USE: when the question is association rather than agreement — for that, use a scatter plot with a correlation.
Inputs: x (required), y (required), name (required), agreement. Returns: result
stat_plot_pairedStat Plot PairedA
Paired-data plot — one line per participant across conditions.
WHEN TO USE: reporting any within-subjects comparison. It shows the participant-level change that the test actually analyses.
WHEN NOT TO USE: for independent groups — a boxplot or raincloud plot is appropriate there.
A bar chart of means hides participants moving in opposite directions, which is exactly the pattern that makes a mean difference misleading.
Inputs: dv (required), name (required), within (required), subject (required), +1 more. Returns: result
stat_plot_rm_corrStat Plot Rm CorrB
Plot for a repeated-measures correlation, with a per-participant fit.
WHEN TO USE: alongside stat_rm_correlation, to show whether the
within-subject relationship is consistent across participants.
Inputs: x (required), y (required), name (required), subject (required). Returns: result
stat_power_analysisStat Power AnalysisA
Power analysis — solve for whichever of effect size / n / power / alpha is omitted.
WHEN TO USE
Before data collection, to justify the sample size (a priori power analysis).
To report the achieved power of a completed study.
WHEN NOT TO USE: to compute "observed power" from the current sample's effect size and then interpret it — that is circular and adds nothing to the p-value.
Supply exactly three of the four quantities; the fourth is solved for.
Inputs: d, k, m, n, +7 more. Returns: result
stat_qqplotStat QqplotA
Quantile-quantile plot for judging distributional shape.
WHEN TO USE: alongside every normality test. The plot shows how the data depart from normality, which the test's p-value cannot tell you.
WHEN NOT TO USE: as the only check — report the test statistic too.
Inputs: name (required), column (required), dist. Returns: result
stat_reset_sessionStat Reset SessionA
Clear all datasets, results and figures, starting a fresh session.
WHEN TO USE: before starting a genuinely separate analysis, to avoid reading stale objects. WHEN NOT TO USE: casually — loaded data are lost.
Inputs: no named parameters. Returns: result
stat_rm_anovaStat Rm AnovaA
Repeated-measures ANOVA — one within-subjects factor with three or more levels.
WHEN TO USE: the same participants measured under 3+ conditions. WHEN NOT TO USE:
Only two conditions → a paired t-test is simpler and equivalent.
Missing data → a linear mixed-effects model uses all available data, whereas RM-ANOVA deletes whole cases.
Badly non-normal → Friedman test.
Always check sphericity first (stat_sphericity_test) and report the
corrected p-value if it is violated.
Inputs: dv (required), name (required), within (required), subject (required), +2 more. Returns: result
stat_rm_correlationStat Rm CorrelationA
Repeated-measures correlation — the correct correlation for within-subject data.
WHEN TO USE: whenever each participant contributes more than one observation and you want the association between x and y.
WHEN NOT TO USE: when each participant appears once — use stat_correlation.
Why it matters: a standard Pearson correlation on repeated measures is inflated by between-subject differences. rm_corr reports the within-subject association, which is usually the quantity of interest, and tests whether within- and between-subject slopes differ.
Inputs: x (required), y (required), name (required), subject (required). Returns: result
stat_run_codeStat Run CodeA
Execute arbitrary Python against the session namespace — the escape hatch.
Use this for anything the structured tools do not cover: custom recoding, a Pingouin function not exposed as a tool, or a bespoke plot.
Pre-bound names: pg (pingouin), pd (pandas), np (numpy), plt
(matplotlib), sns (seaborn), plus every loaded object by name.
The value of a trailing expression is returned. Matplotlib figures are saved automatically and their paths returned.
WHEN TO USE: beyond the structured tools. WHEN NOT TO USE: for routine analyses — the structured tools report assumptions and effect sizes that a bare call would omit.
Inputs: code (required). Returns: result
stat_session_infoStat Session InfoA
List the datasets and results currently held in the session.
Call this when unsure what data are available, or after loading several datasets, to confirm the names the other tools expect.
Inputs: no named parameters. Returns: result
stat_sphericity_testStat Sphericity TestA
Mauchly's test of sphericity for a repeated-measures factor with 3+ levels.
When to use: before a repeated-measures ANOVA with three or more conditions. When it fails: report the Greenhouse-Geisser corrected p-value and the epsilon. The uncorrected F is anti-conservative when sphericity is violated.
Not applicable with only two levels — a paired t-test needs no sphericity assumption.
Inputs: dv (required), name (required), within (required), subject (required), +1 more. Returns: result
stat_ttestStat TtestA
t-test: independent samples, paired, or one-sample.
WHEN TO USE
Two independent groups, continuous outcome, roughly normal, variances similar.
Same participants in two conditions →
paired=Truewithsubject.One sample against a reference value → pass
x(andyas the constant, or omit).
WHEN NOT TO USE
Three or more groups →
stat_anova(a t-test on all pairs inflates Type I error).Ordinal outcome, or badly non-normal with small n →
stat_nonparametric_2.Variances unequal → still a t-test, but set
correction=Trueto get Welch's.To claim two groups are equivalent →
stat_equivalence_test; a non-significant t-test is not evidence of equivalence.
Always report the effect size (Cohen's d, given in the output) and the CI.
Inputs: dv (required), name (required), x, y, +6 more. Returns: result
stat_welch_anovaStat Welch AnovaA
Welch's ANOVA — three or more groups without the equal-variance assumption.
WHEN TO USE: Levene's test is significant, or group sizes and variances differ. WHEN NOT TO USE: when variances are equal — the standard ANOVA is more powerful.
Note: Welch's ANOVA does not yield the usual η²; report ω² or use pairwise effect sizes with a correction.
Inputs: dv (required), name (required), between (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 43 tools
Almost every tool targets a distinct statistical procedure, and the WHEN TO USE / WHEN NOT TO USE blocks actively route the agent between near-neighbours (e.g. stat_ttest vs stat_bayes_ttest vs stat_equivalence_test). The main soft spots are stat_pairwise_tests vs stat_pairwise_tukey, and stat_assumption_report vs the individual normality/homogeneity/sphericity checks, which overlap in purpose though the descriptions explain the aggregate-vs-single distinction.
Every one of the 43 tools uses the same `stat_` prefix plus snake_case verb_noun form (stat_load_data, stat_normality_test, stat_rm_anova). Even abbreviations like stat_ttest and stat_qqplot fit the pattern predictably.
43 tools is well past the range where an agent can reliably scan and select; the statistics domain is broad, but the surface is split very finely (separate tools for sphericity, homogeneity, normality, Tukey, Games-Howell, etc.). Many could be consolidated into parameterised tools without losing capability.
Coverage is strong across descriptive stats, assumption checks, parametric/non-parametric tests, regression, reliability, power and plotting, with stat_run_code as an explicit escape hatch for gaps. However, several analyses the descriptions themselves recommend are not exposed as tools (mixed-effects models, ordinal regression, Firth/penalised regression, factor analysis, and basic group plots like boxplots/rainclouds), and there is no export/report-writing tool.
Maintenance
Related MCP Connectors
A statistical analyst in your AI chat: bring data and a question, get a citable, re-runnable report.
Research methods for AI assistants: study design guidance, R and Python code, and citations
Exact statistics & probability: distributions, hypothesis tests, CIs, Bayesian updates, regression.
Valid and reliable data engineering and statistical analysis without hallucinations.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides a virtual statistician for AI agents, offering real statistical methods such as design of experiments, hypothesis testing, regression, and process control. It includes an advisor tool to recommend appropriate analyses and generates plain-language interpretations of results.MIT
- AlicenseAqualityBmaintenanceProvides verified statistical inference and hypothesis testing tools, including t-tests, effect sizes, power analysis, and multiple comparisons correction, with assumption checks and citations.3742 PyPI1MIT
- AlicenseAqualityCmaintenanceEnables AI agents to perform reproducible, verifiable statistical analysis through 25 deterministic tools for descriptive statistics, hypothesis testing, regression, clustering, time-series forecasting, and Chinese-labeled plotting.301MIT
- AlicenseAqualityBmaintenanceRecommends study designs for a research question, states the identifying assumptions to verify, and returns runnable R, Python, or Julia code with a formatted citation for every source, drawn from methodological textbooks, an R package, and research articles on causal inference, econometrics, statistics, and machine learning.6MIT