STATA-MCP Repro
This server provides tools for reproducible Stata execution with project-local management, strong provenance, immutability, and approval controls.
Project management:
project_initinitializes a project with a human-readable artifact directory;project_statusinspects project, Stata, backend, and capabilities.Analysis planning:
plan_preparecreates/updates a privacy-safe draft plan;plan_approvefreezes and cryptographically locks a plan with explicit approval evidence (approver, SHA-256 hash).Run lifecycle:
run_preparecreates an immutable, descriptively named run;run_executeruns it synchronously or in background with optional timeout;run_statusreads lifecycle state;run_controlcancels active background runs.Data & artifacts:
data_inspectshows dataset metadata, missingness, labels, and previews;artifact_readreads bounded text or image artifacts;results_getreturns typed structured results;graph_getlists or reads verified graph payloads.Stata help:
stata_helpretrieves command documentation from the local installation.Deprecated legacy tools (scheduled for removal at v0.3.0):
stata_do,get_data_info,help,read_log,write_dofile,append_dofile,read_file,load_figure,mk_dir— all replaced by the above tools.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@STATA-MCP Repro Run my approved plan for the cohort analysis and show the key results."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
STATA-MCP
Project-local, reproducible Stata execution for humans and AI agents. Every managed analysis stays beside its source project and produces immutable, readable do-files, logs, results, graphs, and provenance.
Why this exists
Existing Stata MCP servers prove that agents can call Stata. STATA-MCP Repro adds the controls required for real research: explicit project ownership, deterministic planning gates, immutable run identity, process-tree cancellation, typed results, graph provenance, safe migration, and one shared human/agent ledger.
Core guarantees:
startup never creates a workspace;
no forced
stata-mcp-folderand no copied central archive;one
.stata-mcp.tomlselects a human-readable project-relative artifact directory;run names are descriptive and collision-safe;
completed runs are immutable and every artifact is SHA-256 bound to its run;
medical and other material analyses require a reviewed, approved plan;
dashboard listens only on
127.0.0.1with an expiring bearer token;humans and agents create the same canonical run records.
Related MCP server: Stata MCP Server
Start
Prerequisites: Python 3.11–3.13, a separately licensed Stata installation, and uv.
git clone https://github.com/taewat07/STATA-MCP-AGENT.git
cd STATA-MCP-AGENT
uv tool install .
stata-mcp install --all
cd "/path/to/research-project"
stata-mcp project init --artifact-dir "analysis/stata" --name "Readable study name"
stata-mcp doctorRestart the AI client after installation. Use stata-planner to inspect and approve a material analysis, then stata-analyst to execute it. Humans can inspect the same ledger with:
stata-mcp dashboard --project .The command prints the loopback URL and a short-lived token. The VS Code client connects to this service; it never starts or stops the MCP server.
Documentation
Read the installation guide, architecture, human and agent workflows, provenance contract, and security model. Legacy users should follow the copy-first migration guide.
Contributions follow CONTRIBUTING.md, the Code of Conduct, and the public security policy.
Status and attribution
Pre-release 0.1.x; APIs may change under the documented two-release deprecation policy. Derived from SepineTam's MCP-for-Stata 1.21.3; see THIRD_PARTY_NOTICES.md. Not affiliated with or endorsed by StataCorp LLC. Licensed AGPL-3.0-or-later.
Available Tools
22 toolsappend_dofileD
Deprecated: create an immutable child run with run_prepare.
Inputs: content (required), run_name (required), original_dofile_path (required), intent, +3 more. Returns: ok, run, data, error, +1 more
artifact_readA
Read one bounded text or image artifact belonging to a run.
Inputs: run_id (required), relative_path (required), max_bytes, project_path. Returns: ok, run, data, error, +1 more
data_inspectB
Inspect dataset metadata, missingness, labels, and bounded previews.
Inputs: data_path (required), variables, preview_rows, project_path. Returns: ok, run, data, error, +1 more
get_data_infoC
Deprecated: use data_inspect.
Inputs: data_path (required), head, vars_list, project_path. Returns: ok, run, data, error, +1 more
graph_getB
List run graphs or read one bounded, verified graph payload.
Inputs: run_id (required), max_bytes, project_path, relative_path. Returns: ok, run, data, error, +1 more
helpB
Deprecated: use stata_help.
Inputs: command (required), project_path. Returns: ok, run, data, error, +1 more
load_figureC
Deprecated: use artifact_read.
Inputs: figure_path (required), max_bytes, project_path. Returns: ok, run, data, error, +1 more
mk_dirD
Removed: initialize a project once; server owns artifact directories.
Inputs: path (required). Returns: ok, run, data, error, +1 more
plan_approveB
Freeze a ready analysis plan with explicit approval evidence.
Inputs: plan_id (required), approved_by (required), approval_statement (required), expected_plan_sha256 (required), +1 more. Returns: ok, run, data, error, +1 more
plan_prepareC
Create or update a privacy-safe draft analysis plan.
Inputs: draft (required), plan_id, project_path, dataset_profile, +1 more. Returns: ok, run, data, error, +1 more
project_initC
Initialize one project with a human-readable relative artifact path.
Inputs: artifact_dir (required), project_name, project_path. Returns: ok, run, data, error, +1 more
project_statusC
Inspect selected project, Stata, backend, and capabilities.
Inputs: project_path. Returns: ok, run, data, error, +1 more
read_fileD
Deprecated: use artifact_read.
Inputs: file_path (required), max_bytes, project_path. Returns: ok, run, data, error, +1 more
read_logC
Deprecated: use artifact_read.
Inputs: file_path (required), max_bytes, project_path. Returns: ok, run, data, error, +1 more
results_getB
Return typed structured results bound to one finalized run.
Inputs: run_id (required), project_path. Returns: ok, run, data, error, +1 more
run_controlB
Request cancellation of one active background run.
Inputs: action (required), run_id (required), project_path. Returns: ok, run, data, error, +1 more
run_executeB
Execute one prepared run synchronously or in the background.
Inputs: run_id (required), background, project_path, timeout_seconds. Returns: ok, run, data, error, +1 more
run_prepareA
Create an immutable, descriptively named run without executing it.
Inputs: intent (required), run_name (required), dofile_content (required), plan_id, +5 more. Returns: ok, run, data, error, +1 more
run_statusB
Read durable lifecycle state and provenance paths for one run.
Inputs: run_id (required), project_path. Returns: ok, run, data, error, +1 more
stata_doC
Deprecated: prepare and execute a project-local run.
Inputs: dofile_path (required), intent, plan_id, run_name, +3 more. Returns: ok, run, data, error, +1 more
stata_helpB
Retrieve Stata command documentation through licensed local Stata.
Inputs: command (required), project_path. Returns: ok, run, data, error, +1 more
write_dofileC
Deprecated: use run_prepare.
Inputs: content (required), run_name (required), intent, plan_id, +2 more. Returns: ok, run, data, error, +1 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 22 tools
Active tools have distinct purposes across planning, project management, run lifecycle, data inspection, and output retrieval. Deprecated tools are clearly labeled with redirecting messages, so misselection is unlikely despite some overlap in names.
All tools use snake_case, but there is a clear split: active tools favor object_verb naming (e.g., run_prepare, data_inspect) while deprecated tools use verb_object naming (e.g., write_dofile, read_file). This mixed pattern reduces readability, though deprecated markers mitigate confusion.
The total of 22 tools is heavy, and 9 of them are deprecated, artificially inflating the surface. The active 13 tools form a well-scoped set, but the obsolete entries should be removed to bring the count into an ideal range.
The active tool chain covers the full reproducibility lifecycle: plan preparation and approval, project initialization, run preparation/execution/monitoring, and artifact retrieval. Minor gaps like lack of list operations for runs or projects are workable.
Maintenance
Related MCP Connectors
Shared project docs, task planning and GitHub evidence for people and their AI agents.
AI-native programming language and toolchain for accountable, verifiable agent-driven development.
Project management shared by people and AI agents, with persistent project state through MCP.
Durable, shareable and governed project memory with smart triage and explicit project composition.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceProvides a bridge between Stata statistical software and code editors like VS Code and Cursor, enabling users to run Stata commands directly from the editor, view output in real-time, and get AI-powered assistance with Stata coding.532MIT
- AlicenseNot gradedqualityDmaintenanceConnects AI agents to a local Stata installation, enabling execution of Stata code, data inspection, graph generation, and result verification through natural language interactions.987 PyPI92AGPL 3.0
- AlicenseAqualityCmaintenanceEnables LLM/agent applications to execute Stata code, load and inspect data, obtain structured regression results and graphs, and manage background tasks through the Model Context Protocol.10MIT
- AlicenseAqualityBmaintenanceEnables AI agents to invoke a local Stata installation, including a Windows Stata build under Wine on Linux and macOS, for regression analysis, econometrics, paper replication, and empirical research with command guards, resource monitoring, and automatic log capture.42AGPL 3.0