Control the Stata GUI through MCP on Windows via COM automation
Stata GUI MCP has 12 tools with complete input schemas and descriptions, but quality is inconsistent. Tool names use verb_noun pattern (stata_run, stata_read_log) which is good. However, descriptions are in Chinese, making them inaccessible to most LLM contexts and reducing clarity. Parameter descriptions exist but are minimal (avg ~40 chars). No output schemas are documented, LLMs cannot predict return structure. Error handling is absent: no guidance on recovery, retryability, or actionable error messages. Security concerns: tools like stata_run and stata_write_dofile execute arbitrary code with minimal validation (only a basic blacklist of dangerous commands). No tool annotations (readOnlyHint, destructiveHint) despite clear read/write distinctions. Composition is reasonable, tools are single-purpose, but chaining is unclear without documented output schemas.
向已有 do 文件追加内容
获取当前 Stata 数据集的基本信息(变量数、观测数、数据类型等)
获取当前 Stata 数据集的完整 schema,包括变量名、类型、标签、缺失值统计、样本数据等
获取 Stata 最后一条命令的返回值和 ereturn/return 结果
在 Stata 中安装或更新 SSC 包
读取 do 文件内容,返回给 Claude 检查、解释或继续修改
读取 session 最新运行日志或指定日志文件内容
All tool descriptions are in Chinese, making them inaccessible to English-speaking LLM contexts and reducing discoverability. Descriptions should be in English for broad compatibility.
No output schemas documented for any tool. LLMs cannot predict return structure, field names, or types. This breaks tool chaining and forces agents to guess at downstream parameter mappings.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | F | 49 | 2026-07-28+ | v2 |
在最近的 Stata MCP session 对应 GUI 中将 commands 作为一个完整代码块执行;每次覆盖该 session 的最新运行 text log,并自动返回实际输出。可先用 stata_session(action='set_recent') 切换目标 session。
在 Stata GUI 中运行一个 do 文件。该工具以 session_id 表示一个复现任务/同一个 Stata GUI;同一任务的原始 do、检查 do、续跑 do 应使用同一个 session_id。每次调用都会覆盖该 session 在项目 .stata-mcp/cache/ 下的最新运行 text log,并自动返回日志内容;不会修改用户原始 do 文件。
管理 Stata MCP session:列出、查询、销毁、切换最近 session。session_id 代表同一复现任务/同一个 Stata GUI,并关联 entry/source/current do、每个 do 的 log_paths 和 last_log_path。
获取 Stata MCP 服务器状态和所有 session 的连接状态
将 Stata 代码写入 do 文件并保存到磁盘,返回文件路径;相对文件名会写入最近 session 项目的 .stata-mcp/dofiles/,不会使用 MCP runtime。
No error handling guidance. Tools like stata_run and stata_run_dofile can fail silently or with opaque COM errors. No recovery hints, retryability classification, or actionable error messages for LLMs.
Dangerous command execution with minimal validation. stata_run accepts arbitrary Stata commands; only a basic blacklist (!, shell, erase, etc.) prevents abuse. No sandboxing, no permission gates, no audit trail. Agents could be tricked into destructive operations.
No tool annotations (readOnlyHint, destructiveHint, idempotentHint). Tools are marked with Risk: READ_ONLY or WRITE in comments, but not in the MCP schema. LLMs cannot distinguish safe from destructive operations without explicit annotations.