mcp-stata
PyPI
v3.3.0
Published by tmonk — no publish provenance, so origin is unverified, but the source is public: the repository link below is self-declared yet readable, so you can inspect the code before adopting it.
A lightweight Model Context Protocol (MCP) server for Stata. Execute commands, inspect data, retrieve stored results (`r()`/`e()`), and view graphs in your chat interface. Built for economists who want to integrate LLM assistance into their Stata workflow.
The grade answers one question — how safe is this server for you to adopt — so it is computed in two auditable stages. Nothing below is an opinion or an LLM's guess; every line is a real term the deterministic engine applied, and the same input always yields the same number.
1. Threat score — 100 − 0 = 100. What the published surface and source actually contain:
The deterministic scan raised no scored threat in the surface it inspected — the threat score stayed at 100. Capability observations and advisory notes are recorded but never lower it.
2. Client adoption risk — 100 − 7 = 93. Three small, subtract-only factors that reflect your risk in adopting it — a clean scan proves less on a powerful, unverified or barely-inspectable package, so the grade says so plainly:
| Points | Adoption-risk factor |
|---|---|
| −6 | capability blast radius (high) — client exposure if the model is manipulated |
| −1 | publisher verification (public source) — no provenance, but the source is public and inspectable |
Capability observations and info notes are shown under Findings but never scored.
Open any row's finding below for the file, line and evidence behind a deduction.
In the server's implementation (`src/mcp_stata/server.py:1910`): Reading private keys / cloud credentials, or serializing the whole environment, is a sensitive-data source that becomes exfiltration when combined with any egress. This is read from the code itself — not from the tool description — so a poisoned server cannot hide it behind honest-looking metadata.
Evidence: ".aws", ".config/gcloud", ".gnupg", ".netrc", "id_rsa", "id_ed25519",
Fix: Review this call path: confirm it never receives unsanitized tool input, constrain it, or remove it. Treat a server whose code reaches these sinks as high-capability regardless of what its tools claim.
Location: server src/mcp_stata/server.py
In the server's implementation (`src/mcp_stata/stata_client.py:4602`): Evaluating a runtime value as code (rather than a fixed literal) executes whatever reaches it — a direct RCE primitive, and almost never necessary in legitimate code. This is read from the code itself — not from the tool description — so a poisoned server cannot hide it behind honest-looking metadata.
Evidence: ok = bool(eval(code, {"__builtins__": {}}, env)) except NameError as e:
Fix: Review this call path: confirm it never receives unsanitized tool input, constrain it, or remove it. Treat a server whose code reaches these sinks as high-capability regardless of what its tools claim.
Location: server src/mcp_stata/stata_client.py
In the server's implementation (`src/mcp_stata/stata_client.py:4602`): Evaluating strings as code is the most direct RCE primitive; if any tool input reaches it, the server executes attacker-chosen code. This is read from the code itself — not from the tool description — so a poisoned server cannot hide it behind honest-looking metadata.
Evidence: ok = bool(eval(code, {"__builtins__": {}}, env)) except NameError as e:
Fix: Review this call path: confirm it never receives unsanitized tool input, constrain it, or remove it. Treat a server whose code reaches these sinks as high-capability regardless of what its tools claim.
Location: server src/mcp_stata/stata_client.py
In the server's implementation (`src/mcp_stata/discovery.py:709`): Spawning a shell/process is command-execution capability; with unsanitized tool input it is command injection / RCE. This is read from the code itself — not from the tool description — so a poisoned server cannot hide it behind honest-looking metadata.
Evidence: res = subprocess.run( [py_exe, "-c", preflight_code], capture_output=True, tex
Fix: Review this call path: confirm it never receives unsanitized tool input, constrain it, or remove it. Treat a server whose code reaches these sinks as high-capability regardless of what its tools claim.
Location: server src/mcp_stata/discovery.py
In the server's implementation (`src/mcp_stata/stata_client.py:686`): Spawning a shell/process is command-execution capability; with unsanitized tool input it is command injection / RCE. This is read from the code itself — not from the tool description — so a poisoned server cannot hide it behind honest-looking metadata.
Evidence: res = subprocess.run(f'type "{smcl_path}"', shell=True, capture_output=True)
Fix: Review this call path: confirm it never receives unsanitized tool input, constrain it, or remove it. Treat a server whose code reaches these sinks as high-capability regardless of what its tools claim.
Location: server src/mcp_stata/stata_client.py
In a packaging/dev/install script (shipped, but not the server runtime) (`scripts/benchmarks/benchmark_rust_ops.py:81`): Evaluating strings as code is the most direct RCE primitive; if any tool input reaches it, the server executes attacker-chosen code. This is read from the code itself — not from the tool description — so a poisoned server cannot hide it behind honest-looking metadata.
Evidence: len(names))} if eval(code, {"__builtins__": {}}, env): indices.append(i) return indices def run
Fix: Review this call path: confirm it never receives unsanitized tool input, constrain it, or remove it. Treat a server whose code reaches these sinks as high-capability regardless of what its tools claim.
Location: server scripts/benchmarks/benchmark_rust_ops.py
In a packaging/dev/install script (shipped, but not the server runtime) (`scripts/benchmarks/run_e2e_benchmark.py:69`): Spawning a shell/process is command-execution capability; with unsanitized tool input it is command injection / RCE. This is read from the code itself — not from the tool description — so a poisoned server cannot hide it behind honest-looking metadata.
Evidence: try: result = subprocess.run(cmd, capture_output=True, text=True) print("\n=== JS Client Output ===")
Fix: Review this call path: confirm it never receives unsanitized tool input, constrain it, or remove it. Treat a server whose code reaches these sinks as high-capability regardless of what its tools claim.
Location: server scripts/benchmarks/run_e2e_benchmark.py
In a packaging/dev/install script (shipped, but not the server runtime) (`scripts/install/setup_toolkit.py:102`): Spawning a shell/process is command-execution capability; with unsanitized tool input it is command injection / RCE. This is read from the code itself — not from the tool description — so a poisoned server cannot hide it behind honest-looking metadata.
Evidence: md(cmd)}") result = subprocess.run( cmd, check=False, capture_output=True, text=True
Fix: Review this call path: confirm it never receives unsanitized tool input, constrain it, or remove it. Treat a server whose code reaches these sinks as high-capability regardless of what its tools claim.
Location: server scripts/install/setup_toolkit.py
In a packaging/dev/install script (shipped, but not the server runtime) (`scripts/maintenance/check_server_version.py:19`): Spawning a shell/process is command-execution capability; with unsanitized tool input it is command injection / RCE. This is read from the code itself — not from the tool description — so a poisoned server cannot hide it behind honest-looking metadata.
Evidence: return ( subprocess.check_output(["hatch", "version"], cwd=ROOT, text=True) .strip()
Fix: Review this call path: confirm it never receives unsanitized tool input, constrain it, or remove it. Treat a server whose code reaches these sinks as high-capability regardless of what its tools claim.
Location: server scripts/maintenance/check_server_version.py
In a packaging/dev/install script (shipped, but not the server runtime) (`scripts/maintenance/sync_server_version.py:40`): Spawning a shell/process is command-execution capability; with unsanitized tool input it is command injection / RCE. This is read from the code itself — not from the tool description — so a poisoned server cannot hide it behind honest-looking metadata.
Evidence: try: return subprocess.check_output( ["hatch", "version"], cwd=ROOT, text=True ).strip()
Fix: Review this call path: confirm it never receives unsanitized tool input, constrain it, or remove it. Treat a server whose code reaches these sinks as high-capability regardless of what its tools claim.
Location: server scripts/maintenance/sync_server_version.py
In a packaging/dev/install script (shipped, but not the server runtime) (`tests/execution/test_build_integration.py:27`): Spawning a shell/process is command-execution capability; with unsanitized tool input it is command injection / RCE. This is read from the code itself — not from the tool description — so a poisoned server cannot hide it behind honest-looking metadata.
Evidence: HT", "1") result = subprocess.run(cmd, cwd=cwd, capture_output=True, text=True, encoding="utf-8", env=merged) i
Fix: Review this call path: confirm it never receives unsanitized tool input, constrain it, or remove it. Treat a server whose code reaches these sinks as high-capability regardless of what its tools claim.
Location: server tests/execution/test_build_integration.py
In a packaging/dev/install script (shipped, but not the server runtime) (`tests/execution/test_env_diagnostic.py:10`): Spawning a shell/process is command-execution capability; with unsanitized tool input it is command injection / RCE. This is read from the code itself — not from the tool description — so a poisoned server cannot hide it behind honest-looking metadata.
Evidence: lpath' errors res = subprocess.run([sys.executable, "--version"], capture_output=True, text=True) assert res.ret
Fix: Review this call path: confirm it never receives unsanitized tool input, constrain it, or remove it. Treat a server whose code reaches these sinks as high-capability regardless of what its tools claim.
Location: server tests/execution/test_env_diagnostic.py
In a packaging/dev/install script (shipped, but not the server runtime) (`tests/installer/test_ensure_symlink.py:73`): Spawning a shell/process is command-execution capability; with unsanitized tool input it is command injection / RCE. This is read from the code itself — not from the tool description — so a poisoned server cannot hide it behind honest-looking metadata.
Evidence: using mklink /J subprocess.run(["cmd", "/c", "mklink", "/J", str(link), str(temp_dir / "non-existent")], capture
Fix: Review this call path: confirm it never receives unsanitized tool input, constrain it, or remove it. Treat a server whose code reaches these sinks as high-capability regardless of what its tools claim.
Location: server tests/installer/test_ensure_symlink.py
In a packaging/dev/install script (shipped, but not the server runtime) (`tests/installer/test_install_bootstrap.py:72`): Spawning a shell/process is command-execution capability; with unsanitized tool input it is command injection / RCE. This is read from the code itself — not from the tool description — so a poisoned server cannot hide it behind honest-looking metadata.
Evidence: T')") result = subprocess.run( ["/bin/bash", str(INSTALL_SH), "--agent", "cursor"], capture_out
Fix: Review this call path: confirm it never receives unsanitized tool input, constrain it, or remove it. Treat a server whose code reaches these sinks as high-capability regardless of what its tools claim.
Location: server tests/installer/test_install_bootstrap.py
Scan history per published version. The engine is deterministic — the same version always yields the same score, so a changed score means the package itself changed.
| Version | Score | Findings | Engine | Scanned |
|---|---|---|---|---|
v3.3.0 latest |
A 93/100 | 14 | 1.13.0 | 2026-08-25 |
Show this server's live Trust Score in your README, docs or website. The badge is served straight from the registry and updates automatically after every rescan — no API key needed. It links back to this page, so anyone who sees the grade can also read the findings behind it instead of taking a number on faith.
The score above is reproducible: the same package version always yields the same result. Run it locally or over the free API — no account, no LLM, fully deterministic.
npx mcptrustchecker scan mcp-stata --online --registry pypi
Independent packages implementing the same tool, scanned with the same engine. Compare all 2 side by side →
MCP server for 2s.io — 575+ pay-per-call tools for AI agents — ground-truth data, AI gateway, and agent infra (storage, locks, queues, watchers). x402 USDC on Base/Solana, no API keys, upto usage billing, free trials.
ArXiv preprints + Google Scholar papers, with citation counts in one query.
Add MCP servers to your favorite coding agents with a single command.
Help agents automatically write and test stories for your UI components
Model Context Protocol server for AI-Archive platform - enables AI agents to discover, submit, and review research papers
MCP server for Semantic Scholar research workflows with stdio and Streamable HTTP transports.