Stata MCP Server is an MCP server that let LLM help you achieve your regression analysis with Stata. It exposes 2 tools over stdio and http, requires no API key, and scores 88/100 on MCPpedia's security, maintenance and efficiency rubric.
Config is the same across clients - only the file and path differ.
{
"mcpServers": {
"stata-mcp": {
"args": [
"stata-mcp"
],
"command": "uvx"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
Let LLM help you achieve your regression analysis with Stata
Run this in your terminal to verify the server starts. Then let us know if it worked - your result helps other developers.
uvx 'stata-mcp' 2>&1 | head -1 && echo "✓ Server started successfully"
After testing, let us know if it worked:
Five weighted categories - click any category to see the underlying evidence.
MCP-for-Stata: Stata Command Injection via Unsanitized `package` in `ado_package_install`
## Stata Command Injection via Unsanitized `package` in `ado_package_install` ### Summary The `ado_package_install` MCP tool in `stata-mcp` concatenates user-controlled input directly into a Stata command string without any validation or sanitization. An attacker who can invoke the MCP tool or the equivalent Python API can embed newline characters in the `package` argument to inject arbitrary Stata commands. Because Stata supports a `shell` escape command, this leads to full OS-level arbitrary
stata-mcp has insufficient validation of user-supplied Stata do-file content that can lead to command execution
A vulnerability was identified in stata-mcp prior to v1.13.0 where insufficient validation of user-supplied Stata do-file content can lead to command execution.
MCP-for-Stata: Command injection via log_file_name parameter in Stata command wrapper
### Summary The `log_file_name` parameter in the `stata_do` API and CLI is directly interpolated into a Stata command string without sanitization. The security guard (`GuardValidator`) only scans the do-file content but does not validate this parameter. An attacker can inject arbitrary Stata commands (including `shell`, `python`, `erase`, etc.) by crafting a malicious `log_file_name` containing quotes, newlines, or Stata command separators. ### Details In `src/stata_mcp/stata/stata_do/do.py`,
Click any tool to inspect its schema.
Be the first to review
Have you used this server?
Share your experience - it helps other developers decide.
Sign in to write a review.
Others in data / analytics
Token-efficient MCP server for PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, ClickHouse, SQLite
DataForSEO API modelcontextprotocol server
Full Agent Swarm API and MCP server with local SQLite storage for multi-agent orchestration.
Search, scrape, and crawl the web, plus Firecrawl Alexandria, our library of everything else.
MCP Security Weekly
Get CVE alerts and security updates for Stata MCP Server and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
MCP-for-Stata is an safety first open-source MCP server and CLI tool with Skills lets any AI agent you use invoke local Stata on your device for regression analysis, econometrics, paper replication, and empirical research. It provides command guards, resource monitoring, automatic log capture, and cross-platform client installation, while you retain control of your data and Stata license.
Turn Claude Code, Codex, and other AI agents into an on-demand research assistant.
Stata is a registered trademark of StataCorp LLC. This project is an independent community-developed tool and is not affiliated with, endorsed by, or sponsored by StataCorp LLC.
You do not need to edit any configuration. Just tell your agent:
Install MCP-for-Stata for yourself globally following the instructions in the GitHub repository at SepineTam/mcp-for-stata.
uvx stata-mcp install -c dsh. See the DeepSeek Harness guide.stata-mcp tool), see OpenClaw guideFinding our newest research? View latest research reports.
MCP or AI about Stata
- A session based MCP server for Stata, mcp-stata
- IDEs (VScode or Cursor) integrated