Stata-MCP
Let LLM help you achieve your regression with Stata.
Statement: All the documents are generated by AI, except Usage.md which is written by the author.
Quickly Start
Requirements: uv or python 3.11+
If you don't haveuvbutpython, you can install it withpip install uv.
First, you should check whether your device is supported by stata-mcp.
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 to solve it.
The common configuration file (json)
{
"mcpServers":{
"stata-mcp": {
"command": "uvx",
"args": ["stata-mcp"]
}
}
}
Use Stata-MCP in Claude Code
We recommend using Stata-MCP with 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.
Open your terminal, cd to your working directory, and run:
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.
If you want to explore more clients or agents, visit their respective documentation.
Documentation
Core Documentation
- Overview: Architecture, design philosophy, and integration patterns
- Usage: Common usage patterns and examples
- Configuration: Complete configuration guide with all options
- Clients: Supported MCP clients and setup instructions
Advanced Features
- Security Guard: Security validation system for dangerous commands
- Monitoring System: RAM monitoring and resource limits
Core Components
- Stata Integration
- StataDo: Do-file execution
- StataFinder: Stata executable detection
- Stata Help: Command documentation
-
Package Installation: SSC and GitHub packages
-
MCP Tools: Available MCP tools and usage
- MCP Resources: MCP resources and capabilities
Agents
- Agent Index: Overview of agent modes
- Claude Code Integration: Detailed Claude Code setup