Agent skill

Stata Skill

by SepineTam in SepineTam/mcp-for-stata

A packaged Stata Runner skill via official MCP-for-Stata server including statado, adopackageinstall, help, readlog and getdatainfo tools.

AGPL-3.0Auto-check passedResearch & Science

Install Stata Skill

skills CLI
$ npx skills add SepineTam/mcp-for-stata --skill stata-skill -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install SepineTam/mcp-for-stata stata-skill --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/SepineTam/mcp-for-stata.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/stata-toolbox/skills/stata-skill .claude/skills/stata-skill && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
stata-skill
GitHub stars
264
Token cost
~2.7k tokens
SKILL.md length
1,300 words
Files
9 (incl. references)
Skills in repo
6
Repo updated
First seen
Licence
AGPL-3.0

At a glance

A packaged Stata Runner skill via official MCP-for-Stata server including statado, adopackageinstall, help, readlog and getdatainfo tools.

  • Works in 6 steps: First Encounter with Data → get_data_info → Execute Stata Code → stata_do → Install Third-Party Packages →… → …
  • Need to execute Stata do-file
  • SKILL.md covers Prerequisites, When to Use, Workflow and Typical Workflow, plus 2 more sections
  • Calls uvx

What it does

Stata Skill is an agent skill from SepineTam/mcp-for-stata. A packaged Stata Runner skill via official MCP-for-Stata server including statado, adopackageinstall, help, readlog and getdatainfo tools. Use it when (1) need to execute Stata do-file; (2) missing ado-packages; (3) find code error caused by syntax in Stata; (4) want to read smcl and text format log file with rich text output; (5) first encounter a data file and want to understand its structure and content.

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 10 other files, including reference files (for example `examples/esttab-senior-guidance.md`, `examples/graph-export-guidance.md` and `references/ado_package_install.md`).

It sits in Research & Science, covering Econometrics and empirical research. It works with Model Context Protocol. The repository describes itself as: Stata-MCP: A MCP server for integrating Stata into your agent loop with a safety-first design. The licence is AGPL-3.0.

When your agent uses it

  • Need to execute Stata do-file
  • Missing ado-packages
  • Find code error caused by syntax in Stata
  • Want to read smcl and text format log file with rich text output

Example prompts

  • “/stata-skill”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. First Encounter with Data → get_data_info
  2. Execute Stata Code → stata_do
  3. Install Third-Party Packages → ado_package_install
  4. Look Up Command Documentation → help
  5. Read Execution Log → read_log
  6. Export Tables and Figures → Output Defaults

What it can do on your machine

Read from SKILL.md and the folder at commit d339615. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • uvx

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • aidea-labs.com
    • github.com
    • sepinetam.github.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Stata Skill loads about 2.7k tokens when it runs, and up to ~7.1k if it reads all its reference files. Until then it costs about 107 tokens; SKILL.md has 1,300 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~107
When it runs · the whole SKILL.md, loaded when a task matches
~2.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~7.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from SepineTam/mcp-for-stata at commit d339615, republished under its AGPL-3.0 licence (© SepineTam). 1,300 words, ~2,708 tokens.

Download SKILL.mdSave it as .claude/skills/stata-skill/SKILL.md (or your agent's skills folder). This skill also uses 8 other files; get the full folder from GitHub.
name
stata-skill
description
A packaged Stata Runner skill via official MCP-for-Stata server including stata_do, ado_package_install, help, read_log and get_data_info tools. Use it when (1) need to execute Stata do-file; (2) missing ado-packages; (3) find code error caused by syntax in Stata; (4) want to read smcl and text format log file with rich text output; (5) first encounter a data file and want to understand its structure and content.
metadata.version
1.1.0

MCP-for-Stata

Official plugin for MCP-for-Stata maintained in collaboration with SepineTam.

MCP-for-Stata (Stata-MCP) is an MCP (Model Context Protocol) server that exposes Stata's statistical and econometric capabilities to LLMs. This toolset supports executing do-files, querying data file structures, installing ado packages, reading Stata logs, and looking up command documentation.

Prerequisites

This skill requires the MCP-for-Stata server to be installed and running. If you have not configured it yet, follow @references/installation.md. After installation, verify with uvx stata-mcp doctor. Restart your AI client after installation (required for the first-time setup).

When to Use

Trigger this skill when the user mentions any of the following scenarios:

  • Needs to execute a Stata do-file for regression or statistical analysis
  • Encounters a Stata syntax error and needs to troubleshoot or verify command usage
  • Needs to install third-party ado packages (e.g., outreg2, reghdfe, estout)
  • First encounters a data file and wants to quickly understand its variable structure and distribution
  • Needs to read a Stata execution log (.log or .smcl)
  • Needs to look up the official documentation and syntax for a Stata command

Workflow

1. First Encounter with Data → get_data_info

When the user provides a data file path (.dta, .csv, .xlsx, .sav) or says "look at this data," call get_data_info first.

Key points:

  • data_path: absolute path to the data file
  • vars_list: if the user only cares about specific variables, pass a list of variable names; otherwise omit (defaults to all)
  • head: defaults to 0 (no preview rows). Only set to a positive integer when the user explicitly asks to see rows

Return value includes: data source, number of observations, variable list, variable types, and descriptive statistics (mean, standard error, min, max) for each variable.

Note: results are cached based on MD5 hash of file content. Repeated queries on the same file hit the cache.


2. Execute Stata Code → stata_do

When the user asks to run Stata commands, perform regression analysis, generate graphs, process data, etc., call stata_do.

Pre-requisites:

  1. Write Stata code into a .do file (using the Write tool)
  2. Confirm the file path is within an allowed directory (<WORKING_DIR>/.statamcp/stata-mcp-dofile/ or <WORKING_DIR>)
  3. Call stata_do(dofile_path=..., log_file_name=...)

Key parameters:

  • dofile_path: absolute path to the do-file
  • log_file_name: custom log filename without timestamp, optional
  • read_log_when_error: defaults to false. When true, only returns log content when Stata returns an error code (e.g., r(198))
  • enable_smcl: defaults to true, also generates .smcl log (Unix only)

Return value: log_file_path (text and smcl paths); may contain log_content on error.

Notes:

  • Security guard is enabled by default and blocks dangerous commands (shell, erase, rm, !, etc.)
  • Do-file must be within a whitelisted directory; otherwise execution is rejected
  • SMCL log preserves hyperlinks from commands like findsj and getiref (Unix only)

3. Install Third-Party Packages → ado_package_install

Treat ado_package_install as a high-risk, opt-in tool. Do not call it merely because a command is missing. First identify the exact package and source, then ask the user to approve that package and source. The MCP tool is available only when the operator starts the MCP server with the unsafe profile.

Key parameters:

  • package: package name. For GitHub source, use "user/repo" format
  • source: "ssc" (default), "github", or "net"
  • is_replace: defaults to false
  • package_source_from: required only when source="net", specifies a validated HTTPS URL

Authorization and validation: SSC and net package names may contain only ASCII letters and numbers. GitHub repositories must use owner/repository format and match the exact repository allowlist. Unknown sources, local paths, IP hosts, credentials, queries, fragments, and non-default ports are rejected. The MCP client will ask the user to approve the exact request during the tool call; do not attempt to bypass or pre-answer it. The Python API does not require caller confirmation. The CLI prompts unless -y or --yes is supplied.

Examples:

  • ado_package_install("outreg2") — request approval to install an SSC package
  • ado_package_install("SepineTam/TexIV", source="github") — request approval to install an allowlisted GitHub repository

Note: GitHub repository contents receive no security protection. Inspect the repository before installation. The tool never installs the GitHub helper. Successful installs automatically attempt help(..., replace=true) for the likely command name; if the package exposes other commands, refresh those commands explicitly.


4. Look Up Command Documentation → help

When the user asks about the syntax, options, or usage of a Stata command, or wants to verify a command before troubleshooting an error, call help.

Key parameter:

  • cmd: Stata command name (e.g., "regress", "describe", "xtset")
  • replace: defaults to false. When true, bypasses cached help and refreshes it from Stata

Return value: Stata help text string. A cache hit is prefixed with Saved result for {cmd} or Cached result for {cmd}.

Notes:

  • Unix only (macOS/Linux), not available on Windows
  • Enabled project and global caches are considered, and the newest non-empty result is returned
  • If cached content seems stale or incorrect, call help(cmd=..., replace=true) to refresh it

Show full SKILL.md (518 more words)Show less
5. Read Execution Log → read_log

When the user asks to view a Stata execution log, analyze output results, or wants to inspect the full log after stata_do execution, call read_log.

Key parameters:

  • file_path: absolute path to the log file
  • output_format: "core" (default, removes framework lines), "dict" (structured command-result pairs), or "full" (all original content)
  • lines: content truncation. 0 returns all; positive returns first N items; negative returns last |N| items

Notes:

  • File must be within <WORKING_DIR>/<FOLDER_TAG>/ (security boundary)
  • Structured parsing is controlled by [BETA] enable_structured_log and is disabled by default

6. Export Tables and Figures → Output Defaults

When the user has NOT specified how an output should be produced, apply these presets — do not ask, do not invent alternatives. An explicit user request always overrides them.

OutputDefaultDetailed example
Regressionreghdfe with fixed effects in absorb() and vce(cluster <id>) at the treatment/assignment level; never regress when fixed effects are involved, never reflex , robust@examples/esttab-senior-guidance.md (setup section also covers reghdfe/ftools installation)
Regression tablesesttab (from estout), .tex with label booktabs fragment for papers, .rtf/.csv for quick sharing@examples/esttab-senior-guidance.md
Figuresgraph export name.png, width(2000) replace; PDF only for LaTeX papers@examples/graph-export-guidance.md

Package availability: reghdfe (+ ftools) and estout may not be installed. Check with help(cmd=...); if missing, use ado_package_install per section 3 — never ssc install inside a do-file. If installation is unavailable, tell the user exactly what to install manually.


Typical Workflow

Scenario A: Full Data Analysis Pipeline
  1. get_data_info — explore data structure
  2. Write do-file based on data characteristics (Write tool)
  3. Ask for approval and use ado_package_install; inspect GitHub repositories first
  4. stata_do — execute the do-file
  5. read_log — inspect execution results if needed
Scenario B: Troubleshooting Syntax Errors
  1. help — look up official command documentation (Unix only)
  2. Fix the code in the do-file
  3. stata_do — re-execute to verify
Scenario C: Install and Use a New Package
  1. Confirm the exact package and source with the user
  2. ado_package_install("pkgname") — request approval and install the package
  3. help(cmd="pkg_name", replace=true) — explicitly refresh and check package usage
  4. Use the package commands in the do-file
  5. stata_do — execute

Edge Cases

  • help Unix limitation: not available on Windows; guide users to alternative documentation methods
  • security guard enabled by default: dangerous commands (shell, erase, rm, !) in do-files are blocked. To disable, set STATA_MCP__IS_GUARD=false (not recommended)
  • RAM monitoring disabled by default: to monitor Stata process memory, set STATA_MCP__IS_MONITOR=true and STATA_MCP__RAM_LIMIT
  • path boundary check: do-files and log files must be within whitelisted directories; otherwise execution is rejected
  • SSC installation slow: ado_package_install from SSC source may take time; skip if the package is already installed

References

NameLocationDescription
Installation@references/installation.mdInstallation and configuration guide for MCP-for-Stata
stata_do@references/stata_do.mdDetailed guide for the execution tool
get_data_info@references/get_data_info.mdDetailed guide for the data exploration tool
help@references/help.mdDetailed guide for the documentation tool
read_log@references/read_log.mdDetailed guide for the log reader tool
ado_package_install@references/ado_package_install.mdDetailed guide for the package installer tool
esttab example@examples/esttab-senior-guidance.mdSenior-level example for exporting regression tables
graph export example@examples/graph-export-guidance.mdDefaults and pitfalls example for exporting figures
Documentationsepinetam.github.io/mcp-for-stataFull user documentation
HomepageMCP-for-Stata official websiteProject homepage
Source Codegithub.com/sepinetam/mcp-for-stataGitHub repository

© SepineTam, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 8 other files (references) in plugins/stata-toolbox/skills/stata-skill of SepineTam/mcp-for-stata.

  • SKILL.md
  • examples/esttab-senior-guidance.md
  • examples/graph-export-guidance.md
  • references/ado_package_install.md
  • references/get_data_info.md
  • references/help.md
  • references/installation.md
  • references/read_log.md
  • references/stata_do.md

Open the folder on GitHubat commit d339615

Compare with similar skills

Stata Skill next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Stata Skill compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Stata Skill this skillSepineTam/mcp-for-stata264—~2.7kAutomated safety check: PassAGPL-3.0
Fin Data Acquisitioncsmar432/finai-research109—~2kAutomated safety check: PassMIT
Fin Generate Ideacsmar432/finai-research109—~2.5kAutomated safety check: PassMIT
Fin Idea Discoverycsmar432/finai-research109—~2.7kAutomated safety check: PassMIT
Fin Novelty Checkcsmar432/finai-research109—~1.4kAutomated safety check: PassMIT
Stata Replicationpedrohcgs/claude-code-my-workflow1.7k—~2.1kAutomated safety check: NotesMIT

Similar skills

  • Fin Data Acquisition

    csmar432/finai-research

    根据REFINEDDESIGN.md中的变量定义,自动获取所需数据并生成可执行的回归分析脚本(Python/Stata)。

    109 GitHub stars~2k tokensUpdated 4 days ago
    Research & ScienceAuto-check passed
  • Fin Generate Idea

    csmar432/finai-research

    针对经济金融研究方向的创意生成与评估。生成8-12个可发表的研究idea,过滤后在数据可行的情况下进行小规模实证验证,输出排序后的研究想法报告。

    109 GitHub stars~2.5k tokensUpdated 4 days ago
    Research & ScienceAuto-check passed
  • Fin Idea Discovery

    csmar432/finai-research

    经济金融研究的完整想法发现流程。从研究方向出发,经过文献综述、想法生成、新颖性验证、实证方法设计和数据获取,输出经过数据实证验证的可执行研究方案。

    109 GitHub stars~2.7k tokensUpdated 4 days ago
    Research & ScienceAuto-check passed
  • Fin Novelty Check

    csmar432/finai-research

    验证经济金融研究想法的新颖性。在JF、JFE、RFS、JME等顶刊及arXiv中搜索近三年文献,输出结构化新颖性报告和定位策略。

    109 GitHub stars~1.4k tokensUpdated 4 days ago
    Research & ScienceAuto-check passed
  • Stata Replication

    pedrohcgs/claude-code-my-workflow

    End-to-end Stata replication pipeline — scaffolds numbered .do files in scripts/stata/, executes them via the stata-mcp MCP server, captures logs and outputs to output/, and produces…

    1.7k GitHub stars~2.1k tokensUpdated 12 days ago
    Research & ScienceAuto-check: notes
  • Aer Statspai

    brycewang-stanford/Auto-Empirical-Research-Skills

    A skill your agent uses when aer-identification has fixed the design, after methodology choice and before aer-robustness or aer-tables-figures, to run an AER-track analysis with StatsPAI — the…

    4.6k GitHub stars~3k tokensUpdated 5 days ago
    Research & ScienceAuto-check passed

More from SepineTam/mcp-for-stata

  • Stata Audit

    SepineTam/mcp-for-stata

    Inspect, validate, summarize, and render local Stata-MCP audit evidence under .statamcp.

    264 GitHub stars~1.2k tokensUpdated 4 days ago
    Auto-check passed
  • Diagnostic Dofile

    SepineTam/mcp-for-stata

    A skill your agent uses when the user needs to inspect, audit, or diagnose the safety of a Stata do-file.

    264 GitHub stars~1.2k tokensUpdated 4 days ago
    Auto-check passed
  • MCP Smoke Test

    SepineTam/mcp-for-stata

    Run a local smoke test for the Stata-MCP server. An agent skill from SepineTam/mcp-for-stata.

    264 GitHub stars~1.4k tokensUpdated 4 days ago
    Auto-check passed
  • Stata Discover

    SepineTam/mcp-for-stata

    A skill your agent uses when you need to find Stata on the user's machine or configure stata-mcp to use it.

    264 GitHub stars~1.7k tokensUpdated 4 days ago
    Auto-check passed
  • Rfc Impl Generator

    SepineTam/mcp-for-stata

    Generate RFC and IMPL documents from a user-provided feature/fix description.

    264 GitHub stars~1.1k tokensUpdated 4 days ago
    Auto-check passed

Questions about Stata Skill

What does Stata Skill do?

A packaged Stata Runner skill via official MCP-for-Stata server including statado, adopackageinstall, help, readlog and getdatainfo tools. Stata Skill is an agent skill from SepineTam/mcp-for-stata. A packaged Stata Runner skill via official MCP-for-Stata server including statado, adopackageinstall, help, readlog and getdatainfo tools.

When should I use Stata Skill?

Stata Skill fits situations like: need to execute Stata do-file; missing ado-packages; find code error caused by syntax in Stata; want to read smcl and text format log file with rich text output.

How do I install Stata Skill in Claude Code?

Run `npx skills add SepineTam/mcp-for-stata --skill stata-skill -a claude-code`. Or copy the skill folder (plugins/stata-toolbox/skills/stata-skill in SepineTam/mcp-for-stata) into .claude/skills/stata-skill in your project. Claude Code loads it when a task matches its description.

How do I install Stata Skill in Codex?

Run `npx skills add SepineTam/mcp-for-stata --skill stata-skill -a codex`. Or copy the skill folder (plugins/stata-toolbox/skills/stata-skill in SepineTam/mcp-for-stata) into .agents/skills/stata-skill in your project. Codex loads it when a task matches its description.

Can I use Stata Skill in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add SepineTam/mcp-for-stata --skill stata-skill -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/stata-skill, .gemini/skills/stata-skill, .github/skills/stata-skill and .opencode/skills/stata-skill in your project.

What does Stata Skill need to run?

Going by SKILL.md and its folder, Stata Skill needs the command-line tools its instructions call (uvx). Our summary lists: Python 3.

Does Stata Skill access the network?

SKILL.md names 3 domains. As links in the text: aidea-labs.com, github.com and sepinetam.github.io. This is read from the text; nothing was executed.

Is Stata Skill safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Stata Skill use?

Stata Skill is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Stata Skill use?

About 2.7k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4.4k tokens, read only when the agent opens those files.

What are the alternatives to Stata Skill?

Skills that share tags, products or a category with Stata Skill: Fin Data Acquisition (csmar432/finai-research, 109 stars), Fin Generate Idea (csmar432/finai-research, 109 stars), Fin Idea Discovery (csmar432/finai-research, 109 stars) and Fin Novelty Check (csmar432/finai-research, 109 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Stata Skill?

SepineTam (a GitHub user) maintains it in SepineTam/mcp-for-stata, which has 264 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on October 6, 2026.

Source: SepineTam/mcp-for-stata on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.