Stata-MCP
Lets your AI agent run your local Stata for regression analysis, econometrics and paper replication, with safety guards.
274 stars on GitHubby SepineTamLicense AGPL-3.0Updated last month
How to install
This MCP is local: it runs on your computer.
It works in apps installed on your PC (Claude Desktop, Claude Code, Cursor, VS Codeβ¦). Choose your app:
Paste in the terminal:
claude mcp add stata -- uvx stata-mcp
Ready! Now test it
Restart the app and paste one of these requests in the chat:
Run a regression of wages on education and experience and explain the result.
Replicate the main table of this paper using Stata.
What it is
MCP-for-Stata lets any AI agent call the Stata installed on your own computer. It adds command guards, resource monitoring and automatic log capture, and you keep control of your data and your Stata license. It also ships Stata-related skills and a command-line tool.
What it can do
- Run Stata commands on your computer
- Command guards that limit risky commands
- Resource monitoring
- Automatic log capture
uvx stata-mcp installto set up supported agents- Standalone CLI tools for OpenClaw (
stata-mcp tool)
When to use
- βΊWhen you want to replicate the results of an economics paper
- βΊWhen you want to test a hypothesis with a regression and get the output explained
- βΊWhen you want help cleaning up or reviewing a Stata do-file
What you need
Skills that pair well
MCP or skill?
The MCP gives the agent the hands. The skill teaches the right way to use them. Together, the result is better and uses fewer tokens.
statistical-analysisHelps your agent run statistical tests for research, such as t-tests, ANOVA, chi-square, and regression, with checks and APA-style reporting.statsmodelsAllows your agent to fit and diagnose statistical models in Python. It's used for econometric analysis, time series forecasting, and coefficient inference.research-paper-writingGuides your agent through writing a machine learning research paper, from experiments and analysis to review and submission.Frequently asked questions
Is it free?
The software is open source under the AGPL-3.0 license. You still need your own Stata license, which is not included.
Is it from StataCorp?
No. The readme says it is an independent community project, not affiliated with StataCorp LLC.
Which agents can I install it into?
Claude Desktop, Claude Code, Gemini CLI, Cursor, Cline, Codex, OpenCode and OpenClaw, using uvx stata-mcp install --all or one client at a time.
Does it work in Claude Science?
Yes, with a sandbox allowlist for the paths where uv places its files, as the readme describes.
Where does my data stay?
The readme says you retain control of your data and Stata license, and Stata runs on your device.
Are there extra skills?
Yes. Stata-related skills are now installed together with the MCP by default.
If it does not work
- βΊIf you do not have uv, install it first or use the install script, which installs it for you.
- βΊIn Claude Science, allowlist ~/.local/bin and ~/.local/share/uv/tools/stata-mcp in config.toml if you see Connection closed.
- βΊRestart your client after installing so it loads the server.
5 new skills a week. 1 minute to read.