MCP Catalogs
Homemcp-stata screenshot

mcp-stata

by tmonk·62·Score 46

A Model Context Protocol server for Stata that enables AI agents to execute Stata code, inspect data, and retrieve results.

ai-llmproductivitydeveloper-tools
11
Forks
5
Open issues
this month
Last commit
2d ago
Indexed

Overview

The mcp-stata server provides a comprehensive toolkit for empirical researchers to integrate LLM assistance into their Stata workflow. It allows AI agents to execute Stata commands, inspect data structures, retrieve stored results (r()/e()), and view graphs directly within the chat interface. The server is particularly designed for academic research workflows, offering specialized skills for data auditing, replication checks, specification comparisons, and publication quality assurance.

Try asking AI

After installing, here are 4 things you can ask your AI assistant:

you:Empirical research workflows requiring AI assistance with data analysis
you:Automated paper preparation and publication quality assurance
you:Code modernization and replication studies in economics research
you:How does the server find my Stata installation?

When to choose this

Choose this if you're an economist or researcher already using Stata who wants to integrate AI assistance directly into your statistical workflow.

When NOT to choose this

Don't choose this if you don't have a licensed copy of Stata 17+, as the server requires a local installation of proprietary statistical software.

Tools this server exposes

8 tools extracted from the README
  • stata_runstata_run(code, is_file=False, background=False, echo=True, as_json=True, trace=False, raw=False, max_output_lines=None, cwd=None, session_id='default', strip_smcl=True, filter_pattern=None, exclude_pattern=None)

    Execute Stata commands or a .do file

  • stata_task_statusstata_task_status(task_id, wait=False, timeout=60.0, poll_interval=1.0, tail_lines=0)

    Query or wait on background task status

  • stata_controlstata_control(action, id)

    Control active work (break session or cancel task)

  • stata_read_logstata_read_log(path, offset=0, max_bytes=262144, tail_lines=0, query=None, before=2, after=2, case_sensitive=False, regex=False, max_matches=50)

    Read, tail, or search a log file

  • stata_load_datastata_load_data(source, clear=True, as_json=True, raw=False, max_output_lines=None, session_id='default')

    Load dataset from various sources (sysuse/webuse/use/path/URL)

  • stata_inspect_datastata_inspect_data(action, query=None, variables=None, start=0, count=50, session_id='default')

    Inspect data with describe, codebook, summary, search, list, get, or lint

  • stata_manage_graphsstata_manage_graphs(action, graph_name=None, format='svg', session_id='default')

    Manage graphs (list, export, export_all)

  • stata_get_resultsstata_get_results(session_id='default', include_format

    Retrieve stored results (r(), e())

Comparable tools

stata-workbenchr-mcppython-data-science-mcp

Installation

Installation

Using the installer script

macOS/Linux:

curl -LsSf https://mcp-stata-install.tdmonk.com/install.sh | bash

Windows (PowerShell):

irm https://mcp-stata-install.tdmonk.com/install.ps1 | iex
Claude Desktop Configuration

Add to your Claude Desktop configuration:

{
  "mcpServers": {
    "mcp-stata": {
      "command": "uvx",
      "args": [
        "--refresh",
        "--refresh-package",
        "mcp-stata",
        "--from",
        "mcp-stata@latest",
        "mcp-stata"
      ]
    }
  }
}

Prerequisites: Stata 17+, Python 3.11+, and uv (recommended).

FAQ

What version of Stata is required?
Stata 17+ (Stata MP, SE, or BE) is required. It must be licensed and installed locally.
How does the server find my Stata installation?
The server attempts automatic discovery of your Stata installation (supporting standard paths and StataNow). If auto-discovery fails, you can set the STATA_PATH environment variable to your Stata executable.

Compare mcp-stata with

GitHub →

Last updated · Auto-generated from public README + GitHub signals.