# Reported issues for stata-mcp

Pod holds 18 of 20 problems reported by people outside the maintainer team. Issues filed by the project's own owners, members and collaborators are excluded entirely — a maintainer's release checklist is not a warning to a prospective user.

Back to [stata-mcp](/mcp/stata-mcp).

## Most discussed

### [ISSUE] StataNow BE on macOS: "Failed to spawn process: No such file or directory"

## AI Model
- [x] Claude

## Issue Description
stata-mcp fails to connect when using StataNow BE on macOS. The MCP server starts successfully but crashes with "Failed to spawn process: No such file or directory" when attempting to execute Stata commands. In Claude Desktop, the server shows "failed" status with "Server disconnected."

## Context
- Stata is accessible from the command line (`which stata` returns `/usr/local/bin/stata`)
- Running `uvx stata-mcp --usable` shows most checks pass, but

[Read the thread](https://github.com/SepineTam/mcp-for-stata/issues/35) · 2026-01-31 · closed · external user · 5 comments

### [ISSUE] Cursor error: No server info found

## 问题描述
如果cursor的mcp.json为
```json
{
  "mcpServers": {
    "stata-mcp": {
      "command": "uvx",
      "args": ["stata-mcp"],
      "env": {
        "stata_cli": "/Applications/StataNow/StataMP.app/Contents/MacOS/stata-mp"
      }
    }
  }
}
```
启动mcp时报错 
```log
[info] Handling ListOfferings action, server stored: false
[error] No server info found
```

## 背景信息
- 运行`uvx stata-mcp --usable`唯一失败项是`Stata CLI (Path: Not found): ❌ FAILED`
- 但已在env中配置stata路径，且确信路径正确、有许可证、能用
- 没有其他开启的插件或mcp

## 已尝试的解

[Read the thread](https://github.com/SepineTam/mcp-for-stata/issues/22) · 2025-12-24 · closed · external user · 4 comments

### [BUG] Could not Create and Read log file

## AI Model
<!-- Please specify which AI model you are using -->
- [ ] ChatGPT
- [x] Claude
- [x] GPT-4
- [x] Other (please specify):  DeepSeek-Chat

## Bug Description
<!-- A clear and concise description of the bug -->

## Steps to Reproduce
<!-- Detailed steps to reproduce the behavior -->
1. As the default config
2. Run the test task (OLS example)
3. Could not read log file <- as did not generate any log file.

## Expected Behavior
<!-- A clear description of what you expected to happen -->

[Read the thread](https://github.com/SepineTam/mcp-for-stata/issues/2) · 2025-05-10 · closed · 4 comments

### [Bug] stata-mcp tool call hangs on the first Claude Code session, but works after interrupting and starting a new conversation

## Self-check
<!-- Please complete the following checks before submitting the issue -->
- [x] I have confirmed that I am using the latest version of stata-mcp. If not, please update first.
- [x] I have run `uvx stata-mcp doctor` to check the environment. If there are any abnormalities, I have attached the output below.
- [x] I have first tried asking an AI assistant (Claude / ChatGPT, etc.) to help analyze and resolve the issue.

## Client / IDE
<!-- Please select the client or IDE you are using

[Read the thread](https://github.com/SepineTam/mcp-for-stata/issues/81) · 2026-05-24 · open · external user · 3 comments

### [BUG] Config Failure (Cherry Studio)

## Config
```json
{
  "mcpServers": {
    "stata-mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "/Users/sepinetam/Documents/Github/MCP_Pro/stata-mcp",
        "run",
        "stata_mcp.py"
      ]
    }
  }
}
```
## Version
Cherry Studio: 1.2.9
Stata-MCP: 1.3.2
macOS 15.4
Stata 17 SE
python 3.11

## Error
Error invoking remote method 'mcp:list-tools':
Error: [MCP] Error activating server MCP 服务器:
Either baseUrl or command must be provided

[Read the thread](https://github.com/SepineTam/mcp-for-stata/issues/1) · 2025-04-28 · closed · 3 comments

### [Bug] 启动 server 时报 ModuleNotFoundError: No module named 'mcp.server.fastmcp'

## 自查步骤
<!-- 在提交 issue 前，请先完成以下检查 -->
- [x] 我已确认使用的是最新版本的 stata-mcp（如不是，请先更新）
- [x] 我已运行 `uvx stata-mcp doctor` 检查环境，如有异常会在下面附上输出
- [x] 我已先尝试让 AI（Claude / ChatGPT 等）帮助分析和解决问题
- [ ] 如果这是安全问题，我会按照 SECURITY.md 中的说明通过邮件私下报告，而不是公开提交 issue

## 使用客户端 / IDE
<!-- 请选择您使用的客户端或 IDE -->
- [ ] Claude Code
- [ ] Codex CLI
- [ ] Cursor
- [ ] GitHub Copilot
- [ ] Claude Desktop
- [ ] OpenClaw
- [ ] Hermes Agent
- [x] 其他 (请说明): OpenCode

## 模型提供商
<!-- 请选择您使用的模型提供商 -->
- [ ] OpenAI (ChatGPT)
- [ ] Anthropic (Claud

[Read the thread](https://github.com/SepineTam/mcp-for-stata/issues/96) · 2026-07-30 · closed · external user · 2 comments

### [Features] Support running do file in an opening Stata GUI and transforming log to html with embedded tables and figures

## 功能描述
<!-- 清晰简洁地描述您想要的功能 -->
1. running do file in an opening Stata GUI 

2. transform log to html with embedded tables and figures

## 解决的问题
saving time for repeating running files. AI Agent might need the feedback of the log step by step. The complicated task can be divided into several do files and running in an openning Stata GUI

Results can be gathered in a nice html file including tables and figures 

## 建议的解决方案
1. running do file in an opening Stata GUI    <= autohotkey for windows; ap

[Read the thread](https://github.com/SepineTam/mcp-for-stata/issues/76) · 2026-05-20 · closed · external user · 2 comments

### [Bug]

## AI 模型
<!-- 请选择您使用的 AI 模型 -->
- [ ] ChatGPT
- [ ] Claude
- [ ] GPT-4
- [ ] 其他模型 (请说明): claude code

## Bug 描述
stata-mcp调用get_data_info不成功是啥原因，它说是因为有字符串变量？难道这个函数天然有缺陷吗？

## 复现步骤
1. Claude code 使用stata-mcp-get_data_info
2. 
3. 

## 预期行为
成功读取到dta文件数据

## 实际行为
无法读取

## 环境信息

- 操作系统: win111
- Stata 版本: stata 18 mp
- 软件包版本: v1.15.0

## 补充信息
<!-- 添加任何其他上下文、错误信息、截图或与问题相关的示例 -->

[Read the thread](https://github.com/SepineTam/mcp-for-stata/issues/62) · 2026-04-14 · closed · external user · 2 comments

## Most recent

### [Security] log_file_name parameter injection in Stata command wrapper

## Summary
The `log_file_name` parameter in `stata_do` API and CLI is directly interpolated into a Stata command string without sanitization. The security guard (`GuardValidator`) only scans the do-file content but does not validate this parameter. An attacker can inject arbitrary Stata commands (including `shell`, `python`, `erase`, etc.) by crafting a malicious `log_file_name` containing quotes, newlines, or Stata command separators.

## Severity
**Critical** - Remote code execution via Stata 

[Read the thread](https://github.com/SepineTam/mcp-for-stata/issues/74) · 2026-05-19 · closed · 0 comments

### [Bug] Failed to update stata-mcp via `stata-mcp update` command

## Self-Check
<!-- Please complete the following checks before submitting -->
- [x] I have confirmed I am using the latest version of stata-mcp (if not, please update first)
- [x] I have run `uvx stata-mcp doctor` to check the environment and will paste the output below if there is any abnormality
- [x] I have tried to get AI (Claude / ChatGPT / etc.) to help analyze and resolve the issue

## Client / IDE
<!-- Please select the client or IDE you are using -->
- [ ] Claude Code
- [ ] Codex CLI
- 

[Read the thread](https://github.com/SepineTam/mcp-for-stata/issues/69) · 2026-04-28 · closed · 1 comment

### [FEATURE] Add log cleanup CLI command and doctor integration

## Feature Description

Add a `stata-mcp tool clean-log` CLI command to clean up old log/do-file/tmp files based on filename timestamps, with opt-in cleanup integration in `stata-mcp doctor`.

## Problem It Solves

Stata-MCP generates log files, do-files, and temporary files for every execution. These accumulate over time with no cleanup mechanism, wasting disk space. Users currently have to manually delete old files from `stata-mcp-folder/`.

## Proposed Solution

### 1. CLI Command: `clean-log

[Read the thread](https://github.com/SepineTam/mcp-for-stata/issues/63) · 2026-04-15 · closed · 0 comments

### [FEATURE] Append clear before exit to prevent Stata process hanging on data change

## Feature Description

When executing a do-file that modifies data in memory (e.g., `gen`, `replace`, `drop`), Stata refuses to exit with the error:

```
no; dataset in memory has changed since last saved
    Save the data or specify option clear to exit anyway.
r(4);
```

This prevents the Stata process from terminating gracefully, leaving a zombie process running.

On macOS and Linux, the solution is to append `clear` before `exit` in the command sent to Stata. Windows does not appear to have

[Read the thread](https://github.com/SepineTam/mcp-for-stata/issues/60) · 2026-04-11 · closed · 0 comments

### [FEATURE] Add read_log_only_error parameter to stata_do

## Feature Description

Add a new parameter `read_log_only_error` (default: `False`) to the `stata_do` tool. When set to `True`, the log content is only read and returned when the Stata execution encounters an error; otherwise the log file path is returned but the content is not read into the response.

## Problem It Solves

When executing large do-files (e.g., long regression scripts, batch data processing), the generated log file can be extremely verbose. Since `stata_do` currently reads and r

[Read the thread](https://github.com/SepineTam/mcp-for-stata/issues/59) · 2026-04-11 · closed · 0 comments

### [FEATURE] Less token usage in MCP tools design by easier docstring

## Feature Description
--
In current usage, MCP tool metadata (especially docstrings and descriptions) is too verbose, which increases context token usage. Some descriptions also do not match real tool behavior closely enough, reducing tool-selection quality.
 
## Problem It Solves
- Reduces per-request token cost and improves efficiency.
- Improves consistency between tool descriptions and actual behavior.
- Improves tool-selection precision and overall task reliability.
 
## Proposed Solution

[Read the thread](https://github.com/SepineTam/mcp-for-stata/issues/58) · 2026-04-11 · closed · 0 comments

### [FEATURE] Support parallel/batch execution of multiple do-files

## Feature Description

Support executing multiple Stata do-files in a single tool call, enabling batch or parallel execution instead of running them one by one.

## Problem It Solves

Currently `stata_do` only accepts a single do-file path. When an LLM agent needs to run multiple independent analyses (e.g., separate regressions for different subgroups, data cleaning followed by multiple diagnostic checks), it must call `stata_do` sequentially, which is slow and creates unnecessary back-and-fort

[Read the thread](https://github.com/SepineTam/mcp-for-stata/issues/55) · 2026-04-08 · open · 0 comments

### [FEATURE] Add SMCL log format support to preserve hyperlink information

## Feature Description

Add support for SMCL (Stata Markup and Control Language) log format to preserve hyperlink information in Stata command outputs.

## Problem It Solves

The current stata-mcp logs Stata execution using plain text `.log` format. This causes hyperlink information in some Stata command outputs to be lost.

For example, commands like `findsj` and `getiref` output clickable links in Stata GUI, but when executed in batch mode, only plain text is visible in the log without any lin

[Read the thread](https://github.com/SepineTam/mcp-for-stata/issues/37) · 2026-02-24 · closed · 0 comments

### [BUG] Security: Command Injection via Untrusted Stata do-file Execution (stata_do tool)

## AI Model
- [x] Claude

## Bug Description
A command injection vulnerability exists in the **_stata_do_** tool.
The server executes user-provided or LLM-generated Stata do-files directly using: subprocess.Popen(..., shell=True)
Stata supports shell-escape directives such as:
_!whoami_
_!ls_
_shell curl ..._
These lines are interpreted as real OS commands on macOS & Linux Stata.
Since the server does not sanitize or validate do-file contents, an attacker can embed arbitrary OS command escapes i

[Read the thread](https://github.com/SepineTam/mcp-for-stata/issues/20) · 2025-11-19 · closed · outside contributor · 0 comments

### [BUG] Error about requirements version conflicts

## AI Model
<!-- Please specify which AI model you are using -->
- [ ] ChatGPT
- [ ] Claude
- [ ] GPT-4
- [ ] Other (please specify): 

## Bug Description
<!-- A clear and concise description of the bug -->
(.venv)(base) ~/Documents/Github/MCP_Pro/stata-mcp git:[master]
stata-mcp --usable

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.3.0 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild 

[Read the thread](https://github.com/SepineTam/mcp-for-stata/issues/8) · 2025-06-11 · closed · 0 comments

The remaining reports are on [the project's issue tracker](https://github.com/SepineTam/stata-mcp/issues).
