stata-code-generator

stata-code-generator is an agent for Claude Code from SepineTam/mcp-for-stata. It costs 119 tokens per session (2,385 once invoked), scanned A, original, AGPL-3.0.

An agent for writing and running Stata code, where Stata is software for statistical data analysis. It drafts a do-file, runs it through Stata tools, checks the log, fixes errors, and verifies the resulting analysis.

In plain words
What is it for?
Use it for data cleaning, merging datasets, statistical analysis, regression tables, and figures, with the results checked through the execution log.
Why use it?
It handles the repeated cycle of writing code, examining execution errors, and rerunning the work instead of stopping after producing an untested script.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the stata-toolbox plugin — 4 skills, 1 agent shipped together

Good fit Use it for data cleaning, merging datasets, statistical analysis, regression tables, and figures, with the results checked through the execution log.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/sepinetam/mcp-for-stata/stata-code-generator
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/SepineTam/mcp-for-stata

Made for: Claude Code.

Or install stata-toolbox, the plugin that ships this one along with the rest of its 4 skills, 1 agent.

Wrote 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.

agentmods badge for stata-code-generator

README.md
[![agentmods](https://agentmods.dev/badge/agents/sepinetam/mcp-for-stata/stata-code-generator/github.svg)](https://agentmods.dev/agents/sepinetam/mcp-for-stata/stata-code-generator)
Your own site
<a href="https://agentmods.dev/agents/sepinetam/mcp-for-stata/stata-code-generator"><img src="https://agentmods.dev/badge/agents/sepinetam/mcp-for-stata/stata-code-generator/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.

agentmods 80×15 button for stata-code-generator

Your own site · 80×15
<a href="https://agentmods.dev/agents/sepinetam/mcp-for-stata/stata-code-generator"><img src="https://agentmods.dev/badge/agents/sepinetam/mcp-for-stata/stata-code-generator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 119 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,385 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin unknown No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00119 $0.02385
Opus 5.5 $0.00048 $0.00954
Sonnet 5.5 $0.00024 $0.00477
Haiku 4.5 $0.00012 $0.00238

Measured 24d ago against content hash 332722527c70, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

stata-code-generator 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 24d 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.

plugins/stata-toolbox/agents/stata-code-generator.md · 202 lines

The source is not reproduced here

Licensed AGPL-3.0

The repository is licensed AGPL-3.0, which this catalogue does not treat as permission to reproduce the file. Read it at the source.

Read it on GitHub

Changes

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.

  1. 24d ago First seen · 202 lines · 119 tokens per session scan A 332722527c70

Subscribe to this mod's changes

stata-code-generator is an agent published in the GitHub repository SepineTam/mcp-for-stata (267 stars, last pushed 2d ago), licensed AGPL-3.0. It adds 119 tokens to every session and 2,385 once invoked, about $0.0005 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-09-27.

Related

Other agents, from other repositories

stata-analyst

End-to-end statistical analysis agent for Stata. Handles the full workflow from data loading through estimation, results retrieval, and graph export. Invoke when user wants a complete analysis, asks to "run a regression", "analyze this dataset", or describes a multi-step econometric workflow.

tmonk/mcp-stata · 62 tokens

stata-publication-reviewer

Specialist agent for publication-ready Stata outputs. Invoke when the user needs a hard-nosed review of tables, figures, model notes, or appendix materials before sharing them with coauthors, seminar audiences, or referees.

tmonk/mcp-stata · 51 tokens

stata-replication-lead

Specialist agent for replication, robustness, and multi-specification evidence gathering in Stata. Invoke when the user needs a paper result reproduced, a pipeline rerun, or a structured robustness campaign.

tmonk/mcp-stata · 46 tokens

editor

Journal editor who desk-reviews manuscripts, selects two referees with deliberately different dispositions, calibrates to a target journal from .claude/references/journal-profiles.md, and synthesizes an editorial decision (FATAL / ADDRESSABLE / TASTE). Used by /review-paper --peer [journal].

pedrohcgs/claude-code-my-workflow · 64 tokens

sim-reviewer

Monte Carlo simulation reviewer. Checks the parts of a simulation study that general R review misses — the assumption regime a run is in, DGP/estimand alignment, replication budget and Monte Carlo standard error, coverage computed against the truth, parallel-seed discipline, and whether headline simulation claims…

pedrohcgs/claude-code-my-workflow · 95 tokens

community-ecologist

Reasons from Vellend's four processes and Chesson stabilizing/equalizing coexistence through PERMANOVA/betadisper, betapart turnover–nestedness, Gotelli SIM9/C-score null models, and vegan/entropart/picante pipelines while treating compositional closure, dispersion heterogeneity, and pseudoreplicated quadrats as…

K-Dense-AI/scientific-agents · 81 tokens