SepineTam/mcp-for-stata / plugins/stata-toolbox/skills/stata-skill
stata-skill
FlaggedA 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.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 10.6 KB |
| examples/esttab-senior-guidance.md | markdown | 3.6 KB |
| examples/graph-export-guidance.md | markdown | 1.9 KB |
| references/ado_package_install.md | markdown | 4.2 KB |
| references/get_data_info.md | markdown | 4.0 KB |
| references/help.md | markdown | 2.4 KB |
| references/installation.md | markdown | 2.5 KB |
| references/read_log.md | markdown | 2.4 KB |
| references/stata_do.md | markdown | 2.6 KB |
references/ado_package_install.md
View on GitHub# `ado_package_install`
Install a Stata ado package from SSC, GitHub, or net sources.
## Parameters
| Parameter | Type | Required | Default | Description |
|:---|:---|:---|:---|:---|
| `package` | `str` | Yes | — | Package name. For GitHub, use "user/repo" format |
| `source` | `"ssc" \| "github" \| "net"` | No | `"ssc"` | Package source |
| `is_replace` | `bool` | No | `false` | Force reinstallation if already present |
| `package_source_from` | `str \| None` | No | `None` | Validated HTTPS URL required for `source="net"` |
## Input Validation
- The operator must enable installation and start the MCP server with the unsafe profile
- 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
- `source` must be exactly `ssc`, `github`, or `net`; unknown values are rejected
- Local paths, IP hosts, credentials, queries, fragments, and non-default ports are rejected
- Every MCP call elicits approval from the user through the client and fails closed without it
- The Python API does not require caller confirmation
- The CLI prompts interactively unless `-y` or `--yes` is supplied
- Validation occurs again immediately before the installer sends a command to Stata
## Operator Setup
Configure the GitHub repository allowlist in `~/.statamcp/config.toml`. To
expose the MCP tool, start the MCP server with
`stata-mcp server --unsafe`. The plugin's default MCP configuration does not
expose this high-risk tool.
```toml
[SECURITY]
ADO_INSTALL_ALLOWED_GITHUB_REPOSITORIES = ["SepineTam/TexIV"]
```
## Returns
String containing the Stata installation log.
## Sources
### SSC (Statistical Software Components)
The default and most common source. Hosted by Boston College.
```python
ado_package_install("outreg2")
ado_package_install("reghdfe")
ado_package_install("estout", is_replace=false)
```
**Note:** SSC installations can be slow due to network latency. If the package is likely already installed, consider asking the user before installing.
### GitHub
For packages distributed via GitHub repositories.
```python
ado_package_install("SepineTam/TexIV", source="github")
```
**Note:** The package repository must follow Stata package conventions with a valid `.pkg` file.
GitHub repository contents receive no security protection. Inspect the repository
before installation.
### Net
For packages hosted on HTTPS web servers. Local directories are rejected.
```python
ado_package_install("mypackage", source="net", package_source_from="https://example.com/stata")
```
## When to Use
- Before running commands that require third-party packages
- When the user mentions a command does not exist or is not recognized
- When setting up a new analysis environment
## Platform Differences
| Platform | SSC | GitHub | Net |
|:---|:---|:---|:---|
| macOS | Native CLI | Native CLI | Native CLI |
| Linux | Native CLI | Native CLI | Native CLI |
| Windows | Do-file delegation | Do-file delegation | Do-file delegation |
On Windows, package installation is handled by writing and executing a temporary do-file, which may be slower than native CLI installation on Unix.
## Post-Installation
The tool does not implicitly install the GitHub helper. After a successful
install, it attempts to refresh help with `replace=true` for the likely command
name: the SSC/net package name, or the GitHub repository name. Refresh failure
does not make the completed installation fail. If the package exposes commands
with different names, call `help(cmd="command_name", replace=true)` explicitly
for those commands.
## Example
```python
# Install outreg2 from SSC
ado_package_install("outreg2")
# Install from GitHub without overwriting
ado_package_install("user/repo", source="github", is_replace=false)
# Install from a custom URL
ado_package_install("custompkg", source="net", package_source_from="https://site.example/stata")
```
## Common Packages
| Package | Source | Purpose |
|:---|:---|:---|
| `outreg2` | SSC | Regression output tables |
| `reghdfe` | SSC | High-dimensional fixed effects regression |
| `estout` | SSC | Export estimation results |
| `ftools` | SSC | Faster Stata tools (dependency for reghdfe) |
| `ivreg2` | SSC | Extended instrumental variables regression |
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |