Stata Mcp
About
Perform regression analysis using Stata with the help of an LLM. Requires a local Stata installation and an external LLM API key.
Explore
- Integrates LLMs with Stata for regression tasks
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
Stata McpCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"stata mcp": {
"stata-mcp": {
"command": "uv",
"args": [
"--directory",
"/path/to/the/repo/",
"run",
"stata_mcp.py"
]
}
}
}
}
McpServers
{
"stata-mcp": {
"command": "uv",
"args": [
"--directory",
"/path/to/the/repo/",
"run",
"stata_mcp.py"
]
}
}
MCP-for-Stata: Integrate Stata into your agent
Enable Claude Code, Codex, OpenClaw, and other AI agents to safely invoke Stata on your local device for data analysis.
Stata is a registered trademark of StataCorp LLC. This project is an independent community-developed tool and is not affiliated with, endorsed by, or sponsored by StataCorp LLC.
- 🚀DeepSeek Harness Day 0 Support: Install MCP-for-Stata in DeepSeek Harness withuvx stata-mcp install -c dsh. See theDeepSeek Harness guide.
- 🧪Claude Science Support: MCP-for-Stata now works in Claude Science with a sandbox allowlist. See theClaude Science guide.
- Find more in WeChat:Why I made it?, and8 figures find out Stata-MCP
- 🦞OpenClaw Support: Standalone CLI tools for OpenClaw integration (stata-mcp tool), seeOpenClaw guide
- ✨Claude Code Plugin Support: Official plugin package with MCP server and Stata LSP integration
- Use MCP-for-Stata in Claude Code, seeClaude Code advanced usage, or in Codex seeCodex advanced usage
Finding ournewest research?View latest research reports.
- A session based MCP server for Stata,mcp-stata
- IDEs (VScode or Cursor) integratedstata-mcp for VSCode. Confused them? 💡Comparison
The AGPL 3.0 License is a type of open-source license. It does not affect your daily use, and allows you to use, modify, and distribute this software free of charge, provided that you comply with its terms, such as retaining the original copyright notices.
Notes: While we strive to make open source accessible to everyone, we regret that we can no longer maintain the Apache-2.0 License. Due to individuals directly copying this project and claiming to be its maintainers, we have decided to change the license to AGPL-3.0 to prevent misuse of the project in ways that go against our original vision.
Notes: 尽管我们希望尽可能让所有人都能从开源中获益,但我们很遗憾地宣布无法继续保持 Apache-2.0 License。由于有人直接抄袭本项目并标榜其为项目维护者,我们不得不将 License 更改为 AGPL-3.0,以防止有人滥用本项目进行违背项目初心的事情。
Update: The infringing project has been taken down via GitHub DMCA.View DMCA takedown details.
背景: @jackdark425 的仓库直接抄袭了本项目并标榜为项目唯一维护者。我们欢迎基于fork的开源协作,包括但不限于添加新的feature、修改已有bug或对项目提出您宝贵的意见,但坚决反对抄袭和虚假署名行为。
更新: 侵权项目已通过GitHub DMCA被takedown,查看DMCA下架详情。
🚀 One-click installation for all clients!
No config, no manual JSON editing. Just one command installs MCP-for-Stata forevery supported agent(Claude Code, Codex, OpenClaw, Cursor, Gemini CLI, and more):
If you don't haveuv,see the uv installation guideto install it. Or, use our beta install script (auto-installsuvif missing):
curl -fsSL https://raw.githubusercontent.com/SepineTam/mcp-for-stata/master/scripts/install.sh | bash
irm https://raw.githubusercontent.com/SepineTam/mcp-for-stata/master/scripts/install.ps1 | iex
If you don't know how to use them,download the installation scriptsand double-click it in your device.install.batfor Windows users, andinstall.commandfor macOS users.
As we find Claude Code is the best agent for MCP-for-Stata as its prefect agentic ability, we recommend using it, and there are lots of advanced usage following:
Before using it, please make sure you have ever installClaude Code, if you don't know how to install it, visit onGitHub
Generally, you can install MCP-for-Stata globally for one time, you can run:
claude mcp add stata-mcp --scope user -- uvx stata-mcp
Then, you do not need to watch it again.
If you want to install it locally only for the certain workspace, you cancdto your working directory, and run:
claude mcp add stata-mcp --env STATA_MCP__CWD=$(pwd) --scope local -- uvx --directory $(pwd) stata-mcp
It would nothing happen, you can typeclaudeand type/mcpto find the status.
Also, collaboration is an essential part of research. You can share your MCP config with your co-authors using:
claude mcp add stata-mcp --scope project -- uvx stata-mcp
In your working directory, you can find a file named.mcp.json, your mcp config will be placed here.
Then, you can use MCP-for-Stata in Claude Code. Here are some scenarios for using it:
- Paper Replication: Replicate empirical studies from economics papers
- Quick Hypothesis Testing: Validate economic hypotheses through regression analysis
- Stata Learning Assistant: Learn econometrics with step-by-step Stata explanations
- Code Organization: Review and optimize existing Stata do-files
- Result Interpretation: Understand complex statistical outputs and regression results
If you use Claude Code inside IDEs (either the integrated terminal or the Claude Code Extension), installing our plugin includingMCP-for-StataandStata LSPmaintained by @euglevi.
# Add the MCP-for-Stata marketplace claude plugin marketplace add SepineTam/mcp-for-stata # Install the plugin to local, project or user scope claude plugin install stata-toolbox -s project
The language server gives AI-generated Stata code better syntax awareness and completion, which improves output quality. We package the LSP in compliance with its license and give full attribution to the original author.
We find that many researchers are using Codex as their agent, therefore we also provide instructions for Codex users.
I figure that researchers are not using Codex CLI but Codex Desktop, so we can say it is easier to config MCP-for-Stata than other agents.
You just need to sayInstall MCP-for-Stata for yourself globally from https://www.statamcp.com or visit https://github.com/SepineTam/mcp-for-statathen restart your Codex Desktop after it say ready.
Also, if you want to install it manually, here are two ways:
- Open your Codex Desktop APP
- ClickSettingsin the bottom-left corner
- FindMCP serverson the left side
- ClickAdd server
- Fill with the following:
Name: stata-mcp Command to launch: uvx Arguments: stata-mcp
For CLI mode, just run the following command in your terminal
codex mcp add stata-mcp -- uvx stata-mcp
Claude Science runs MCP servers inside a strict sandbox that blocks access to the home directory (~) by default. If you try to launch MCP-for-Stata the standard way, you may see:
Couldn't load tools: MCP error -32000: Connection closed FileNotFoundError: [Errno 2] No such file or directory
…
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



