mplus-mcp
mplus-mcp
一个驱动 Mplus 的 MCP 服务器:它准备数据、编写并运行输入文件,并将输出读回为表格,而不是数百行固定宽度的文本。
适用于授权可执行文件和 Mplus Demo(后者将模型限制为 6 个因变量和 2 个自变量)。
繁體中文說明請見 README.zh-TW.md。
工具
工具 | 功能 |
| 正在使用的可执行文件、其版本、演示版限制 |
| 按主题分类的语法参考(模型、混合、不变性、错误……) |
| CSV/Excel/SPSS/Stata → Mplus |
| 用于 cfa、efa、path、sem、mediation、growth、lpa、lca、invariance、twolevel 的输入语法 |
| 将语法写入文件、运行并总结输出 |
| 运行现有的 |
| 重新读取任意 |
| 逐字输出某个部分(TECH1、残差、随机起始值……) |
| 并排比较拟合指数,并进行缩放卡方差异检验 |
| 读回因子得分/类别概率,可选输出为 CSV |
Related MCP server: aigroup-econ-mcp
安装
需要 uv 和 Mplus 安装。演示版也可以。
Claude Code
claude mcp add mplus -- uvx --from git+https://github.com/Ian3738/mplus-mcp mplus-mcpClaude Desktop
添加到 claude_desktop_config.json(macOS:~/Library/Application Support/Claude/,Windows:%APPDATA%\Claude\):
{
"mcpServers": {
"mplus": {
"command": "uvx",
"args": ["--from", "git+https://github.com/Ian3738/mplus-mcp", "mplus-mcp"]
}
}
}如果客户端找不到 uvx,请提供绝对路径(which uvx)。
从克隆安装
git clone https://github.com/Ian3738/mplus-mcp
cd mplus-mcp
uv sync
claude mcp add mplus -- "$(pwd)/run-server.sh"run-server.sh 用于处理裸 uv run 无法处理的两种情况:启动时 PATH 中没有 uv 的 GUI 客户端,以及位于 iCloud Drive 内的克隆,其中虚拟环境必须位于同步文件夹之外。
配置
变量 | 默认值 | 用途 |
| 第一个找到的可执行文件(见下文) | Mplus 可执行文件的路径。设置它以优先使用授权版本而非演示版。 |
|
| 未指定文件夹时运行的位置 |
自动搜索:PATH 中的 mplus / mpdemo、/Applications/Mplus/mplus、/Applications/MplusDemo/mpdemo、/usr/local/bin/mplus、/opt/mplus/mplus、C:\Program Files\Mplus\Mplus.exe。
读取 .sav 文件需要一个额外的包:在 uv sync 中添加 --extra spss,或使用 uvx --from "git+https://github.com/Ian3738/mplus-mcp[spss]" mplus-mcp。
通过让模型调用 mplus_status 来验证设置。
会话流程
data_prepare(path="ses.csv")
→ writes ses.dat, reports that `motivation` became `motivat`, hands back
NAMES = id sex y1 y2 y3 y4 x1 x2; MISSING = ALL (-999);
build_syntax(model_type="cfa", data_file="ses.dat",
names="id sex y1-y4 x1 x2",
factors={"F1": ["y1", "y2", "y3", "y4"]})
→ the input file as text
run_syntax(syntax=..., workdir="/path/holding/ses.dat", name="cfa1")
→ status, fit table, parameter estimates, any warnings, and cfa1.out on disk
compare_fit(out_paths=["cfa1.out", "cfa2.out"], chisq_diff=True)关于 Mplus 本身的说明
数据文件相对于输入文件所在的文件夹进行解析,因此服务器始终将工作目录设置为
.inp文件夹,并通过裸文件名引用数据。这就是带空格的文件夹名称也能正常工作的原因。输入行限制为 90 个字符;
run_syntax会折叠更长的行。变量名限制为 8 个字符;
data_prepare会重命名并报告。即使运行失败也会写入
.out文件,因此会解析错误并返回,并在适用时附上已知原因。
许可证
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Provides easy access to MLB, Baseball Savant, Statcast, and Fangraphs baseball data. Query detaile…
Structured analysis API and remote MCP tool for text, JSON records and numeric series.
IMF MCP — wraps IMF SDMX JSON REST API (dataservices.imf.org)
Provide structured access to ClinicalTrials.gov data for searching, retrieving, and analyzing clin…
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server for NONMEM pharmacometric modeling that provides structured access to model parsing, execution, and results analysis. It enables users to perform diagnostics, manage PsN workflows, and translate models to mrgsolve for PK simulations through natural language.2215MIT
- AlicenseNot gradedqualityDmaintenanceEconometrics MCP server for regression, causal inference, time series, panel data, machine learning, and broader statistical analysis workflows.10MIT
- FlicenseNot gradedqualityCmaintenanceEnables comprehensive statistical analysis including descriptive statistics, hypothesis testing, regression, and more via a FastMCP-based API.3
- FlicenseNot gradedqualityCmaintenanceMCP bridge for Demeter/Artemis EXAFS fitting. Enables headless fits, building Artemis projects, generating LaTeX reports, and launching the Artemis GUI.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/Ian3738/mplus-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server