stata-mcp — Claude Code MCP server: run Stata from your agent
An MCP server that lets your AI agent call local Stata for regressions, econometrics and paper replication. Your data and license stay on your machine.
claude mcp add stata-mcp -- uvx stata-mcpWhat stata-mcp does
The server wires your agent to the Stata install on your device. The agent writes do-files, runs them and reads the logs, so you stop switching windows. There is also a CLI mode and Stata skills that ship with the server.
Inside you get command guards, resource monitoring and automatic log capture. One command sets it up for every supported client: uvx stata-mcp install --all. For Claude alone, claude mcp add stata-mcp -- uvx stata-mcp is enough. You need uv/uvx available and a working Stata license on the machine — without the license the server starts but the analysis does not.
The project is AGPL-3.0. It moved there from Apache-2.0 after someone copied the repo and claimed sole maintainership; that fork was later taken down via DMCA. Fork it and redistribute a build, and the AGPL terms apply to you.
What it helps with
- run a panel-data regression from a do-file
- replicate the numbers in a paper against its dataset
- collect logs from several Stata runs in one place
- keep the agent away from commands that touch your files
- install the MCP server across several editors at once
Example prompts for the agent
- Run a regression on this table in Stata and show me the coefficients
- Check my
analysis.doand fix the syntax errors - Pull the logs from the last Stata runs and tell me what failed
How to install stata-mcp
Platform CLI
claude mcp add stata-mcp -- uvx stata-mcpuvx runs the command named after the package; if the README names another one, use uvx --from stata-mcp <command>
Platform CLI
codex mcp add stata-mcp -- uvx stata-mcpuvx runs the command named after the package; if the README names another one, use uvx --from stata-mcp <command>
Config file
{
"mcpServers": {
"stata-mcp": {
"command": "uvx",
"args": [
"stata-mcp"
]
}
}
}uvx runs the command named after the package; if the README names another one, use uvx --from stata-mcp <command>
Config file
{
"servers": {
"stata-mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"stata-mcp"
]
}
}
}uvx runs the command named after the package; if the README names another one, use uvx --from stata-mcp <command>
Platform CLI
gemini mcp add stata-mcp uvx stata-mcpuvx runs the command named after the package; if the README names another one, use uvx --from stata-mcp <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about stata-mcp
How do I install stata-mcp in Claude?
Run claude mcp add stata-mcp -- uvx stata-mcp. To cover every supported client at once, use uvx stata-mcp install --all.
What does stata-mcp do?
It lets an agent invoke local Stata for regression analysis and econometrics. Commands pass through guards and logs are captured automatically.
Do I need a Stata license?
Yes. The analysis runs on your local Stata, so the license and your data stay on your device.