stata-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| STATA_HOME | No | Stata installation root directory. Overrides the default path where pystata is located. | C:\Program Files\Stata18 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| stata_breakA | 打断指定会话正在运行的 Stata 命令(若有);打断后命令 rc=1,引擎存活可继续。 |
| stata_data_rowsA | 返回当前数据集前 N 行(结构化二维数组),供 agent 直接查看数据。 |
| stata_export_graphB | 把内存中的图导出为图片文件,返回绝对路径(正斜杠)与大小。 |
| stata_get_helpA | 查 Stata 官方帮助(纯文本,从 .sthlp 读)——agent 不必瞎猜命令语法。 |
| stata_get_resultsA | 返回当前会话内存里的估计(e())/描述统计(r())/形状 结构化结果(只读)。 |
| stata_inspect_dataA | 查看当前数据:describe/summarize/codebook,可限定变量名列表。 返回命令的清洗输出;summarize(单变量)或 describe 附结构化结果。 |
| stata_load_dataA | 载入数据集到 Stata 内存:本地 .dta/.csv/.xlsx(须在工作目录或授权目录内) 或 https URL。返回载入命令的清洗输出与 {source, N, k} 结构化形状。 |
| stata_runA | 执行一段 Stata 代码(保持会话状态),返回清洗后的输出文本与 rc。 |
| stata_session_historyA | 返回当前会话的命令日志(seq/cmd/rc),供追溯或崩溃后重放。 |
| stata_task_statusA | 查询后台任务:running / done(带结果文本) / error。未知 job_id 报 rc=1。 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 10 tools
Each tool maps to a distinct activity—executing code, loading data, inspecting data, viewing rows, retrieving results, exporting graphs, getting help, and managing sessions/tasks. There is minor potential confusion between inspect_data and get_results since both can return summary-like structured output, but the descriptions clarify the intended use.
The consistent stata_ prefix and snake_case help, but the pattern is mixed: most tools use verb_noun (stata_load_data, stata_inspect_data, stata_export_graph), while others are noun phrases (stata_data_rows, stata_session_history, stata_task_status). This makes the set slightly less predictable.
Ten tools is well-scoped for a Stata MCP server, covering command execution, data access, session management, help, and output export without redundancy or bloat. Each tool earns its place in the analysis workflow.
The tool surface covers the core Stata workflow—load data, inspect it, run commands, retrieve results, export graphs, get help, and manage tasks/sessions. A few optional additions like saving/exporting datasets or managing working directories are absent, but agents can work around these with stata_run, so there are no major dead ends.