TM

tmonk/mcp-stata

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

91 stars 20 forks 质量 82 趋势 19AGPL-3.0

tmonk/mcp-stata 是从 https://github.com/tmonk/mcp-stata. 导入的 MCP 服务器候选

概览

tmonk/mcp-stata 是从 https://github.com/tmonk/mcp-stata. 导入的 MCP 服务器候选

概述(AI 翻译)

 

mcp-stata 是面向实证研究者的代理工具包。它赋予 AI 代理对本地 Stata 安装的原生控制权,允许代理运行 do-file、检查数据、检查存储结果并导出图表。包含研究人员常用的工作流程技能目录:审计数据、复现和鲁棒性检查、规范比较、发表质量保证、审稿人回复以及遗留代码现代化。报道于新闻。

如果你想要一个完全集成的VS Code扩展,既能在不离开IDE的情况下运行Stata代码,又能与AI代理互动,可以看看我的另一个项目:Stata Workbench。

由伦敦政治经济学院托马斯·蒙克建造。

该服务器使LLM能够:

  • 执行 Stata 代码:运行任意 Stata 命令(例如 sysuse auto、regress price mpg。
  • 检查数据:检索数据集摘要和变量代码本。
  • 导出图形:生成并查看Stata图(直方图、散点图)。
  • 流式图缓存:命令执行时自动缓存图,实现即时导出。
  • 验证结果:程序化检查存储的结果(r()、e())以确保准确验证。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Stata MCP Server (mcp-stata)

 

mcp-stata is an agentic toolkit for empirical researchers. It gives AI agents native control over a local Stata installation, allowing agents to run do-files, inspect data, check stored results, and export graphs. Contains a skills catalog for workflows researchers use often: auditing data, replication and robustness checks, specification comparisons, publication QA, referee responses, and modernization of legacy code. Featured in News.

If you’d like a fully integrated VS Code extension to run Stata code without leaving your IDE, and also allow AI agent interaction, check out my other project: Stata Workbench.

Built by Thomas Monk, London School of Economics.

This server enables LLMs to:

  • Execute Stata code: run any Stata command (e.g. sysuse auto, regress price mpg).
  • Inspect data: retrieve dataset summaries and variable codebooks.
  • Export graphics: generate and view Stata graphs (histograms, scatterplots).
  • Streaming graph caching: automatically cache graphs during command execution for instant exports.
  • Verify results: programmatically check stored results (r(), e()) for accurate validation.
  • Drive paper workflows: run structured research audits, estimation planning, specification comparisons, publication checks, and reproducibility diagnostics.
  • Use modern MCP surfaces: discover prompts, project/session resources, artifacts, and safety metadata through structured tool envelopes.

Quickstart

1 · Install

macOS/Linux:

curl -LsSf https://mcp-stata-install.tdmonk.com/install.sh | bash

Windows (PowerShell):

irm https://mcp-stata-install.tdmonk.com/install.ps1 | iex

Client-specific examples:

Client macOS/Linux Windows (PowerShell)
Claude Code bash <(curl -LsSf https://mcp-stata-install.tdmonk.com/install.sh) --agent claude & ([scriptblock]::Create((irm https://mcp-stata-install.tdmonk.com/install.ps1 &#124; iex))) --agent claude
在 GitHub 查看完整 README

安装

uvx --refresh --refresh-package mcp-stata --from mcp-stata@latest mcp-stata
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "mcp-stata": { "command": "uvx", "args": [ "--refresh", "--refresh-package", "mcp-stata", "--from", "mcp-stata@latest", "mcp-stata" ] } } }