Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
6,000+ web scrapers for your AI agent, start free logo6,000+ web scrapers for your AI agent, start free

Apify gives your agent live web data: 6,000+ prebuilt scrapers and actors, MCP-ready. Sign up free with $5 in usage credits.

Try Apify free
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 48,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Enables an agent to execute Stata do scripts or inline commands locally and retrieve structured results including status, error diagnostics, and output text for consumption by the model.

README.md

Stata 执行器 (Stata Executor)

stata_executor 是一个面向 Agent 的本地 Stata 执行 MCP server,让 Agent 具备运行 do 脚本/内联命令并读取稳定执行结果的能力。

它返回两类信息:一类是稳定的执行事实,另一类是可直接给模型消费的干净实证结果正文。它不负责解释经济学或实证结果。

安装

uv sync

配置

stata_executor 通过 MCP 启动 JSON 的 env 字段注入环境变量:

  • STATA_EXECUTOR_STATA_EXECUTABLE: Stata 可执行文件路径(必填)
  • STATA_EXECUTOR_EDITION: 版本(可选,mp / se / be,默认 mp

示例:

{
  "mcpServers": {
    "stata-executor": {
      "command": "D:/Developments/PythonProject/Stata-Executor-MCP/.venv/Scripts/python.exe",
      "args": ["-m", "stata_executor"],
      "cwd": "D:/Developments/PythonProject/Stata-Executor-MCP",
      "env": {
        "STATA_EXECUTOR_STATA_EXECUTABLE": "D:/Program Files/Stata17/StataMP-64.exe",
        "STATA_EXECUTOR_EDITION": "mp"
      }
    }
  }
}

启动命令:python -m stata_executor

暴露的工具 (Tools)

  • doctor: 检查环境与配置
  • run_do: 执行现有的 .do 文件
  • run_inline: 执行单条或多条 inline 命令

结果结构 (Result Shape)

run_do / run_inline 返回的结构化内容 (structuredContent) 包含以下字段:

  • status: 执行状态 (succeeded, failed)
  • error_kind: 失败时的错误分类(bootstrap_error / input_error / timeout / stata_parse_or_command_error / stata_runtime_error / artifact_collection_error),成功时为 null
  • result_text: 过滤命令回显后的完整结果正文,面向模型直接消费
  • diagnostic_excerpt: 失败时围绕末次命令与错误行的诊断片段
  • artifacts: 本次执行新增或变更的产物绝对路径列表

doctor 返回:

  • ready: 配置与可执行文件是否就绪
  • errors: 未就绪时的错误清单(就绪时为空列表)

执行失败时响应的 isError=true 且仍然返回完整 structuredContent,便于 Agent 基于诊断字段进行恢复。

测试

python -m unittest discover -s tests -v

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use AI & ML servers.