home / mcp / stata-mcp mcp server
Let LLM help you achieve your regression with Stata. Evolve from reg monkey to causal thinker.
Configuration
View docs{
"mcpServers": {
"sepinetam-stata-mcp": {
"command": "uvx",
"args": [
"stata-mcp"
],
"env": {
"STATA_MCP_CWD": "$(pwd)"
}
}
}
}Stata-MCP is an MCP server that enables you to run Stata-driven regression analysis through a conversational, AI-assisted workflow. It lets large language models orchestrate Stata tasks, perform quick hypothesis tests, replicate results, and interpret outputs in a streamlined, secure environment. This guide walks you through practical usage, installation steps, configuration considerations, and key notes to help you get started quickly.
You will run Stata-MCP as a local or cloud-enabled server that your preferred MCP client can communicate with. Start the server using the standard runtime command, then connect your MCP client (for example Claude Code or another supported interface) to the server to issue Stata-related tasks. Typical workflows include performing regression analyses, validating hypotheses, interpreting results, and organizing Stata do-files with AI-assisted guidance.
Prerequisites you need before installation:
Other prerequisites include a Stata license and an API key from your preferred LLM provider. You may also use Claude or similar services depending on your setup.
Install Stata-MCP locally by using your Python environment and the package manager you prefer. The recommended path is to install the package and then run the agent in your environment.
# Install using pip
pip install stata-mcp
# Verify installation (example commands you can run in your shell)
stata-mcp --version
stata-mcp agent run
# Optional: use UVX to run the MCP binary if you have it installed
uvx stata-mcp --version
uvx stata-mcp agent runConfiguration for Stata-MCP supports both TOML-based settings and environment variable overrides, enabling flexible deployment in local, project, or user scopes.
# Example configuration to run via uvx in a local setup
```json
{
"mcpServers": {
"stata_mcp": {
"command": "uvx",
"args": ["stata-mcp"]
}
}
}Stata-MCP includes a Security Guard System that validates commands to prevent dangerous actions, RAM Monitoring to prevent memory exhaustion, and a Unified TOML-based configuration with environment variable overrides. These features help keep your analysis sessions safe, stable, and auditable.
You can operate Stata-MCP in agent mode, enabling it to run autonomously within a task-oriented workflow. The following examples illustrate common starter commands and patterns for testing and operation.
If you encounter issues, check for common problems such as missing prerequisites, invalid API keys, or license constraints for Stata. Ensure your MCP client is correctly configured to communicate with the Stata-MCP server and that the server is running in a compatible environment.
Stata-MCP is distributed under the AGPL-3.0 license. Use of Stata-MCP requires you to comply with the terms of this license.