MCP-for-Stata
An MCP server that lets an agent run local Stata: regressions, econometrics, replicating computations from papers
Medium risk
We rate an entry medium when the tool runs code, makes network calls or reads project files. Check what exactly it does before installing.
Why this level
- The agent runs statistical code in Stata on your data
- It reads and writes project files in the working directory
Install
In your terminal, with SkillFoxx CLI
npx skillfoxx add mcp/mcp-for-stataDetects the agents on your machine, checks the risk and pins the version.
Other ways to install
Run in a terminal
claude mcp add --transport stdio stata-mcp -- uvx stata-mcp==1.25.0Or add to the file .mcp.json, in the project
{
"mcpServers": {
"stata-mcp": {
"command": "uvx",
"args": [
"stata-mcp==1.25.0"
]
}
}
}If the file already exists, add the server inside the mcpServers key.
The button opens the agent and offers to add the server. If nothing happens, copy the config below.
Add to the file ~/.cursor/mcp.json, for all projects
{
"mcpServers": {
"stata-mcp": {
"command": "uvx",
"args": [
"stata-mcp==1.25.0"
]
}
}
}If the file already exists, add the server inside the mcpServers key. For a single project, put the same block into .cursor/mcp.json.
The button opens the agent and offers to add the server. If nothing happens, copy the config below.
Run in a terminal
code --add-mcp '{"name":"stata-mcp","type":"stdio","command":"uvx","args":["stata-mcp==1.25.0"]}'Or add to the file .vscode/mcp.json, in the project
{
"servers": {
"stata-mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"stata-mcp==1.25.0"
]
}
}
}If the file already exists, add the server inside the servers key.
Run in a terminal
codex mcp add stata-mcp -- uvx stata-mcp==1.25.0Or add to the file ~/.codex/config.toml, for all projects
[mcp_servers.stata-mcp]
command = "uvx"
args = ["stata-mcp==1.25.0"]If the file already exists, append the block to the end.
Run in a terminal
gemini mcp add -s user stata-mcp uvx stata-mcp==1.25.0Or add to the file ~/.gemini/settings.json, for all projects
{
"mcpServers": {
"stata-mcp": {
"command": "uvx",
"args": [
"stata-mcp==1.25.0"
]
}
}
}If the file already exists, add the server inside the mcpServers key.
Add to the file ~/.config/devin/mcp_config.json, for all projects
{
"mcpServers": {
"stata-mcp": {
"command": "uvx",
"args": [
"stata-mcp==1.25.0"
]
}
}
}If the file already exists, add the server inside the mcpServers key. Legacy Cascade keeps the MCP config in ~/.codeium/windsurf/mcp_config.json.
Formerly Windsurf.
Add to the file cline_mcp_settings.json, for all projects
{
"mcpServers": {
"stata-mcp": {
"command": "uvx",
"args": [
"stata-mcp==1.25.0"
]
}
}
}If the file already exists, add the server inside the mcpServers key. Open the settings file in Cline: MCP Servers tab, Configure MCP Servers.
Add to the file .roo/mcp.json, in the project
{
"mcpServers": {
"stata-mcp": {
"command": "uvx",
"args": [
"stata-mcp==1.25.0"
]
}
}
}If the file already exists, add the server inside the mcpServers key.
A fork of Roo Code, same .roo folders.
Add to the file opencode.json, in the project
{
"mcp": {
"stata-mcp": {
"type": "local",
"command": [
"uvx",
"stata-mcp==1.25.0"
]
}
}
}If the file already exists, add the server inside the mcp key.
Add to the file ~/.config/zed/settings.json, for all projects
{
"context_servers": {
"stata-mcp": {
"command": "uvx",
"args": [
"stata-mcp==1.25.0"
]
}
}
}If the file already exists, add the server inside the context_servers key.
Add to the file .codeassistant/mcp.json, in the project
{
"mcpServers": {
"stata-mcp": {
"command": "uvx",
"args": [
"stata-mcp==1.25.0"
]
}
}
}If the file already exists, add the server inside the mcpServers key.
Install and configure the MCP: claude mcp add stata-mcp --scope user -- uvx stata-mcp. Make sure Stata is installed locally. Check readiness with uvx stata-mcp doctor.
Other ways from the author
claude mcp add stata-mcp --scope user -- uvx stata-mcpAdds the server to Claude Code. Stata must be installed locally.
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 tableLimitations
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.
MCP
- Transport
- stdio
- Authentication
- not required
| Environment variables | |
|---|---|
| STATA_MCP__CWD | Working directory for Stata runs, defaults to the current project folder. |
Security check
- The agent runs statistical code in Stata on your data
- It reads and writes project files in the working directory
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.
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.
Related
166 skills for scientific work: bioinformatics, cheminformatics, clinical data, geospatial analysis and 100+ databases
Google's open-source MCP server for databases: ready tools for Postgres, MySQL, BigQuery, Spanner and more, plus custom tools in tools.yaml
Official Hugging Face skills: Hub operations via the hf CLI, datasets, model training, Spaces, evals and deployment
A visualization language for agents and an MCP server: neat charts from a simple semantic spec