Stata MCP Server

MCP-for-Stata: one-command install of a Stata MCP server for Claude Code, Codex, OpenClaw, and 7+ AI agents. Run Stata do-files through natural

Local serverstdioPython

What is the Stata MCP server?

Stata MCP server exists for a simple reason — assistants are far more useful when they can act on Stata directly instead of describing what you should do. MCP-for-Stata: one-command install of a Stata MCP server for Claude Code, Codex, OpenClaw, and 7+ AI agents. Run Stata do-files through natural language.

What you get

Enable Claude Code, Codex, OpenClaw, and other AI agents to safely invoke Stata on your local device for data analysis.

  • Security Guard — Blocks dangerous commands (!, shell, erase, etc.)
  • RAM Monitoring — Prevents memory exhaustion with configurable limits
  • Layered Configuration — User, project, environment, and Linux system config support
  • Beta async stata_do execution — Supports concurrent MCP calls for multi-client workflows
  • Configurable data access boundaries — Data info URL guard and optional direct read_log boundary
  • Cross-platform support (macOS, Windows, Linux)

What the assistant can call

Once Stata is connected, these are the calls the assistant has available:

  • Name — stata-mcp
  • Command — ~/.local/bin/stata-mcp
  • Cross — platform support (macOS, Windows, Linux)
  • Agent — Tag
  • Cursor — cursor
  • OpenCode — opencode
  • OpenClaw — openclaw
  • FeatureMCP-for-Stata (this)
  • Agents — All
  • Type — MCP Server + CLI toolkit
  • Execution — do-file via subprocess
  • Safety — Command guard + RAM monitor

Setting it up

stata-mcp on PyPI is all you need. Most clients run it directly, so configuration is a few lines and a restart.

Configuration and credentials

  • uv - Package installer and virtual environment manager - Claude Code, Codex, OpenClaw or other Agents - Stata License - Your API-KEY from LLM If you want to check whether your device is supported, you can run: It displays basic information about your device and checks whether your setup is supported. Example output >

Choosing this one

Plenty of monitoring and observability servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. Stata's toolset — Name, Command, Cross and 11 more — is a fair guide to whether it matches your workflow. It is maintained by Song Tan; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Before you rely on it

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 14 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Stata.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the stata mcp server does with a few real requests.

Available tools

ToolWhat it does
Namestata-mcp
Command~/.local/bin/stata-mcp
Crossplatform support (macOS, Windows, Linux)
AgentTag
Cursorcursor
OpenCodeopencode
OpenClawopenclaw
Feature[MCP-for-Stata](https://aidea-labs.com/mcp-for-stata) (this)
AgentsAll
TypeMCP Server + CLI toolkit
Executiondo-file via subprocess
SafetyCommand guard + RAM monitor
LogsText + SMCL readers
Graphs

How to install the Stata MCP server

{
  "mcpServers": {
    "stata-1": {
      "command": "uvx",
      "args": ["stata-mcp"]
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

  • uv - Package installer and virtual environment manager - Claude Code, Codex, OpenClaw or other Agents - Stata License - Your API-KEY from LLM If you want to check whether your device is supported, you can run: It displays basic information about your device and checks whether your setup is supported. Example output >

Example prompts to try

  • Use Stata to Name.
  • Use Stata to Command.
  • Use Stata to Cross.

Frequently asked questions

It connects Stata to MCP-compatible AI assistants such as Claude and Cursor, exposing 14 tools (Name, Command, Cross, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Stata directly.