stata-mcp

Execute Stata commands, load datasets, and export graphs from a local Stata 17+ installation.

77|16|Updated Dec 12, 2025
One-click install
npx skills add https://github.com/tmonk/mcp-stata --skill stata-mcp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: stata-mcp
Source: https://github.com/tmonk/mcp-stata/tree/main/skill
Command: npx skills add https://github.com/tmonk/mcp-stata --skill stata-mcp

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill bridges the gap between AI agents and local Stata installations, enabling AI to execute Stata code, inspect data, and generate visualizations without manual intervention.

Core Features & Use Cases

  • Execute Stata Code: Run any Stata command or .do file directly.
  • Data Inspection: Get summaries, variable details, and raw data slices.
  • Graph Export: Generate and export Stata graphs in various formats.
  • Result Verification: Access stored results (r(), e()) for validation.
  • Use Case: An AI can now analyze a dataset using Stata's advanced statistical functions, then export the resulting regression table and a generated scatterplot, all through natural language commands.

Quick Start

Use the stata-mcp skill to load the 'auto' dataset and run a regression of price on mpg.

Frequently Asked Questions about stata-mcp

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I execute Stata commands and .do files using an AI agent?

You can execute Stata commands and .do files by connecting your AI agent to a local Stata installation. This allows the AI to run ad-hoc code, process scripts, and load datasets directly.

What is needed to connect AI to Stata for data analysis?

To connect AI to Stata for data analysis, you need a licensed Stata 17+ installation and Python 3.11+. This setup allows the agent to inspect data structures and execute commands.

Can I generate and export Stata graphs through natural language commands?

Yes, you can generate and export Stata graphs in various formats through natural language commands. The AI triggers graph generation within the local Stata installation and exports the visualizations.

How do I retrieve stored Stata results like r() and e() for validation?

You retrieve stored Stata results like r() and e() for validation by having the AI agent request them after executing commands. This provides access to returned matrices and scalars for verification.

Does this AI integration support data summarization and variable codebooks?

Yes, the AI integration supports data summarization and variable codebooks. It can inspect data structures, retrieve raw data slices, and fetch variable details directly from the local Stata environment.