← Back to directory
M

MCP-for-Stata

Community
Run local Stata analysis through an AI agent.
Category
Other #320 of 678
Stars
★ 285 Very popular
Transport
stdio (local process)
Runtime
Python
Credentials
API key / credential required
License
AGPL-3.0
Last commit
52FMRS · D

This server connects AI agents to local Stata for regression analysis and empirical research, with command guards, resource monitoring, and log capture. It requires a separately installed and licensed Stata copy. The README also documents fixed security issues, so users should check their version and consider the local data access boundary.

Strongest · Setup experience 12/20 Weakest · Reliability 8/20

Reliability
8/20
Security and permissions
8/20
Maintenance
12/20
Documentation
12/20
Setup experience
12/20
Why each score
Reliability 8/20
The material describes a stdio Stata server, automatic log capture, and a diagnostic command. It does not provide an actual tool list, initialization-handshake evidence, CI workflows, or committed tests, so startup and tool behavior cannot be verified; the score reflects the static-calibration limit.
Security and permissions 8/20
The material claims a default command guard, RAM monitoring, and data-access boundaries, and lists three remediated security advisories. This indicates visible safeguards and remediation records. Points are deducted because there is no code-level verification, detailed permission scope, or evidence of confirmation for dangerous operations; letting an agent run local Stata code also has side effects. The material does not establish a red-line issue, so no red-line score is applied.
Maintenance 12/20
The material identifies an AGPL-3.0 license, a PyPI version, public security-remediation records, and an issue-reporting channel, indicating maintenance and an update path. Points are deducted because commit history, issue-response activity, and dependency-update evidence are absent; the supplied repository and manifest information is also not fully consistent.
Documentation 12/20
The README provides installation examples for several clients, prerequisites, feature descriptions, documentation links, and security disclosures. Points are deducted because tool parameters, permission boundaries, costs, and troubleshooting details mainly link to external documentation not included here, so they cannot be verified from the supplied material; security claims also lack implementation evidence.
Setup experience 12/20
The README gives uvx installation commands, configuration examples for several clients, platform scripts, and Stata and license prerequisites, making the mainstream-client setup path fairly clear. Points are deducted because users still need uv, Stata, and a valid license, and the standard configuration assumes Stata is at its default path. The material contains no CI and committed tests as verifiable execution evidence, so the score stays within the static-calibration cap.

Static review · not runReviewed 2026-11-29

Read the FMRS scoring method →

Fit and risk

What it can accessReads local filesWrites / deletes local filesRuns commands or code

Best for

  • Econometrics, social science, and empirical research users who want an AI agent to run local Stata
  • Stata users who want command guards and automatic log capture in their research workflow

Not for

  • Users without an installed copy of Stata and a valid license
  • Users who require cloud Stata execution or graph export; the supplied material does not establish that this server provides those capabilities

Required permissions

  • Needs to invoke the local Stata command-line program and run analyses on the device
  • Needs access to the configured working directory and the data and files used for analysis
  • The AI client requires its own API key; the manifest declares no server environment variables

Risks and side effects

  • Stata code run by an AI agent may read or change data and files in the working directory; command guards aim to block some dangerous commands but do not establish zero risk
  • The README describes previously fixed security vulnerabilities; check the version in use and its security fixes
  • Analysis depends on the local Stata installation, license, and configuration

Setup

Before you start

Runtime:Python

Install uv, then run uvx stata-mcp install -c claude for Claude Desktop, or uvx stata-mcp install --all for supported clients. Alternatively, configure the client with command uvx and argument stata-mcp. Stata must be installed and licensed separately.

claude_desktop_config.json
{"mcpServers":{"stata-mcp":{"command":"uvx","args":["stata-mcp"]}}}

Shown for Claude Desktop. Other clients may use a different file or key (VS Code uses "servers") — the configurator below converts it.

.vscode/mcp.json
{
  "servers": {
    "stata-mcp": {
      "command": "uvx",
      "args": [
        "stata-mcp"
      ]
    }
  }
}

Goes in your project's .vscode/mcp.json (VS Code uses a "servers" key).

~/.codex/config.toml
[mcp_servers.stata-mcp]
command = "uvx"
args = ["stata-mcp"]

Append to ~/.codex/config.toml (OpenAI Codex CLI uses TOML).

Terminal
claude mcp add stata-mcp -- uvx stata-mcp

Run it in a terminal; replace any <…> placeholders with your own values first.

Check that it works

Confirm Stata-MCP tools appear in your client's MCP tool list. You can also ask the client to run a Stata analysis and check that it returns results.

Troubleshooting

  1. Confirm that uv and Stata are installed and that the Stata command-line program is available
  2. Run `uvx stata-mcp doctor` to check device support, dependencies, Stata execution, and configuration
  3. If the client cannot load the server, check that its configuration uses command `uvx` with argument `stata-mcp`, then restart the client
  4. Claude Science users need to allowlist relevant installation paths as described in the project guide

Things to try

Once connected, you can ask your AI assistant things like:

  • Run a regression on the current data in Stata and explain the results.
  • Review and organize an existing Stata do-file.

Use cases

Run regressions and test research hypotheses
Replicate empirical studies from economics papers
Organize or review Stata do-files
Interpret statistical output and regression results

Supported clients

Claude Desktop
Claude Code
Codex
Codex Desktop
Cursor
Gemini CLI
Cline
OpenCode
OpenClaw
Claude SciencePartial support

Listed from the project's documentation, not tested by this site.

Overview

MCP-for-Stata (Stata-MCP) is an open-source MCP server and CLI tool that lets AI agents invoke Stata on the user's device for regression analysis, econometrics, paper replication, and empirical research. It provides command guards, resource monitoring, and automatic log capture. Users must install Stata and hold a valid license. The project is licensed under AGPL-3.0 and is independent of, and not endorsed by, StataCorp.

Similar servers

Source revision d92790b97f6c Data synced 2026-12-05 Read the FMRS scoring method Markdown

Maintainer badge: embed FMRS score

Paste this Markdown into your repository README to display a live score badge:

README.md
[![FollowMCP](https://followmcp.com/badges/mcp-for-stata.svg)](https://followmcp.com/en/servers/mcp-for-stata)