Discovers Stata executables on the user's machine and configures stata-mcp to use the most suitable version. Useful for first-time setup or when Stata CLI cannot be found.
Ships in stata-toolbox. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Users need Stata to run stata-mcp, but Stata is not always installed in a default location. This skill discovers which Stata executables/versions exist on the user's device and configures stata-mcp to use the most suitable one.
All commands below use uvx stata-mcp; if stata-mcp is already installed, the bare stata-mcp command works the same way.
stata-mcp yetstata_do or stata-mcp doctor reports that the Stata CLI cannot be foundstata-mcpList all Stata installations on the machine:
uvx stata-mcp discover
PATH, and the STATA_CLI environment variable.app bundle path (e.g. /Applications/StataNow/StataMP.app), but STATA_CLI requires the CLI binary inside the bundle: append /Contents/MacOS/<binary>, where <binary> is usually stata-<edition> such as stata-mp (StataNow bundles may name it StataMP instead — check the directory). Full example: /Applications/StataNow/StataMP.app/Contents/MacOS/stata-mpIndependently, Stata-MCP ships a built-in StataFinder (src/stata_mcp/stata/stata_finder/). When STATA_CLI is not configured, it automatically discovers the best Stata executable and caches the result into the config file — no manual step needed.
Search locations per platform:
| Platform | Search locations |
|---|---|
| macOS | /usr/local/bin (stata-mp / stata-se / stata-be / stata); Stata*.app under /Applications and ~/Applications (version read from the isstata.* file inside the app) |
| Windows | Stata* directories under Program Files and Program Files (x86) on C:\ and D:\, plus other available drives |
| Linux | /usr/local/bin and its subdirectories whose names contain "stata" |
When multiple Stata installations exist, auto-detection picks by:
mp > se > be > ic > default19.5 are supported; an undetectable version counts as 99, i.e. treated as the current default version)Inspect the currently resolved Stata CLI:
uvx stata-mcp config show cli # value persisted in the config file
uvx stata-mcp doctor --check stata_cli # effective path and its source (from env / from config / auto-detected)
After picking a version from the discover list, persist it with uvx stata-mcp config set cli <path> (see the next section).
At runtime, Stata-MCP resolves STATA_CLI in this order: config file > STATA_CLI environment variable > auto-detection (the detected result is written back to the user config file as a cache to speed up later startups).
uvx stata-mcp config set cli # auto-detect the best edition and persist it
uvx stata-mcp config set cli /Applications/StataNow/StataMP.app/Contents/MacOS/stata-mp # macOS example
uvx stata-mcp config set cli "C:\Program Files\Stata18\StataMP-64.exe" # Windows example
uvx stata-mcp config edit STATA.STATA_CLI /path # modify an existing config entry
This writes to the [STATA] section of ~/.statamcp/config.toml and applies to all projects.
Create .statamcp/config.toml in the project root:
[STATA]
STATA_CLI = "/path/to/stata-mp"
For ordinary settings the project file overrides the user file, which suits projects that must pin a specific Stata version.
Use the STATA_CLI environment variable, effective for the current command only:
STATA_CLI=/path/to/stata-mp uvx stata-mcp doctor
Caveat: if STATA_CLI is already persisted in a config file, the runtime prefers the config file value and the environment variable has no effect. Before relying on a temporary override, confirm with uvx stata-mcp config show cli that the config file has no value, or use config set cli instead.
There is no config unset command. To return to auto-detection, manually remove the STATA_CLI key from the [STATA] section of ~/.statamcp/config.toml (and any project-level .statamcp/config.toml).
uvx stata-mcp doctor
The command is identical on Windows / macOS / Linux. Doctor runs 12 checks (os, python, uv, dependencies, stata_cli, stata_execution, config, working_dir, guard, monitor, pypi, cleanup). Useful flags:
--check stata_cli --check stata_execution: run only Stata-related checks (--check is repeatable)--verbose: show details of each check--json: machine-readable outputDoctor's stata_execution check actually launches Stata and runs display "Stata-MCP Doctor Test" and exit, STATA (stdin pipe on Unix, /e do batch mode on Windows, 15-second timeout on both). A pass means the Stata CLI can execute commands.
For an end-to-end verification, run a real do-file:
uvx stata-mcp tool do path/to/test.do
Or call the stata_do tool from an MCP client (run uvx stata-mcp install first to write the client config, and restart the client after the first-time setup).
discover prints nothing: Stata is likely installed in a non-standard location. Ask the user for the installation path, verify the binary exists and is executable, then config set cli <path>.stata_cli FAILs: no usable path from env, config, or auto-detection — set one via config set cli or STATA_CLI.stata_execution times out (>15s): usually a license dialog or first-launch prompt blocking Stata startup. Open the Stata GUI once to complete activation, then re-run doctor.config show cli and clear it if needed (see "Reset to auto-detection").What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/stata-toolbox:stata-discoverfrom stata-toolbox
npx claudepluginhub sepinetam/mcp-for-stata --plugin stata-toolbox4 skills in this plugin
/diagnostic-dofileUse this skill when the user needs to inspect, audit, or diagnose the safety of a Stata do-file. Typical scenarios include: uncertainty about whether a .do file is safe; receiving a complete do-file from an unofficial source (not the Stata website, not a well-known academic institution or professor's official site); asking to check a batch of do-files; or requesting a read-only security/risk/portability diagnostic report. The skill does not modify the original file; it only emits a JSON report. Note that this is not a mandatory step for every do-file; run it only when a security review is warranted.
/stata-auditInspect, validate, summarize, and render local Stata-MCP audit evidence under .statamcp. Use when a user asks what tools ran, whether a security guard blocked anything, how one run links across JSONL files, whether snapshots are intact, or wants an interactive audit dashboard./stata-skillA 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.
2 plugins ship this exact skill · first indexed Oct 1, 2026
Other plugins' skills for the same job