Version 1.0.3Stata-MCP

Let Large Language Models (LLMs) help you achieve your regression analysis with Stata.

MIT License
macOS Support

Features

Streamline your Stata workflow

Leverage the power of Large Language Models to enhance your regression analysis with Stata.

Support Multilingue

Notre plateforme prend en charge plusieurs langues, notamment l'anglais, le chinois, le français et l'espagnol.

Changement Facile

Passez d'une langue à l'autre en un simple clic.

Design Responsive

Notre interface s'adapte à toutes les tailles d'écran pour une expérience utilisateur optimale.

Personnalisable

Personnalisez et étendez facilement avec des langues supplémentaires selon vos besoins.

Multilingual Support

Documentation and interfaces available in multiple languages including English, Chinese, and French.

Research-Focused

Designed with researchers and academics in mind, perfect for econometrics and statistical analysis projects.

Installation

Get started in minutes

Follow these simple steps to install and configure Stata-MCP.

Prerequisites

  • uv - Package installer and virtual environment manager
  • Claude, Cline, ChatWise, or other LLM service
  • Stata License
  • Your API-KEY from LLM

Installation Steps

<span className="text-blue-400"># Clone the repository</span>
git clone https://github.com/sepinetam/stata-mcp.git
cd stata-mcp

<span className="text-blue-400"># Copy example config</span>
cp example.config.py config.py

<span className="text-blue-400"># Using uv (recommended)</span>
uv run stata_mcp.py 17 se  <span className="text-blue-400"># Test run with Stata 17 SE</span>

<span className="text-blue-400"># Alternative setup with pip</span>
<span className="text-gray-500"># python3.11 -m venv .venv</span>
<span className="text-gray-500"># source .venv/bin/activate</span>
<span className="text-gray-500"># pip install -r requirements.txt</span>
bash

Note: Windows support is not currently available. If you have a Stata license for Windows and would like to contribute, please submit a PR.

Configuration

MCP Server Configuration

Configure Stata-MCP with your preferred LLM service.

Claude

{
  "stata-mcp": {
    "command":"uv",
    "args":[
      "--directory",
      "/Users/yourname/path/to/repo/",
      "run",
      "stata_mcp.py",
      "17",
      "se"
    ]
  }
}
json

ChatWise

Open ChatWise app and navigate to the tools tab (subscription required):

type: stdio
ID: stata-mcp
command: uv --directory /Users/yourname/path/to/repo/ run stata_mcp.py 17 se
yaml

Cline

{
  "mcpServers": {
    "stata-mcp": {
      "command":"uv",
      "args":[
        "--directory",
        "/Users/yourname/path/to/repo/",
        "run",
        "stata_mcp.py",
        "17",
        "se"
      ]
    }
  }
}
json

Demo

See it in action

Watch how Stata-MCP helps with regression analysis.

Stata-MCP Logo

Example Interaction

Here's a sample prompt to get you started:

<span className="text-green-400">System Prompt:</span>
"""
你是一个经济学教授的助理,熟悉各种经济学的实证方法,能帮助教授写stata代码并完成实证研究。教授会给你一个要求,而你需要实现它的需求,你的实现方法应该遵循如下步骤:
1. 确认数据里的变量
2. 分析问题如何开展
3. 编写stata-code整理成do-file并通过工具运行

完成任务后你需要帮助教授进行分析回归结果。
"""

<span className="text-green-400">Prompt:</span>
"""
我有一个数据文件,目录是'/Users/username/Documents/data/did_show.dta',这是一个did的示例数据,我希望你跑一个did出来给我看看。数据里有一个q变量,这是我们做did的y,然后还有trade和post来描述是税改之前的还是税改之后的以及是否是处理组。

你的任务是先写一个dofile,通过工具来保存这个dofile到本地,然后通过工具执行这个dofile,最后通过工具读取这次执行的日志。
"""
text

Roadmap

Future Development Plans

What's coming next in Stata-MCP development.

Q2 2023

  • Initial release with basic MCP functionality
  • Support for Claude integration
  • Basic command generation capabilities

Q3 2023

  • Added ChatWise and Cline support
  • Improved error handling and logging
  • Enhanced documentation

Q4 2023

  • Multilingual support (Chinese, French)
  • Advanced regression analysis templates
  • Performance optimizations

Q1 2024

  • Windows support
  • Enhanced result visualization
  • Batch processing capabilities

Future Ideas

  • Integration with more LLM providers
  • Stata plugin for direct IDE integration
  • Automated report generation
  • Community template sharing

Ready to enhance your Stata workflow?

Get started with Stata-MCP today and experience the power of AI-assisted regression analysis.