Skip to main content
Glama
Psychometrics MCP

Psychometrics MCP

by huacheng1985

Psychometrics MCP

Psychometrics MCP is a local-first, measurement-aware MCP server for reproducible statistical and psychometric analysis. It is designed to help an AI host use constrained analytical tools without exposing arbitrary R or shell execution.

The project is an early prototype. Current results require qualified human review and must not be used as automatic evidence of score validity, fairness, or fitness for consequential decisions.

Current tools

Tool

Purpose

check_computation_capabilities

Check Python and fixed R engine availability

inspect_response_data

Audit dimensions, missingness, categories, ranges, and variance

ctt_item_analysis

Item summaries, item-rest correlations, raw alpha, and SEM

descriptive_statistics

Available-case numeric summaries, quartiles, and missingness

correlation_matrix

Pearson or Spearman matrices with pairwise/listwise deletion and pair-specific n

polychoric_correlation_matrix

Unsmoothed two-step polychoric matrix for ordered categorical variables

ordinary_least_squares

Numeric OLS with classical inference, fit, sample flow, and influence diagnostics

confirmatory_factor_analysis

Continuous-indicator simple-structure CFA with fixed lavaan::cfa ML/MLR estimation

categorical_confirmatory_factor_analysis

Ordered-indicator simple-structure CFA with fixed lavaan::cfa WLSMV estimation

continuous_measurement_invariance

Configural, metric, scalar, and strict multi-group CFA comparisons without automatic pass/fail rules

parallel_analysis

Seeded Horn-style common-factor retention evidence with MINRES or ML

ordinal_parallel_analysis

Seeded permutation PA with polychoric/Pearson, PCA/common-factor, and cutoff sensitivity

exploratory_factor_analysis

Fixed-factor continuous EFA with MINRES/ML and oblimin/varimax/no rotation

ordinal_exploratory_factor_analysis

Fixed-factor EFA from an unsmoothed polychoric matrix

plan_psychometric_analysis

Build a purpose- and design-aware analysis sequence

rasch_model

Fit a fixed dichotomous eRm::RM model with CML

Rasch is the first end-to-end numerical validation slice, not the product boundary. The development plan includes descriptive statistics, correlations, regression, measurement-aware machine learning, factor models, broader IRT/Rasch, DIF and invariance, linking/equating, CAT/MST, G-theory, rater models, DCM, validity evidence, and reproducible reporting.

Related MCP server: R MCP Server

Local installation

Requirements:

  • Python 3.11+

  • R with eRm, lavaan, psych, GPArotation, and jsonlite for the fixed Rasch, CFA, parallel-analysis, and EFA adapters

python3 -m venv .venv
source .venv/bin/activate
python -m pip install '.[dev]'
psychometrics-mcp

The command starts a stdio MCP server. Configure an MCP host to launch the absolute path to .venv/bin/psychometrics-mcp.

Docker

docker build -t psychometrics-mcp:local .
docker run --rm -i psychometrics-mcp:local

The server communicates over stdin/stdout, so -i is required. It runs as a non-root user and does not need a data volume because tools accept structured inputs. If future file-based tools are enabled, mount only a narrow directory read-only.

Verification

ruff check .
pytest
pip-audit
python -m build

All tool results carry schema_version: "1.0". The test suite includes real eRm, lavaan, and psych integration tests and versioned numerical regression targets. Each reference states whether it is independent or engine-based validation. CI separately validates Python behavior, the R adapters, and the Docker build.

Interpretation and safety boundaries

  • Tool inputs are strict schemas; unknown fields are rejected.

  • R-backed tools call fixed scripts and never accept user R or shell code.

  • Missingness, exclusions, methods, versions, warnings, and sample flow are returned with analytical results.

  • Reliability is not validity, model fit is not fairness, and prediction is not measurement of a construct.

  • Local deployment is preferred for item-response and student-level data.

See Architecture, Tool Admission Policy, OLS Regression, Confirmatory Factor Analysis, Measurement Invariance, EFA and Parallel Analysis, Ordinal Correlation and Factor Models, Privacy and Deployment, the Output Contract, and the Development Backlog.

License

MIT

Available Tools

7 tools
check_computation_capabilitiesA

Report whether local Python and the fixed R/eRm Rasch engine are available.

Inputs: no named parameters. Returns: object

correlation_matrixA

Compute Pearson or Spearman correlations with explicit missing-data handling.

Inputs: request (required). Returns: object

ctt_item_analysisC

Compute item summaries, item-rest correlations, raw alpha, and SEM with warnings.

Inputs: data (required). Returns: object

descriptive_statisticsB

Summarize numeric variables with sample flow, missingness, and robust boundaries.

Inputs: data (required). Returns: object

inspect_response_dataB

Audit response shape, missingness, categories, ranges, and zero-variance items.

Inputs: data (required). Returns: object

plan_psychometric_analysisC

Create a measurement-aware analysis sequence from the intended use and design.

Inputs: request (required). Returns: object

rasch_modelA

Fit a fixed dichotomous Rasch model with eRm::RM; arbitrary code is never accepted.

Inputs: data (required). Returns: object

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 7 tools

    Disambiguation3/5

    The core analysis tools are mostly distinct, but inspect_response_data, descriptive_statistics, and ctt_item_analysis all touch on summarizing data, missingness, and item-level properties. Descriptions help clarify intent, yet an agent could still hesitate between an audit and a general descriptive summary.

    Naming Consistency3/5

    Tool names use snake_case throughout and are readable, but they mix verb-led names like inspect_response_data and plan_psychometric_analysis with noun-led names like correlation_matrix and rasch_model. The inconsistency is mild but prevents a clear predictable verb_noun convention.

    Tool Count5/5

    Seven tools is well-scoped for a psychometrics-focused server covering environment checks, data inspection, descriptive stats, correlations, CTT, planning, and Rasch modeling. Each tool earns its place without bloating the surface.

    Completeness4/5

    The server covers a coherent CTT-plus-Rasch workflow from planning through data auditing, descriptives, correlations, item analysis, and model fitting. Minor gaps exist such as no polytomous IRT or visualization tools, but the core measurement workflow is not blocked.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers