MCP-for-Stata
An MCP server that lets an agent run local Stata: regressions, econometrics, replicating computations from papers
- 276 ★ on the repository
- Last commit
- AGPL-3.0
Extended access
Why this level
- The agent runs statistical code in Stata on your data
- It reads and writes project files in the working directory
Install
- Works in
Manual install
claude mcp add stata-mcp --scope user -- uvx stata-mcpAdds the server to Claude Code. Stata must be installed locally.
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- The agent runs statistical code in Stata on your data
- It reads and writes project files in the working directory
This is third-party code. Review the repository files before installing.
What it does
The server bridges an agent and the Stata installed on your machine. The agent sends commands and do-files, the server runs them locally and returns logs and results. It advertises command checks, resource monitoring and automatic log capture, while your data and Stata license stay with you. It ships with skills for auditing and Stata work, plus an installer for several agents.
Who it is for. For analysts, econometricians, teachers and students who compute in Stata and want to do it through an agent.
Good fit when
- You want the agent to run a regression or a do-file in Stata
- You are replicating a paper's computations and want to automate the steps
- You work with panel data and econometrics alongside an agent
Not a fit when
- You do not have Stata installed and licensed
- You need a package for another statistical language, not Stata
- You are not ready to let the agent run code on your data
Example request
Load my dta file, run a regression of wage on education and experience, and show the coefficient tableMCP
- Transport
- stdio
- Authentication
- not required
Environment variables
STATA_MCP__CWD- Working directory for Stata runs, defaults to the current project folder.
Limitations
You need a paid, installed Stata; the server only connects the agent to it. The project is AGPL-3.0, which matters if you embed it. Command checks exist, but the agent still runs statistical code on your data, so keep access under control.
How to disable. Remove the stata-mcp entry from your agent's MCP config (for example claude mcp remove stata-mcp) or uninstall the stata-toolbox plugin.
FAQ
Do I need a separate Stata?
Yes, the server does not replace Stata; it runs the copy installed on your machine, so a valid license is required.
Which agents does it work with?
The installer supports Claude Code, Claude Desktop, Codex, Cursor, Cline, Gemini CLI, OpenCode and others via uvx stata-mcp install.
Discussion
No questions or reviews yet.
Related
MCP serversstata-code runs Stata from Claude Code and Cursor: DiD, IV and RDD, esttab tables and a compact result format.
A Stata command line for agents: runs do-files, returns regression results as JSON and keeps a daemon for fast repeats.
The MCP server and skill of the StatsPAI library: the agent runs DiD, RD, IV and synthetic control on your data
The official MathWorks MCP server: the agent starts and quits MATLAB, writes and runs code, and checks it for errors and style
MCP server that gives an agent access to MySQL: schema inspection and queries, read-only by default, writes behind flags
Official Data Commons MCP server: an agent finds statistical indicators and pulls observations for countries, regions and cities.
README in short
The README presents the project as an MCP server and CLI that let any agent call local Stata for regressions, econometrics and computation replication. It highlights one-command setup via uvx stata-mcp install for several agents and MCP config via claude mcp add. There is a doctor command to check the environment, a comparison page with similar projects, and a security section with patched CVEs. The package ships on PyPI as stata-mcp, AGPL-3.0.