Borrowing it
Nothing to install: this file belongs to aliveranme/stata-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/aliveranme/stata-mcp/master/.claude/skills/stata/SKILL.mdgit clone --depth 1 https://github.com/aliveranme/stata-mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/aliveranme/stata-mcp/stata)<a href="https://agentmods.dev/skills/aliveranme/stata-mcp/stata"><img src="https://agentmods.dev/badge/skills/aliveranme/stata-mcp/stata/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/aliveranme/stata-mcp/stata"><img src="https://agentmods.dev/badge/skills/aliveranme/stata-mcp/stata.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00281 | $0.08336 |
| Opus 5.5 | $0.00112 | $0.03334 |
| Sonnet 5.5 | $0.00056 | $0.01667 |
| Haiku 4.5 | $0.00028 | $0.00834 |
Grade A, and why
stata scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 486 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Stata 数据分析与计量经济学编程
概述
此 Skill 指导你撰写正确的 Stata 命令和 do 文件,并通过 MCP Server (stata)
在本地 StataNow 19 MP 环境中实时执行。你可以独立完成数据加载、清洗、分析、
结果输出全流程。
MCP Server 信息:
- 名称:
stata,75 个工具覆盖数据管理/生成、数据清洗、探索、估计、后估计、图形导出、文件资源回传、包管理与帮助、会话生命周期、长任务控制;stata_run+stata_help覆盖全部内置命令 - Stata 版本:StataNow 19 / Stata 18+(取决于安装的版本)
- 连接方式:本地 stdio,通过 pystata 直接调用 DLL
- 会话持久:Stata 在服务器启动时初始化一次,所有命令共享同一会话。
数据加载后会一直保留在内存中,直到被
clear或替换 - 协议版本:MCP initialize 协商支持 2024-11-05 ~ 2025-11-25(未知版本回退最新);
serverInfo.version反映项目版本(当前 1.0.10),不是 fastmcp 框架版本
核心原则
每次分析前
- 先了解数据 — 使用
stata_describe和stata_codebook查看变量信息 - 变量名大小写敏感 —
mpg和MPG是不同的变量 - 路径用正斜杠 —
D:/data/file.dta,不要用反斜杠 - 带空格的路径用双引号包裹 —
use "D:/my data/file.dta", clear - 检查返回值 — 用
stata_display查看r(mean)、e(N)、e(r2)等 - 限制输出大小 — 永远不要执行
list而不限制观测数(见下方「输出大小控制」)
命令执行策略
- 单次查询 → 使用专用工具(
stata_summarize、stata_tabulate等,输出紧凑) - 多步骤流程 → 使用
stata_run,用\n连接多条命令 - 已有 .do 文件 → 使用
stata_run_do_file - 每次
stata_run应包含逻辑完整的一组命令,避免零碎调用 - 多命令链首错即停:链中某条命令报错(变量名拼错、数据未加载、语法错)会中止
后续命令并指出第一条错误 —— 这是刻意行为(对齐 Stata do 文件语义),防止后续
命令在上一个错误状态上继续跑、覆盖磁盘数据。需要「跳过失败继续」时用
capture包裹期望失败的命令。报错后先看第一条错误信息定位问题,再修正重跑,不要盲目重发整条链
输出大小控制(重要!)
始终在产生输出的命令中限制范围,避免生成几万字符的原始输出(硬上限 120K, 超出部分真的被丢弃,翻页也找不回):
| 命令 | 不推荐(输出过大) | 推荐(限制输出) |
|---|---|---|
list |
list — 输出全部 74 条,40K 字符 |
list in 1/10 — 只显示前 10 条 |
summarize |
无限制 — 通常安全 | summarize varlist if condition |
tabulate |
无限制 — 通常安全 | tabulate var in 1/100 |
browse |
不可用(GUI 命令) | 改用 list in 1/N |
describe |
永远安全 | — |
分页工作流:
1. stata_list(n=10) → 先看前 10 条了解数据结构
2. stata_summarize() → 用描述统计看整体
3. stata_list(in_range="1/l") → 确实需要全部数据时,会自动分页
4. stata_more(page=2) → 翻页浏览
经验法则:
- 观测数 < 50:
list全部输出通常 OK - 观测数 50-500:
list in 1/20预览 +summarize+codebook了解全貌 - 观测数 > 500:只用
summarize、tabulate、codebook,避免用list - 回归/检验命令的输出通常不会过大,无需限制
What ships with it
3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 486 lines · 281 tokens per session scan A 4207419188fe
stata is a skill published in the GitHub repository aliveranme/stata-mcp (0 stars, last pushed 2mo ago), licensed MIT. It adds 281 tokens to every session and 8,336 once invoked, about $0.0011 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
stata compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| stataaliveranme/stata-mcp | Skill | 0 | 2mo ago | MIT | A | 281 | Claude Code |
| instrument-data-to-allotropeanthropics/knowledge-work-plugins | Skill | 35k | 2d ago | Apache-2.0 | A | 123 | Claude Code |
| exploratory-data-analysisK-Dense-AI/scientific-agent-skills | Skill | 56k | 4d ago | MIT | A | 83 | Claude Code |
| matlabK-Dense-AI/scientific-agent-skills | Skill | 56k | 4d ago | MIT | A | 44 | Claude Code |
| phylogeneticsK-Dense-AI/scientific-agent-skills | Skill | 56k | 4d ago | MIT | A | 71 | Claude Code, Codex |
| research-engineerdavila7/claude-code-templates | Skill | 33k | yesterday | MIT | A | 43 | Claude Code, Codex |
| mapping-to-snomedmaziyarpanahi/openmed | Skill | 5.8k | yesterday | Apache-2.0 | A | 205 | Claude Code |