# stata-mcp [Health: Active]

**Category:** 🧮 Data Science Tools  
**Repository:** https://github.com/SepineTam/stata-mcp  
**GitHub Stars:** 275  
**Views:** 13  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/stata-mcp

## Description
Let LLM help you achieve your regression analysis with Stata

## Tools
Capabilities this server exposes over MCP:

- **stata_do** — Execute a Stata do-file and return the execution log. Accepts a do-file path, runs it via the configured Stata executable, and can optionally read log content only when return-code errors are detected. Use when you need to run Stata commands, perform regression or statistical analysis, or execute a do-file. 
- **get_data_info** — Get descriptive statistics and a data preview for a supported data file (.dta, .csv, .tsv, .psv, .xlsx, .xls, .sav, .zsav). Returns overview, variable details, and optional head rows filtered by requested variables. Use when you need to understand a dataset or have no prior knowledge of the data.
- **help** — Retrieve documentation and usage information for a Stata command. Use when you need to understand a command's syntax, options, or troubleshoot errors before running it.
- **read_log** — Read a Stata log file (.log or .smcl) and return its content. Supports full, core, and dict output formats. Use `lines` to return only the first/last N lines.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

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

## Documentation

## 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:

```bash
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.

_Full upstream README: https://allmcps.com/mcp/stata-mcp/readme_

