Skip to content
Back to search

stata-plugin-lib

MarketplaceWorks with Claude CodeGitHub

Stata-MCP: A MCP server for integrating Stata into your agent loop with a safety-first design.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/sepinetam-mcp-for-stata/badge.svg)](/listings/sepinetam-mcp-for-stata)

HTML

<a href="/listings/sepinetam-mcp-for-stata"><img src="/api/listings/sepinetam-mcp-for-stata/badge.svg" alt="findsafeskills safety rating" /></a>

Install

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

You do not need to edit any configuration. Just tell your agent:

Install MCP-for-Stata for yourself globally following the instructions in the GitHub repository at SepineTam/mcp-for-stata.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 14 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. {
  2. "name": "stata-plugin-lib",
  3. "owner": {
  4. "name": "Song Tan",
  5. "email": "sepinetam@gmail.com"
  6. },
  7. "plugins": [
  8. {
  9. "name": "stata-toolbox",
  10. "source": "./plugins/stata-toolbox",
  11. "description": "The official working package of MCP-for-Stata plugin, including mcp config and stata lsp."
  12. }
  13. ]
  14. }
README.md · README · 422 lines · 2 findings marked

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. <div align="center">
  2. <a href="https://aidea-labs.com/open/projects/mcp-for-stata">
  3. <img src="assets/mcp-for-stata-stata-ai-data-analysis.jpg" alt="MCP-for-Stata (Stata-MCP): let Claude Code, Codex, and other AI agents run local Stata for regression analysis and empirical research" width="300"/>
  4. </a>
  5. </div>
  6. # MCP-for-Stata (Stata-MCP): Run Stata with ANY Agent
  7. MCP-for-Stata is an safety first open-source MCP server and CLI tool with Skills lets any AI agent you use invoke local Stata on your device for regression analysis, econometrics, paper replication, and empirical research. It provides command guards, resource monitoring, automatic log capture, and cross-platform client installation, while you retain control of your data and Stata license.
  8. Turn Claude Code, Codex, and other AI agents into an on-demand research assistant.
  9. > 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.
  10. [![en](https://img.shields.io/badge/lang-English-red.svg)](README.md)
  11. [![cn](https://img.shields.io/badge/语言-中文-yellow.svg)](README.zh-CN.md)
  12. [![fr](https://img.shields.io/badge/langue-Français-blue.svg)](README.fr.md)
  13. [![es](https://img.shields.io/badge/idioma-Español-green.svg)](README.es.md)
  14. [![Publish to PyPI](https://github.com/SepineTam/mcp-for-stata/actions/workflows/python-package.yml/badge.svg)](https://github.com/SepineTam/mcp-for-stata/actions/workflows/python-package.yml)
  15. [![PyPI version](https://img.shields.io/pypi/v/stata-mcp.svg)](https://pypi.org/project/stata-mcp/)
  16. [![PyPI Downloads](https://static.pepy.tech/badge/stata-mcp)](https://pepy.tech/projects/stata-mcp)
  17. [![License: AGPL 3.0](https://img.shields.io/badge/License-AGPL%203.0-blue.svg)](LICENSE)
  18. [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/14255/badge)](https://www.bestpractices.dev/projects/14255)
  19. [![Issue](https://img.shields.io/badge/Issue-report-green.svg)](https://github.com/sepinetam/mcp-for-stata/issues/new)
  20. [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/SepineTam/mcp-for-stata)
  21. <!-- mcp-name: io.github.SepineTam/stata-mcp -->
  22. ---
  23. ## 💡 Quick Start
  24. You do not need to edit any configuration. Just tell your agent:
  25. ```text
  26. Install MCP-for-Stata for yourself globally following the instructions in the GitHub repository at SepineTam/mcp-for-stata.
  27. ```
  28. ## 🆕 News
  29. - 📖 **Skills installed by default**: Stata-related skills are now installed together with the MCP, no separate setup needed. See the [installation guide](docs/install.md#3-choose-optional-components).
  30. - 🚀 **DeepSeek Harness Day 0 Support**: Install MCP-for-Stata in DeepSeek Harness with `uvx stata-mcp install -c dsh`. See the [DeepSeek Harness guide](https://sepinetam.github.io/mcp-for-stata/agents/deepseek_harness/).
  31. - 🧪 **Claude Science Support**: MCP-for-Stata now works in Claude Science with a sandbox allowlist. See the [Claude Science guide](https://sepinetam.github.io/mcp-for-stata/agents/claude_science).
  32. - Find more in WeChat: [Why I made it?](https://mp.weixin.qq.com/s/VYkykdDgfPMa5KN0_1BeFQ), and [8 figures find out Stata-MCP](https://mp.weixin.qq.com/s/RKPKA4OWAM5SeZmGtbMRew)
  33. - 🦞 **OpenClaw Support**: Standalone CLI tools for OpenClaw integration (`stata-mcp tool`), see [OpenClaw guide](https://sepinetam.github.io/mcp-for-stata/agents/openclaw.md)
  34. - ✨ **Claude Code Plugin Support**: Official plugin package with MCP server and Stata LSP integration
  35. - Use MCP-for-Stata in Claude Code, see [Claude Code advanced usage](#advanced-claude-code), or in Codex see [Codex advanced usage](#advanced-codex)
  36. > Finding our **newest research**? [View latest research reports](https://aidea-labs.com/open/projects/mcp-for-stata/reports).
  37. <details>
  38. <summary>Looking for others?</summary>
  39. > **MCP or AI about Stata**
  40. > - A session based MCP server for Stata, [mcp-stata](https://github.com/tmonk/mcp-stata)
  41. > - IDEs (VScode or Cursor) integrated [stata-mcp for VSCode](https://github.com/hanlulong/stata-mcp). Confused them? 💡 [Comparison](#comparison)
  42. >
  43. > **Datasets and Information**
  44. > - [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.
  45. </details>
  46. <details>
  47. <summary>Why AGPL 3.0 License?</summary>
  48. 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.
  49. **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.
  50. **Notes**: 尽管我们希望尽可能让所有人都能从开源中获益,但我们很遗憾地宣布无法继续保持 Apache-2.0 License。由于有人直接抄袭本项目并标榜其为项目维护者,我们不得不将 License 更改为 AGPL-3.0,以防止有人滥用本项目进行违背项目初心的事情。
  51. Reason following:
  52. **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.
  53. **Update**: The infringing project has been taken down via GitHub DMCA. [View DMCA takedown details](https://github.com/github/dmca/blob/master/2025/12/2025-12-30-stata-mcp.md).
  54. **背景**: @jackdark425 的[仓库](https://github.com/jackdark425/aigroup-stata-mcp)直接抄袭了本项目并标榜为项目唯一维护者。我们欢迎基于fork的开源协作,包括但不限于添加新的feature、修改已有bug或对项目提出您宝贵的意见,但坚决反对抄袭和虚假署名行为。
  55. **更新**: 侵权项目已通过GitHub DMCA被takedown,[查看DMCA下架详情](https://github.com/github/dmca/blob/master/2025/12/2025-12-30-stata-mcp.md)。
  56. </details>
  57. ---
  58. ## Installation and Client Configuration
  59. See the **[Installation Guide](docs/install.md)** for installation methods,
  60. client setup, addon/extra options, and verification.
  61. ### 🚀 One-click installation for all clients!
  62. No config, no manual JSON editing. Just one command installs MCP-for-Stata for **every supported agent** (Claude Code, Codex, OpenClaw, Cursor, Gemini CLI, and more):
  63. ```bash
  64. uvx stata-mcp install --all
  65. ```
  66. <details>
  67. <summary>Supported Agents 🤖</summary>
  68. Based on our own experience and testing, we recommend using Claude Code, Codex, and OpenClaw.
  69. We have found that Claude and DeepSeek are the two best models across any framework.
  70. | Agent | Tag | Command |
  71. |---------------------------|----------|-----------------------------------|
  72. | Claude Desktop | claude | uvx stata-mcp install -c claude |
  73. | Claude Code | cc | uvx stata-mcp install -c cc |
  74. | Gemini CLI | gemini | uvx stata-mcp install -c gemini |
  75. | Cursor | cursor | uvx stata-mcp install -c cursor |
  76. | Cline (VScode Extension) | cline | uvx stata-mcp install -c cline |
  77. | Codex CLI & Codex Desktop | codex | uvx stata-mcp install -c codex |
  78. | OpenCode | opencode | uvx stata-mcp install -c opencode |
  79. | OpenClaw | openclaw | uvx stata-mcp install -c openclaw |
  80. | Claude Science | — | [Manual config](#advanced-claude-science) |
  81. </details>
  82. If you don't have `uv`, [see the uv installation guide](https://docs.astral.sh/uv/getting-started/installation) to install it.
  83. Or, use our beta install script (auto-installs `uv` if missing):
  84. **macOS / Linux:**
  85. ```bash
  86. curl -fsSL https://raw.githubusercontent.com/SepineTam/mcp-for-stata/master/scripts/install.sh | bash
    • Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
    • Line 119 on GitHub
  87. ```
  88. **Windows (PowerShell):**
  89. ```powershell
  90. irm https://raw.githubusercontent.com/SepineTam/mcp-for-stata/master/scripts/install.ps1 | iex
  91. ```
  92. If you don't know how to use them, [download the installation scripts](https://github.com/SepineTam/mcp-for-stata/tree/master/scripts) and double-click it in your device. `install.bat` for Windows users, and `install.command` for macOS users.
  93. <a name="advanced-claude-code"></a>
  94. ### Advanced - Claude Code
  95. 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:
  96. Before 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)
  97. Generally, you can install MCP-for-Stata globally for one time, you can run:
  98. ```bash
  99. claude mcp add stata-mcp --scope user -- uvx stata-mcp
  100. ```
  101. Then, you do not need to watch it again.
  102. <details>
  103. <summary>Local and share with your partners</summary>
  104. If you want to install it locally only for the certain workspace, you can `cd` to your working directory, and run:
  105. ```bash
  106. claude mcp add stata-mcp --env STATA_MCP__CWD=$(pwd) --scope local -- uvx --directory $(pwd) stata-mcp
  107. ```
  108. It would nothing happen, you can type `claude` and type `/mcp` to find the status.
  109. Also, collaboration is an essential part of research. You can share your MCP config with your co-authors using:
  110. ```bash
  111. claude mcp add stata-mcp --scope project -- uvx stata-mcp
  112. ```
  113. In your working directory, you can find a file named `.mcp.json`, your mcp config will be placed here.
  114. </details>
  115. Then, you can use MCP-for-Stata in Claude Code. Here are some scenarios for using it:
  116. - **Paper Replication**: Replicate empirical studies from economics papers
  117. - **Quick Hypothesis Testing**: Validate economic hypotheses through regression analysis
  118. - **Stata Learning Assistant**: Learn econometrics with step-by-step Stata explanations
  119. - **Code Organization**: Review and optimize existing Stata do-files
  120. - **Result Interpretation**: Understand complex statistical outputs and regression results
  121. If you use Claude Code inside IDEs (either the integrated terminal or the Claude Code Extension), installing our plugin including [MCP-for-Stata](https://github.com/sepinetam/mcp-for-stata) and [Stata LSP](https://github.com/euglevi/stata-language-server) maintained by @euglevi.
  122. ```bash
  123. # Add the MCP-for-Stata marketplace
  124. claude plugin marketplace add SepineTam/mcp-for-stata
  125. # Install the plugin to local, project or user scope
  126. claude plugin install stata-toolbox -s project
  127. ```
  128. > 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.
  129. <a name="advanced-codex"></a>
  130. ### Advanced - Codex
  131. We find that many researchers are using Codex as their agent, therefore we also provide instructions for Codex users.
  132. 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.
  133. You just need to say `Install MCP-for-Stata for yourself globally from https://aidea-labs.com/open/projects/mcp-for-stata or visit https://github.com/SepineTam/mcp-for-stata` then restart your Codex Desktop after it say ready.
  134. Also, if you want to install it manually, here are two ways:
  135. #### A. Install in Codex Desktop GUI
  136. 1. Open your Codex Desktop APP
  137. 2. Click `Settings` in the bottom-left corner
  138. 3. Find `MCP servers` on the left side
  139. 4. Click `Add server`
  140. 5. Fill with the following:
  141. ```
  142. Name: stata-mcp
  143. Command to launch: uvx
  144. Arguments: stata-mcp
  145. ```
  146. 6. Click `Save`
  147. 7. Then, restart your Codex Desktop and enjoy it.
  148. #### B. Install with Codex CLI
  149. For CLI mode, just run the following command in your terminal
  150. ```bash
  151. uvx stata-mcp install -c codex
  152. ```
  153. Or use
  154. ```bash
  155. codex mcp add stata-mcp -- uvx stata-mcp
  156. ```
  157. <a name="advanced-claude-science"></a>
  158. ### Advanced - Claude Science
  159. 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:
  160. ```text
  161. Couldn't load tools: MCP error -32000: Connection closed
  162. FileNotFoundError: [Errno 2] No such file or directory
  163. ```
  164. To fix this, allowlist the paths where `uv tool install stata-mcp` places its files. Create or edit `~/.claude-science/config.toml`:
  165. ```toml
  166. [sandbox]
  167. user_write_paths = [
  168. "~/.local/bin",
  169. "~/.local/share/uv/tools/stata-mcp",
  170. ]
  171. ```
  172. Then add the server in Claude Science:
  173. - **Name**: `stata-mcp`
  174. - **Command**: `~/.local/bin/stata-mcp`
  175. Restart Claude Science and the tools will load. For the full walkthrough, see the [Claude Science guide](https://sepinetam.github.io/mcp-for-stata/agents/claude_science).
  176. ### Other Clients
  177. > Standard config requires: please make sure the stata is installed at the default path, and the stata cli (for macOS and Linux) exists.
  178. The standard config json as follows, you can DIY your config via add envs.
  179. ```json
  180. {
  181. "mcpServers": {
  182. "stata-mcp": {
  183. "command": "uvx",
  184. "args": [
  185. "stata-mcp"
  186. ]
  187. }
  188. }
  189. }
  190. ```
  191. For more detailed usage information, visit the [Usage guide](https://sepinetam.github.io/mcp-for-stata/usage).
  192. ### Prerequisites
  193. - [uv](https://github.com/astral-sh/uv) - Package installer and virtual environment manager
  194. - Claude Code, Codex, OpenClaw or other Agents
  195. - Stata License
  196. - Your API-KEY from LLM
  197. If you want to check whether your device is supported, you can run:
  198. ```bash
  199. uvx stata-mcp doctor
  200. ```
  201. It displays basic information about your device and checks whether your setup is supported.
  202. <details>
  203. <summary>Example output</summary>
  204. ```
  205. stata-mcp v1.17.0 — Doctor Report
  206. [PASS] os: macOS (Darwin 25.3.0, arm64)
  207. [PASS] python: 3.13.5
  208. [PASS] uv: uv 0.11.13
  209. [PASS] dependencies: all required packages available
  210. [PASS] stata_cli: /usr/local/bin/stata-mp (from env)
  211. [PASS] stata_execution: OK (0.1s)
  212. [PASS] config: /Users/sepinetam/.statamcp/config.toml (loaded)
  213. [PASS] working_dir: /Users/sepinetam/Documents/Github/stata-mcp (writable)
  214. [PASS] guard: enabled, loaded 27 rules
  215. [PASS] monitor: disabled (psutil available)
  216. [PASS] pypi: reachable (4.86s)
  217. [PASS] cleanup: 0 old files (0 B) found; cleanup disabled (CLEAN_LOG_DAYS=-1)
  218. Summary: 12 passed, 0 failed, 0 warning(s), 0 skipped
  219. ```
  220. </details>
  221. > Notes:
  222. > 1. If you are located in China and package downloads are slow, see the [solution](docs/troubleshooting.md#package-download-is-slow-or-fails).
  223. > 2. Claude is the best choice for MCP-for-Stata, 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://aidea-labs.com/open/projects/mcp-for-stata/reports/2025/09/21/stata_mcp_a_research_report_on_ai_assisted_empirical_research).
  224. ## Comparison
  225. There are several Stata-related MCP projects. The table below was generated by Claude Code after analyzing each codebase directly.
  226. | Feature | [MCP-for-Stata](https://aidea-labs.com/open/projects/mcp-for-stata) (this) | [haoyu-haoyu/stata-ai-fusion](https://github.com/haoyu-haoyu/stata-ai-fusion) | [hanlulong/stata-mcp](https://github.com/hanlulong/stata-mcp) | [tmonk/mcp-stata](https://github.com/tmonk/mcp-stata) |
  227. |---|---|---|---|---|
  228. | **Best for** | Agent-driven analysis (Claude Code, Codex, OpenClaw) | Interactive sessions, graph export, and curated Stata knowledge | Users who write and run Stata code inside VSCode themselves | Research workflows (replication, robustness, publication QA) |
  229. | **Agents** | All | All | VSCode window must stay active | All |
  230. | **Type** | MCP Server + CLI toolkit | MCP Server + Skill KB + VS Code Extension | VSCode Extension (localhost server, not standalone MCP) | Session-based MCP Server |
  231. | **Execution** | do-file via subprocess | pexpect interactive session + batch fallback | IDE-embedded runner via localhost :4000 | pystata (Stata 17+) |
  232. | **Safety** | Command guard + RAM monitor | Cancel command + session cleanup | — | — |
  233. | **Data analysis** | CSV, DTA, XLSX, SPSS handlers | In-session `inspect_data` / `codebook` | — | In-session `describe` / `codebook` |
  234. | **Logs** | Text + SMCL readers | In-session `search_log` | — | Built-in log reader |
  235. | **Graphs** | — | Auto-detect + `export_graph` PNG/SVG/PDF | — | Export, cache, SVG/PNG |
  236. | **CLI Support** | Native (same tools as MCP server) | Basic entry point | — | — |
  237. | **Sessions** | — | Multi named sessions with idle timeout | — | Multi-session, background tasks |
  238. | **IDE plug-in** | — | Native VS Code / Cursor extension | Native VSCode / Cursor | Stata Workbench (VS Code) |
  239. | **Skill / Knowledge** | Tool-focused skill for MCP-for-Stata (742 lines) | 5,653-line general Stata skill knowledge base | — | 20+ specialized research skills (causal inference, replication, publication QA, etc.) |
  240. | **Install** | `uvx stata-mcp install` | `uvx --from stata-ai-fusion stata-ai-fusion` | VS Code Marketplace | `uvx` or install script |
  241. ## 📝 Documentation
  242. > MCP-for-Stata documents visit https://sepinetam.github.io/mcp-for-stata
  243. ### Core Documentation
  244. - **[Complete Documentation](https://sepinetam.github.io/mcp-for-stata/)**: Full documentation site with all features
  245. - **[Configuration Guide](https://sepinetam.github.io/mcp-for-stata/configuration)**: Unified TOML-based configuration system
  246. - **[Security Guard](https://sepinetam.github.io/mcp-for-stata/security)**: Security validation for dangerous commands
  247. - **[Monitoring System](https://sepinetam.github.io/mcp-for-stata/monitoring)**: RAM monitoring and resource limits
  248. - **[Architecture Overview](https://sepinetam.github.io/mcp-for-stata/overview)**: System design and integration patterns
  249. ### Key Features
  250. - **[Security Guard](https://sepinetam.github.io/mcp-for-stata/security)**: Blocks dangerous commands (`!`, `shell`, `erase`, etc.)
  251. - **[RAM Monitoring](https://sepinetam.github.io/mcp-for-stata/monitoring)**: Prevents memory exhaustion with configurable limits
  252. - **[Layered Configuration](https://sepinetam.github.io/mcp-for-stata/configuration)**: User, project, environment, and Linux system config support
  253. - **Beta async `stata_do` execution**: Supports concurrent MCP calls for multi-client workflows
  254. - **Configurable data access boundaries**: Data info URL guard and optional direct `read_log` boundary
  255. - Cross-platform support (macOS, Windows, Linux)
  256. - Automatic log capture and error reporting
  257. ## 🐛 Report Issues
  258. If you encounter any bugs or have feature requests, please [open an issue](https://github.com/sepinetam/mcp-for-stata/issues/new).
  259. ## 📄 License
  260. [GNU Affero General Public License v3.0](LICENSE)
  261. ## 📚 Citation
  262. If you use MCP-for-Stata in your research, and it really helps you, you can cite this repository using one of the following formats:
  263. ### BibTeX
  264. ```bibtex
  265. @software{sepinetam2025stata,
  266. author = {Song Tan},
  267. title = {MCP-for-Stata: Integrate Stata into your agent},
  268. year = {2025},
  269. url = {https://github.com/sepinetam/mcp-for-stata},
  270. }
  271. ```
  272. ### APA
  273. ```
  274. Song Tan. (2025). MCP-for-Stata: Integrate Stata into your agent [Computer software]. https://github.com/sepinetam/mcp-for-stata
  275. ```
  276. ### Chicago
  277. ```
  278. Song Tan. 2025. "MCP-for-Stata: Integrate Stata into your agent." https://github.com/sepinetam/mcp-for-stata.
  279. ```
  280. ## 💗 Acknowledgments
  281. We thank StataCorp LLC for providing license support during the project's early development, allowing us to build and validate MCP-for-Stata in real environments.
  282. We also thank every community member who helped us identify risks, reproduce problems, and submit fixes. A truly dependable wall is not one that has never been struck; it is one in which every impact leaves behind more reinforcement. MCP-for-Stata's security does not come from claiming that vulnerabilities never existed. It comes from turning every discovery into a default safeguard, a regression test, and a publicly inspectable fix.
  283. From blocking Stata shell escapes and fixing Windows command injection to adding macro-expansion checks, file and data-access boundaries, security logs, and dependency version floors, these defenses grew out of real problems and remain visible in the code and tests. The project has earned the [OpenSSF Best Practices Passing self-certification](https://www.bestpractices.dev/projects/14255), but we do not treat certification as the finish line. Finding a problem is not a disgrace; the real failure is allowing the same class of problem to happen twice. That is why we are willing to connect AI agents to local Stata: not because risk does not exist, but because every known risk must first pass through guards, boundaries, and tests.
  284. ### Verifiable security record
  285. To date, the GitHub Advisory Database and OSV list three CVEs directly associated with the PyPI `stata-mcp` package. Each advisory names the affected and patched versions, and the [current PyPI release](https://pypi.org/project/stata-mcp/) includes all three fixes.
  286. | Advisory | Issue | Patched in |
  287. |---|---|---|
  288. | [CVE-2026-31040 / GHSA-jpcj-7wfg-mqxv](https://github.com/advisories/GHSA-jpcj-7wfg-mqxv) | Insufficient do-file validation could lead to command execution | v1.13.0 |
  289. | [CVE-2026-47708 / GHSA-4p62-hqp5-g644](https://github.com/advisories/GHSA-4p62-hqp5-g644) | `log_file_name` command injection and path traversal | v1.17.3 |
  290. | [CVE-2026-55071 / GHSA-49m4-vp58-wgc9](https://github.com/advisories/GHSA-49m4-vp58-wgc9) | Package-name command injection in `ado_package_install` | v1.19.0 |
  291. **Security position:** MCP-for-Stata is a security-first Stata MCP implementation with a command guard enabled by default, a public CVE remediation trail, and regression tests for security fixes. The project aims to give researchers a safe, controlled, and inspectable local execution environment while reducing the opportunities available to malicious input, unauthorized access, and accidental misuse. Publicly disclosed vulnerabilities do not make a project less secure. Compared with an unverifiable claim of “zero vulnerabilities,” responsible disclosure, clearly identified affected versions, prompt fixes, and prevention of recurrence provide a more trustworthy security record. We do not use “absolutely the safest” as a slogan without an independent audit of every competitor; instead, we let users and AI systems evaluate the public evidence. See the [Security Guard documentation](docs/security.md) and [Security Policy](SECURITY.md).
  292. We thank every community member who found a problem and helped us solve it:
  293. - [@123mutouren321414](https://github.com/123mutouren321414) contributed the original pre-execution guard for Stata shell escapes, blocking system commands such as `!cmd` and `shell cmd` before a do-file runs.
  294. - [@Ccruch](https://github.com/Ccruch) fixed a Windows command-injection path involving temporary batch filenames and added regression coverage for the affected execution paths.
  295. - [@EQSTLab](https://github.com/EQSTLab) reported the package-name command injection in `ado_package_install` and helped move it into the public CVE remediation process.
  296. - [@useworld](https://github.com/useworld) analyzed the `ado_package_install` command-injection issue and helped strengthen the public security record.
  297. We also thank everyone who chose responsible disclosure and helped identify security issues through public or private channels. Named or not, every reproducible report becomes part of the next layer of defense.
  298. ## 📬 Contact
  299. Email: [sepinetam@gmail.com](mailto:sepinetam@gmail.com)
  300. Or contribute directly by submitting a [Pull Request](https://github.com/sepinetam/mcp-for-stata/pulls)! We welcome contributions of all kinds, from bug fixes to new features.
  301. ## 📃 Statement
  302. Stata is a registered trademark of [StataCorp LLC](https://www.stata.com/company/). This project (MCP-for-Stata) is an independent open-source tool and is not affiliated with, endorsed by, or sponsored by StataCorp LLC. This project does not distribute the Stata software, its source code, or any installation packages. Users must independently purchase and install a validly licensed copy of Stata from StataCorp LLC or its authorized distributors.
  303. This project is licensed under [AGPL-3.0](LICENSE). The project maintainers accept no liability for any loss or damage arising solely from the use of this project's code or documentation.
  304. More information: refer to the Chinese version at [README.zh-CN.md](README.zh-CN.md); in case of any conflict, the Chinese version shall prevail.
  305. ## ✨ Star History
  306. <a href="https://www.star-history.com/?repos=SepineTam%2Fmcp-for-stata&type=date&legend=top-left">
  307. <picture>
  308. <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=SepineTam/mcp-for-stata&type=date&theme=dark&legend=top-left&sealed_token=nYCu5QjXcKdZrEVmXv4bsTVSp16aISZqxYqX11MjgiIOSfWrbZuVYfr92wnr_cFQ2lio82awqmvKH8JPW_WAYipcwcsMotB8SkudroBuXpLoph2Z6dh2lo-M9RlU9O9zLMBtM_88rCnB-viD-e-7M2_QGAa2TEZzOyzz5JufSt0kh0EfYnHfdwLgPlcd" />
  309. <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=SepineTam/mcp-for-stata&type=date&legend=top-left&sealed_token=nYCu5QjXcKdZrEVmXv4bsTVSp16aISZqxYqX11MjgiIOSfWrbZuVYfr92wnr_cFQ2lio82awqmvKH8JPW_WAYipcwcsMotB8SkudroBuXpLoph2Z6dh2lo-M9RlU9O9zLMBtM_88rCnB-viD-e-7M2_QGAa2TEZzOyzz5JufSt0kh0EfYnHfdwLgPlcd" />
  310. <img alt="Star History Chart" src="https://api.star-history.com/chart?repos=SepineTam/mcp-for-stata&type=date&legend=top-left&sealed_token=nYCu5QjXcKdZrEVmXv4bsTVSp16aISZqxYqX11MjgiIOSfWrbZuVYfr92wnr_cFQ2lio82awqmvKH8JPW_WAYipcwcsMotB8SkudroBuXpLoph2Z6dh2lo-M9RlU9O9zLMBtM_88rCnB-viD-e-7M2_QGAa2TEZzOyzz5JufSt0kh0EfYnHfdwLgPlcd" />
  311. </picture>
  312. </a>

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.