# Use in Claude Code

> **Deprecated**: Stata-MCP's built-in agent mode is marked with `FutureWarning` since v1.16.x and will be removed in a future release. New workflows should use MCP server mode (`stata-mcp server` or `stata-mcp install -c <client>`) and rely on the host AI client's native agent capabilities instead.

We are very excited to write this document about Claude Code with Stata-MCP. At my daily research, Claude Code is one of the tools I use most often. 

If you have not installed it, you can visit [Claude Code](https://code.claude.com/docs/en/quickstart) to install it. 

> Requirements:  
> - [Stata](https://www.stata.com) 17+  
> - [uv](https://docs.astral.sh/uv/getting-started/installation/) or python 3.11+  
> - Claude Code

## Quickly Start
First, check whether Stata-MCP is compatible with your device by verifying each requirement. 

```bash
uvx stata-mcp doctor
```

Then, create your project. We suggest creating all the projects in the same directory. For example, we use `~/Documents/StataProjects` as the project directory.

```bash
cd ~/Documents/StataProjects
claude mcp add stata-mcp --env STATA_MCP__CWD=$(pwd) --scope project -- uvx --directory $(pwd) stata-mcp
```

> Advice: Please make sure the directory without any special characters like whitespace, emoji or Chinese characters.

Now the project has been created successfully. 
The project structure is as follows:

```text
my_first_project/            # Project directory
├── .statamcp/               # All the files generated by Stata-MCP
│   ├── stata-mcp-dofile/    # do-files
│   ├── stata-mcp-log/       # log files
│   ├── stata-mcp-result/    # Some command (like `outreg2`) results saved here
│   └── stata-mcp-tmp/       # Temporary files, like data info description
│   └── .gitignore           # git ignore file
└── CLAUDE.md                # The global instructions to limit the project

```
