Back to Home
tmonk icon

mcp-stata

Verified Safe

by tmonk

Overview

Connects AI agents to a local Stata installation for executing commands, analyzing data, generating visualizations, and inspecting results.

Installation

Run Command
uvx --refresh --from mcp-stata@latest mcp-stata

Environment Variables

  • STATA_PATH
  • MCP_STATA_LOGLEVEL

Security Notes

The server includes an `eval()` function in `stata_client.py` for evaluating user-provided filter expressions. While `__builtins__` is restricted to an empty dictionary, `eval()` remains a pattern that requires careful scrutiny for potential sandbox escapes, especially if Stata variable names could be manipulated. `subprocess.run()` is used for specific tasks (e.g., Windows PNG export, log reading fallback) and sometimes with `shell=True`, but paths are typically generated internally via `tempfile`, mitigating direct shell injection risks from user input. The internal HTTP server for data browsing is restricted to localhost (`127.0.0.1`) and secured with short-lived bearer tokens, limiting external attack surface. Overall, common patterns with known risks are present but with noticeable mitigation strategies.

Similar Servers

Stats

Interest Score47
Security Score7
Cost ClassMedium
Avg Tokens1000
Stars15
Forks1
Last Update2026-01-19

Tags

StataData AnalysisAI AgentEconometricsVisualization