{"id":29114096,"url":"https://github.com/sepinetam/stata-mcp","last_synced_at":"2026-05-03T21:02:33.141Z","repository":{"id":285342351,"uuid":"956330003","full_name":"SepineTam/stata-mcp","owner":"SepineTam","description":"Let LLM help you achieve your regression with Stata. Evolve from reg monkey to causal thinker.","archived":false,"fork":false,"pushed_at":"2026-03-30T12:01:50.000Z","size":7300,"stargazers_count":127,"open_issues_count":0,"forks_count":20,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-02T02:42:00.187Z","etag":null,"topics":["ai-coding","econometrics","empirical","empirical-research","llm","mcp","social-science","social-science-research","stata","statistical-analysis"],"latest_commit_sha":null,"homepage":"https://www.statamcp.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SepineTam.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-28T04:27:09.000Z","updated_at":"2026-04-02T02:17:25.000Z","dependencies_parsed_at":"2025-03-31T07:26:22.265Z","dependency_job_id":"d7e4b230-c7cd-48a9-a0b4-246399e53e3f","html_url":"https://github.com/SepineTam/stata-mcp","commit_stats":null,"previous_names":["sepinetam/stata-mcp"],"tags_count":81,"template":false,"template_full_name":null,"purl":"pkg:github/SepineTam/stata-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SepineTam%2Fstata-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SepineTam%2Fstata-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SepineTam%2Fstata-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SepineTam%2Fstata-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SepineTam","download_url":"https://codeload.github.com/SepineTam/stata-mcp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SepineTam%2Fstata-mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31471468,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-06T08:36:52.050Z","status":"ssl_error","status_checked_at":"2026-04-06T08:36:51.267Z","response_time":112,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-coding","econometrics","empirical","empirical-research","llm","mcp","social-science","social-science-research","stata","statistical-analysis"],"created_at":"2025-06-29T11:06:05.340Z","updated_at":"2026-05-03T21:02:32.938Z","avatar_url":"https://github.com/SepineTam.png","language":"Python","funding_links":[],"categories":["Data Science Tools"],"sub_categories":["How to Submit"],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003ca href=\"https://www.statamcp.com\"\u003e\n    \u003cimg src=\"https://example-data.statamcp.com/logo_with_name.jpg\" alt=\"logo\" width=\"300\"/\u003e\n  \u003c/a\u003e\n\u003c/h1\u003e\n\n\u003ch1 align=\"center\"\u003eStata-MCP\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e \n    Let LLM help you achieve your regression analysis with Stata ✨ \u003cbr\u003e\n    Evolve from reg monkey to causal thinker 🐒 -\u003e 🧐\n\u003c/p\u003e\n\n[![en](https://img.shields.io/badge/lang-English-red.svg)](README.md)\n[![cn](https://img.shields.io/badge/语言-中文-yellow.svg)](source/docs/README/cn/README.md)\n[![Publish to PyPI](https://github.com/SepineTam/stata-mcp/actions/workflows/python-package.yml/badge.svg)](https://github.com/SepineTam/stata-mcp/actions/workflows/python-package.yml)\n[![Build and Push Docker Images](https://github.com/SepineTam/stata-mcp/actions/workflows/docker-publish.yml/badge.svg)](https://github.com/SepineTam/stata-mcp/actions/workflows/docker-publish.yml)\n[![PyPI version](https://img.shields.io/pypi/v/stata-mcp.svg)](https://pypi.org/project/stata-mcp/)\n[![PyPI Downloads](https://static.pepy.tech/badge/stata-mcp)](https://pepy.tech/projects/stata-mcp)\n[![License: AGPL 3.0](https://img.shields.io/badge/License-AGPL%203.0-blue.svg)](LICENSE)\n[![Issue](https://img.shields.io/badge/Issue-report-green.svg)](https://github.com/sepinetam/stata-mcp/issues/new)\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/SepineTam/stata-mcp)\n\n\u003c!-- mcp-name: io.github.SepineTam/stata-mcp --\u003e\n\n---\n**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.\n\n**Notes**: 尽管我们希望尽可能让所有人都能从开源中获益，但我们很遗憾地宣布无法继续保持 Apache-2.0 License。由于有人直接抄袭本项目并标榜其为项目维护者，我们不得不将 License 更改为 AGPL-3.0，以防止有人滥用本项目进行违背项目初心的事情。\n\n\u003cdetails\u003e\n\u003csummary\u003eReason\u003c/summary\u003e\n\n**Background**: @jackdark425's [repository](https://github.com/jackdark425/aigroup-stata-mcp) directly copied this project and claimed to be the sole maintainer. We welcome open source collaboration based on forks, including but not limited to adding new features, fixing existing bugs, or providing valuable suggestions for the project, but we firmly oppose plagiarism and false attribution.\n\n**Update**: The infringing project has been taken down via GitHub DMCA. Click [here](https://github.com/github/dmca/blob/master/2025/12/2025-12-30-stata-mcp.md) to learn about.\n\n**背景**: @jackdark425 的[仓库](https://github.com/jackdark425/aigroup-stata-mcp)直接抄袭了本项目并标榜为项目唯一维护者。我们欢迎基于fork的开源协作，包括但不限于添加新的feature、修改已有bug或对项目提出您宝贵的意见，但坚决反对抄袭和虚假署名行为。\n\n**更新**: 侵权项目已通过GitHub DMCA被takedown，点击[这里](https://github.com/github/dmca/blob/master/2025/12/2025-12-30-stata-mcp.md)查看详情。\n\n\u003c/details\u003e\n\n---\n**News**:\n- 🦞 **OpenClaw Support**: Standalone CLI tools for OpenClaw integration (`stata-mcp tool`), see [OpenClaw guide](https://docs.statamcp.com/agents/openclaw.md)\n- ✨ **Claude Code Plugin Support**: Official plugin package with MCP server and Stata LSP integration\n- Use Stata-MCP in Claude Code, look [here](#use-stata-mcp-in-claude-code)\n\n\u003e Finding our **newest research**? Click [here](source/reports/README.md) or visit [reports website](https://www.statamcp.com/reports).\n\n\u003cdetails\u003e\n\u003csummary\u003eLooking for others?\u003c/summary\u003e\n\n\u003e **MCP or AI about Stata**\n\u003e - A session based MCP server for Stata, [mcp-stata](https://github.com/tmonk/mcp-stata)\n\u003e - A VScode or Cursor integrated [here](https://github.com/hanlulong/stata-mcp). Confused it? 💡 [Difference](source/docs/Difference.md)\n\u003e \n\u003e **Datasets and Informations**  \n\u003e - [STOP Dataset](https://opendata.ai4cssci.com): StataMCP-Team Opendata Project 📊, we have open-sourced a comprehensive dataset collection for social science research, aiming to enable the future of AI-driven and data-powered research paradigms.  \n\u003e - [Trace DID](https://github.com/asjadnaqvi/DiD): If you want to fetch the newest information about DID (Difference-in-Difference), click [here](https://asjadnaqvi.github.io/DiD/). Now there is a Chinese translation by [Sepine Tam](https://github.com/sepine) and [StataMCP-Team](https://github.com/statamcp-team) 🎉\n\u003e - Jupyter Lab Usage (Important: Stata 17+) [here](source/docs/JupyterStata.md) and [nbstata](https://github.com/hugetim/nbstata)\n\u003c/details\u003e\n\n## 💡 Quickly Start\n### Use Stata-MCP in Claude Code\nWe can use Stata-MCP in Claude Code as its prefect agentic ability. \n\nBefore using it, please make sure you have ever install `Claude Code`, if you don't know how to install it, visit on [GitHub](https://github.com/anthropics/claude-code)\n\nGenerally, you can install Stata-MCP globally for one time, you can run:\n```bash\nclaude mcp add stata-mcp --scope user -- uvx stata-mcp\n```\n\nThen, you do not need to watch it again. \n\nIf you want to install it locally only for the certain workspace, you can open your terminal and `cd` to your working directory, and run:\n```bash\nclaude mcp add stata-mcp --env STATA_MCP_CWD=$(pwd) --scope local -- uvx --directory $(pwd) stata-mcp\n```\n\nIt would nothing happen, you can type `claude` and type `/mcp` to find the status. \n\nIf you are collaborating with others, you can use project scope for that, with:\n```bash\nclaude mcp add stata-mcp --scope project -- uvx stata-mcp\n```\nIn your working directory, you can find a file named `.mcp.json`, your mcp config will be placed here. \n\nThen, you can use Stata-MCP in Claude Code. Here are some scenarios for using it:\n\n- **Paper Replication**: Replicate empirical studies from economics papers\n- **Quick Hypothesis Testing**: Validate economic hypotheses through regression analysis\n- **Stata Learning Assistant**: Learn econometrics with step-by-step Stata explanations\n- **Code Organization**: Review and optimize existing Stata do-files\n- **Result Interpretation**: Understand complex statistical outputs and regression results\n\n### Install Claude Code Plugin\nWe provide official native plugin, integrating [Stata-MCP](https://github.com/sepinetam/stata-mcp) maintained by @sepinetam and [Stata LSP](https://github.com/euglevi/stata-language-server) maintained by @euglevi. Installation commands:\n```bash\n# Install stata-mcp marketplace first\nclaude plugin marketplace add sepinetam/stata-mcp\n\n# Install plugin to local, project or user scope\nclaude plugin install stata-toolbox -s local\n```\n\n### Agent Mode\nThe details of agent mode find [here](source/agent_examples/README.md).\n\n```bash\ngit clone https://github.com/sepinetam/stata-mcp.git\ncd stata-mcp\n\nuv sync\nuv pip install -e .\n\nstata-mcp --version  # for test whether stata-mcp is installed successfully.\nstata-mcp agent run  # now you can enjoy your stata-mcp agent mode.\n```\n\nor you can directly use it with `uvx`:\n```bash\nuvx stata-mcp --version  # for test whether it could be used on your computer.\nuvx stata-mcp agent run\n```\n\nYou can edit the task in `agent_examples/openai/main.py` for variable `[model_instructions](source/agent_examples/openai/main.py#L37)` and `[task_message](source/agent_examples/openai/main.py#L68)`\n\n### Agent as Tool\nIf you want to use a Stata-Agent in another agent, [here](source/docs/Usages/agent_as/agent_as_tool.md) is a simple example:\n\n```python\nimport asyncio\n\nfrom agents import Agent, Runner\nfrom stata_mcp.agent_as.agent_as_tool import StataAgent\n\n# init stata agent and set as tool\nstata_agent = StataAgent()\nsa_tool = stata_agent.as_tool()\n\n# Create main Agent\nagent = Agent(\n    name=\"Assistant\",\n    instructions=\"You are a helpful assistant\",\n    tools=[sa_tool],\n)\n\n\n# Then run the agent as usual.\nasync def main(task: str, max_turns: int = 30):\n    result = await Runner.run(agent, input=task, max_turns=max_turns)\n    return result\n\n\nif __name__ == \"__main__\":\n    econ_task = \"Use Stata default data to find out the relationship between mpg and price.\"\n    asyncio.run(main(econ_task))\n\n```\n\n\n### AI Chat-Bot Client Mode\n\u003e Standard config requires: please make sure the stata is installed at the default path, and the stata cli (for macOS and Linux) exists.\n\nThe standard config json as follows, you can DIY your config via add envs.\n```json\n{\n  \"mcpServers\": {\n    \"stata-mcp\": {\n      \"command\": \"uvx\",\n      \"args\": [\n        \"stata-mcp\"\n      ]\n    }\n  }\n}\n```\n\nFor more detailed usage information, visit the [Usage guide](source/docs/Usages/Usage.md). \n\nAnd some advanced usage, visit the [Advanced guide](source/docs/Usages/Advanced.md)\n\n### Prerequisites\n- [uv](https://github.com/astral-sh/uv) - Package installer and virtual environment manager\n- Claude, Cline, ChatWise, or other LLM service\n- Stata License\n- Your API-KEY from LLM\n\n\u003e Notes:\n\u003e 1. If you are located in China, a short uv usage document you can find [here](source/docs/ChinaUsers/uv.md).\n\u003e 2. 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](https://statamcp.com/reports/2025/09/21/stata_mcp_a_research_report_on_ai_assisted_empirical_research).\n\n### Installation\nFor 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.\n```bash\nuvx stata-mcp doctor\nuvx stata-mcp --version\n```\n\nIf you want to use it locally, you can install it via pip or download the source code.\n\n**Download via pip**\n```bash\npip install stata-mcp\n```\n\n**Download source code and compile**\n```bash\ngit clone https://github.com/sepinetam/stata-mcp.git\ncd stata-mcp\n\nuv build\n```\nThen you can find the compiled `stata-mcp` binary in the `dist` directory. You can use it directly or add it to your PATH.\n\nFor example:\n```bash\nuvx /path/to/your/whl/stata_mcp-1.13.0-py3-non-any.whl  # here is the wheel file name, you can change it to your version\n```\n\n## 📝 Documentation\n\n### Core Documentation\n- **[Complete Documentation](https://docs.statamcp.com/)**: Full documentation site with all features\n- **[Configuration Guide](https://docs.statamcp.com/configuration)**: Unified TOML-based configuration system\n- **[Security Guard](https://docs.statamcp.com/security)**: Security validation for dangerous commands\n- **[Monitoring System](https://docs.statamcp.com/monitoring)**: RAM monitoring and resource limits\n- **[Architecture Overview](https://docs.statamcp.com/overview)**: System design and integration patterns\n\n### Usage Guides\n- For more detailed usage information, visit the [Usage guide](source/docs/Usages/Usage.md)\n- Advanced Usage, visit the [Advanced](source/docs/Usages/Advanced.md)\n- Some questions, visit the [Questions](source/docs/Usages/Questions.md)\n- Difference with [Stata-MCP@hanlulong](https://github.com/hanlulong/stata-mcp), visit the [Difference](source/docs/Difference.md)\n\n### Key Features\n- **[Security Guard](https://docs.statamcp.com/security)**: Blocks dangerous commands (`!`, `shell`, `erase`, etc.)\n- **[RAM Monitoring](https://docs.statamcp.com/monitoring)**: Prevents memory exhaustion with configurable limits\n- **[Unified Configuration](https://docs.statamcp.com/configuration)**: TOML config + environment variables\n- Cross-platform support (macOS, Windows, Linux)\n- Automatic log capture and error reporting\n\n## 💡 Questions\n- [Cherry Studio 32000 wrong](source/docs/Usages/Questions.md#cherry-studio-32000-wrong)\n- [Cherry Studio 32000 error](source/docs/Usages/Questions.md#cherry-studio-32000-error)\n- [Windows Support](source/docs/Usages/Questions.md#windows-supports)\n- [Network Errors When Running Stata-MCP](source/docs/Usages/Questions.md#network-errors-when-running-stata-mcp)\n\n## 🚀 Roadmap\n- [x] macOS support\n- [x] Windows support\n- [ ] Additional LLM integrations (With a new webUI)\n- [ ] Performance optimizations (Via prompt and context engineering)\n\nFor more information, refer to the [Statement](source/docs/Rights/Statement.md).\n\n## 🐛 Report Issues\nIf you encounter any bugs or have feature requests, please [open an issue](https://github.com/sepinetam/stata-mcp/issues/new).\n\n## 📄 License\n[GNU Affero General Public License v3.0](LICENSE)\n\n## 📚 Citation\nIf you use Stata-MCP in your research, please cite this repository using one of the following formats:\n\n### BibTeX\n```bibtex\n@software{sepinetam2025stata,\n  author = {Song Tan},\n  title = {Stata-MCP: Let LLM help you achieve your regression analysis with Stata},\n  year = {2025},\n  url = {https://github.com/sepinetam/stata-mcp},\n  version = {1.13.0}\n}\n```\n\n### APA\n```\nSong Tan. (2025). Stata-MCP: Let LLM help you achieve your regression analysis with Stata (Version 1.13.0) [Computer software]. https://github.com/sepinetam/stata-mcp\n```\n\n### Chicago\n```\nSong Tan. 2025. \"Stata-MCP: Let LLM help you achieve your regression analysis with Stata.\" Version 1.13.0. https://github.com/sepinetam/stata-mcp.\n```\n\n## 📬 Contact\nEmail: [sepinetam@gmail.com](mailto:sepinetam@gmail.com)\n\nOr contribute directly by submitting a [Pull Request](https://github.com/sepinetam/stata-mcp/pulls)! We welcome contributions of all kinds, from bug fixes to new features.\n\n## ❤️ Acknowledgements\nThe author sincerely thanks the Stata official team for their support and the Stata License for authorizing the test development.\n\n## 📃 Statement\nThe Stata referred to in this project is the commercial software Stata developed by [StataCorp LLC](https://www.stata.com/company/). This project is not affiliated with, endorsed by, or sponsored by StataCorp LLC. This project does not include the Stata software or any installation packages; users must obtain and install a validly licensed copy of Stata from StataCorp. This project is licensed under [AGPL-3.0](LICENSE). The project maintainers accept no liability for any loss or damage arising from the use of this project or from actions related to Stata.\n\nMore information: refer to the Chinese version at [source/docs/README/cn/README.md]; in case of any conflict, the Chinese version shall prevail.\n\n## ✨ Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=sepinetam/stata-mcp\u0026type=Date)](https://www.star-history.com/#sepinetam/stata-mcp\u0026Date)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsepinetam%2Fstata-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsepinetam%2Fstata-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsepinetam%2Fstata-mcp/lists"}