Let LLM help you achieve your regression analysis with Stata
Project description
Stata-MCP
Let LLM help you achieve your regression analysis with Stata ✨
News: Now you can use Stata-MCP with agent mode, more information here.
Finding our newest research? Click here or visit reports website.
Looking for others?
- Trace DID: If you want to fetch the newest information about DID (Difference-in-Difference), click here. Now there is a Chinese translation by Sepine Tam and StataMCP-Team 🎉
- Jupyter Lab Usage (Important: Stata 17+) here
- NBER-MCP & AER-MCP 🔧 under construction
- Econometrics-Agent
- TexIV: A machine learning-driven framework that transforms text data into usable variables for empirical research using advanced NLP and ML techniques
- A VScode or Cursor integrated here. Confused it? 💡 Difference
💡 Quick Start
Agent Mode
The details of agent mode find here.
git clone https://github.com/sepinetam/stata-mcp.git
cd stata-mcp
uv sync
uv run agent_examples/openai/main.py
You can edit the task in agent_examples/openai/main.py for variable model_instructions and task_message, click me #L37 and #L68
AI Chat-Bot Client Mode
Standard config requires: please make sure the stata is installed at the default path, and the stata cli (for macOS and Linux) exists.
The standard config json as follows, you can DIY your config via add envs.
{
"mcpServers": {
"stata-mcp": {
"command": "uvx",
"args": [
"stata-mcp"
]
}
}
}
For more detailed usage information, visit the Usage guide.
And some advanced usage, visit the Advanced guide
Prerequisites
- uv - Package installer and virtual environment manager
- Claude, Cline, ChatWise, or other LLM service
- Stata License
- Your API-KEY from LLM
Notes:
- If you are located in China, a short uv usage document you can find here.
- Claude is the best choice for Stata-MCP, for Chinese, I recommend to use DeepSeek as your model provider as it is cheap and powerful, also the score is highest in China provider, if you are increased in it, visit the report How to use StataMCP improve your social science research.
Installation
For the new version, you don't need to install the stata-mcp package again, you can just use the following command to check whether your computer can use stata-mcp.
uvx stata-mcp --usable
uvx stata-mcp --version
If you want to use it locally, you can install it via pip or download the source code.
Download via pip
pip install stata-mcp
Download source code and compile
git clone https://github.com/sepinetam/stata-mcp.git
cd stata-mcp
uv build
Then you can find the compiled stata-mcp binary in the dist directory. You can use it directly or add it to your PATH.
For example:
uvx /path/to/your/whl/stata_mcp-1.6.4-py3-non-any.whl # here is the wheel file name, you can change it to your version
📝 Documentation
- For more detailed usage information, visit the Usage guide.
- Advanced Usage, visit the Advanced
- Some questions, visit the Questions
- Difference with Stata-MCP@hanlulong, visit the Difference
💡 Questions
- Cherry Studio 32000 wrong
- Cherry Studio 32000 error
- Windows Support
- Network Errors When Running Stata-MCP
🚀 Roadmap
- macOS support
- Windows support
- Additional LLM integrations
- Performance optimizations
⚠️ Disclaimer
This project is for research purposes only. I am not responsible for any damage caused by this project. Please ensure you have proper licensing to use Stata.
For more information, refer to the Statement.
🐛 Report Issues
If you encounter any bugs or have feature requests, please open an issue.
📄 License
📚 Citation
If you use Stata-MCP in your research, please cite this repository using one of the following formats:
BibTeX
@software{sepinetam2025stata,
author = {Song Tan},
title = {Stata-MCP: Let LLM help you achieve your regression analysis with Stata},
year = {2025},
url = {https://github.com/sepinetam/stata-mcp},
version = {1.6.4}
}
APA
Song Tan. (2025). Stata-MCP: Let LLM help you achieve your regression analysis with Stata (Version 1.6.4) [Computer software]. https://github.com/sepinetam/stata-mcp
Chicago
Song Tan. 2025. "Stata-MCP: Let LLM help you achieve your regression analysis with Stata." Version 1.6.4. https://github.com/sepinetam/stata-mcp.
📬 Contact
Email: sepinetam@gmail.com
Or contribute directly by submitting a Pull Request! We welcome contributions of all kinds, from bug fixes to new features.
❤️ Acknowledgements
The author sincerely thanks the Stata official team for their support and the Stata License for authorizing the test development.
✨ Star History
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stata_mcp-1.7.0.tar.gz.
File metadata
- Download URL: stata_mcp-1.7.0.tar.gz
- Upload date:
- Size: 2.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6bb4f05f69e4e7a224b632e5ecb748f8b7eaa00b91b02e894935f9f4b9f3f962
|
|
| MD5 |
a0d630be2cb539822443078bee222173
|
|
| BLAKE2b-256 |
7bb75611bdfb4f2edcf30f1541ba6c2d0263a44128001fb18aca00de131165e0
|
File details
Details for the file stata_mcp-1.7.0-py3-none-any.whl.
File metadata
- Download URL: stata_mcp-1.7.0-py3-none-any.whl
- Upload date:
- Size: 72.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
897ba6a06ef3f8708dbbc75a637c4a4ef655bab0e6499e6143baa3be8870bcdd
|
|
| MD5 |
fedca87cdd8542cf1e47194beb44e34b
|
|
| BLAKE2b-256 |
1fdfe953c9403e83336e021aa217334829eddb822a905a6668b27f4da832fc6b
|