Stata MCP logo

Stata MCP

Run local Stata analyses, inspect supported datasets, look up command help, and read execution logs through MCP.

Install Stata MCP

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "stata-mcp": {
      "command": "uvx",
      "args": [
        "stata-mcp"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Install not yet sandbox-tested— the server itself is confirmed live (we called its tools/list endpoint). The stdio install command is a separate, ongoing check.

Overview

stata-mcp connects AI agents to a local Stata installation for regression analysis, econometrics, and empirical research. Its MCP tools execute do-files, inspect common data formats, retrieve Stata command help, and read log files. Use it when analysis must run against local data and a locally licensed Stata executable. Client installation is available through the `uvx stata-mcp install` command or direct MCP configuration.

Use cases

  • Run regression do-files through a local Stata installation
  • Inspect unfamiliar datasets before writing analysis code
  • Look up Stata command syntax while troubleshooting
  • Read and filter Stata execution logs
  • Replicate empirical research with local data and scripts

Key features

  • Execute Stata do-files
  • Inspect eight common statistical and tabular file formats
  • Retrieve Stata command documentation
  • Read LOG and SMCL files
  • Return descriptive statistics and data previews
  • Install configurations across supported agent clients

Tools4

What Stata MCP lets your agent do. Expand a tool for its parameters.

Verified live~613 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked Today

Recent health check succeeded.

19/23 checks healthy over the last 91d

What it can do

From the 4 tools this server returned when we ran it.

Runs commands · 1Read-only tools · 3
Network at startup2 connections
Files written at startup30

Observed 2026-10-15 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

3 high-severity advisories on record for this package. Most advisories affect transitive dependencies and may not be exploitable in this server's actual usage — this is a directional signal, not a security audit.

Critical 1High 2Medium 0Low 3

Scanned 5d ago via OSV.dev · stata-mcp (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars275Stargazers on the source repository.
Last commit3d agoMost recent push to the default branch.
Tools exposed4Callable tools this server registers over MCP.
Directory activity13 viewsConfig copies, upvotes, and views on AllMCPs.

How Stata MCP works

What stata-mcp does

stata-mcp gives an MCP-compatible agent access to selected local Stata workflows. The server can run a Stata do-file and return its execution log, inspect datasets before analysis, provide help for Stata commands, and expose the contents of Stata log files. This makes it suitable for regression work, econometric analysis, paper replication, and empirical research performed on a local machine.

The server works with a configured Stata executable rather than a hosted Stata service. Data and analysis therefore remain on the machine where Stata and the MCP server run, subject to the local environment and Stata license.

How it works

An agent calls stata_do with a do-file path. The server runs that file through the configured Stata executable and returns the execution log. When Stata reports return-code errors, the tool can also read log content to help diagnose the failure.

get_data_info provides a dataset overview, variable details, descriptive statistics, and optional preview rows. It accepts .dta, .csv, .tsv, .psv, .xlsx, .xls, .sav, and .zsav files, with previews optionally limited to requested variables.

For command syntax or troubleshooting, the help tool retrieves Stata documentation for a named command. read_log reads .log and .smcl files and supports full, core, or dictionary-style output. It can also restrict the response to the first or last number of lines.

Setup and configuration

The project is distributed as the stata-mcp package and documents uvx-based installation. To install it for all supported agents, run:

bash
uvx stata-mcp install --all

Client-specific installation is also available. For example, the direct Claude Code command is:

Terminal
claude mcp add stata-mcp --scope user -- uvx stata-mcp

The project also provides platform installation scripts for macOS, Linux, and Windows. Before using analysis tools, configure access to a Stata executable on the local machine. Client installation options cover Claude Desktop, Claude Code, Gemini CLI, Cursor, Cline, and Codex, among others listed by the project.

Tools and capabilities

  • stata_do: Execute a do-file with Stata and return its log output; optionally inspect log content when return-code errors occur.
  • get_data_info: Examine supported data files through metadata, descriptive statistics, variable information, and selected head rows.
  • help: Look up syntax, options, and usage information for Stata commands.
  • read_log: Parse .log or .smcl files using full, core, or dictionary output, with optional line limits.

The project also includes command guards, resource monitoring, automatic log capture, and client installation support. Stata is a registered trademark of StataCorp LLC; the project identifies itself as an independent community-developed tool.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Stata MCP

stata-mcp is an MCP server that connects AI agents to a local Stata installation. Its main tools execute do-files, inspect supported datasets, retrieve Stata command help, and read LOG or SMCL files, enabling regression analysis, econometrics, troubleshooting, and empirical research through MCP.

Install it for all supported agents with `uvx stata-mcp install --all`. The project also provides client-specific commands, platform installation scripts, and direct configuration such as `claude mcp add stata-mcp --scope user -- uvx stata-mcp` for Claude Code.

Yes, Cursor is a supported client. Use the project’s client installation command, `uvx stata-mcp install -c cursor`, to configure stata-mcp for Cursor.

stata-mcp can inspect `.dta`, `.csv`, `.tsv`, `.psv`, `.xlsx`, `.xls`, `.sav`, and `.zsav` files. Its data inspection tool returns an overview, variable details, descriptive statistics, and optional preview rows filtered by requested variables.

Yes, `read_log` reads `.log` and `.smcl` files. It supports full, core, and dictionary output formats, and can return only the first or last requested number of lines.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewStata MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/stata-mcp?style=directory)](https://allmcps.com/mcp/stata-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/stata-mcp"><img src="https://allmcps.com/api/badge/stata-mcp?style=directory" alt="Stata MCP on AllMCPs" /></a>