# Stata-MCP

**Let LLM help you achieve your regression with Stata.**

> Statement: All the documents are generated by AI, except [Usage.md](https://github.com/sepinetam/stata-mcp/blob/master/source/docs/Usages/Usage.md) which is written by the author.

## Quickly Start

> Requirements: [uv](https://docs.astral.sh/uv/getting-started/installation/) or python 3.11+  
> If you don't have `uv` but `python`, you can install it with `pip install uv`.  

First, you should check whether your device is supported by stata-mcp.  
```bash
uvx stata-mcp --usable
```
If each check is passed, you can start using stata-mcp.  
If remind not found STATA_CLI, you can see [StataFinder](core/stata/finder.md#not-found) to solve it.

The common configuration file (json)
```json
{
  "mcpServers":{
    "stata-mcp": {
      "command": "uvx",
      "args": ["stata-mcp"]
    }
  }
}
```

### Use Stata-MCP in Claude Code

We recommend using Stata-MCP with [Claude Code](https://github.com/anthropics/claude-code) for its excellent agentic capabilities.

Before using it, please make sure you have Claude Code installed. If you don't know how to install it, visit [GitHub](https://github.com/anthropics/claude-code).

Open your terminal, `cd` to your working directory, and run:

```bash
claude mcp add stata-mcp --env STATA_MCP_CWD=$(pwd) --scope project -- uvx --directory $(pwd) stata-mcp
```

This will create a `.mcp.json` file in your working directory with the MCP configuration.

#### Use Cases

- **Paper Replication**: Replicate empirical studies from economics papers
- **Quick Hypothesis Testing**: Validate economic hypotheses through regression analysis
- **Stata Learning Assistant**: Learn econometrics with step-by-step Stata explanations
- **Code Organization**: Review and optimize existing Stata do-files
- **Result Interpretation**: Understand complex statistical outputs and regression results

For detailed usage guide, visit [agents/claude_code.md](agents/claude_code.md).

---

If you want to explore more [clients](clients.md) or [agents](agents/index.md), visit their respective documentation.

