ClaudeCodeMod

All shelves / MCP servers

Stata

hanlulong/stata-mcp · 372 stars · Python · MIT

MCP server Stata MCP Extension for VS Code, Cursor, and Antigravity IDE

Install

In your shell
claude mcp add --transport http stata-mcp http://localhost:4000/mcp-streamable --scope user

These repos do not share one command. When an entry shows a command, it was copied as published. Check the repo's README before you run it.

Open the repo

Files

README.md

Stata MCP Extension for VS Code, Cursor, and Antigravity

This extension provides Stata integration for Visual Studio Code, Cursor, and Antigravity IDE using the Model Context Protocol (MCP). It enables AI-powered Stata development with GitHub Copilot, Cursor, Antigravity, Cline, Claude Code, or Codex.

Features

  • Run Stata Commands: Execute selections or entire .do files directly from your editor
  • Real-time Output: See Stata results instantly in your editor
  • Syntax Highlighting: Full syntax support for Stata .do, .ado, .mata, and .doh files
  • AI Assistant Integration: Contextual help and code suggestions via MCP
  • Cross-platform: Works on Windows, macOS, and Linux
  • Multi-Session Parallel Execution: Run multiple Stata sessions simultaneously with AI coding tools

Demo

Watch how this extension enhances your Stata workflow with Cursor (or VS Code/Antigravity) and AI assistance:

🎬 Full Video Version   |   📄 View Generated PDF Report

Requirements

  • Stata 17 or higher installed on your machine
  • UV package manager (automatically installed or can be installed manually if needed)

Installation

Note: Initial installation requires setting up dependencies which may take up to 2 minutes to complete. Please be patient during this one-time setup process. All subsequent runs will start instantly.

  1. Open VS Code, Cursor, or Antigravity
  2. Open the Extensions view (Ctrl+Shift+X / Cmd+Shift+X)
  3. Search for "Stata MCP"
  4. Click Install

That's it — the extension auto-starts the MCP server and appears in the status bar as "Stata".

#### From the command line

# VS Code
code --install-extension DeepEcon.stata-mcp

# Cursor
cursor --install-extension DeepEcon.stata-mcp

# Antigravity (installs from Open VSX Registry)
antigravity --install-extension DeepEcon.stata-mcp

#### From a local .vsix file

Download stata-mcp-<version>.vsix from the releases page, then either:

code        --install-extension path/to/stata-mcp-0.5.3.vsix
cursor      --install-extension path/to/stata-mcp-0.5.3.vsix
antigravity --install-extension path/to/stata-mcp-0.5.3.vsix

…or in the UI: Extensions view → … menu → Install from VSIX… → pick the downloaded file.

#### Registries

  • VS Code Marketplace:
  • Open VSX (Cursor / Antigravity):

Starting with version 0.1.8, the extension integrates a fast Python package installer called uv to set up the environment. If uv is not found on your system, the extension will attempt to install it automatically.

⚡ Connect Your AI Assistant

Once the extension is running (status bar shows "Stata"), the local MCP server is listening on:

  • http://localhost:4000/mcp-streamable — Streamable HTTP (preferred for modern clients)
  • http://localhost:4000/mcp — SSE (legacy fallback)

Quick health check: curl -s http://localhost:4000/health should print {"status":"ok",...}.

📋 One-prompt setup

Paste the block below into any MCP-aware assistant — Claude Code, OpenAI Codex, Cursor AI, Copilot Chat, etc. Hover the box on GitHub and click the copy icon in the top-right corner.

Set up the Stata MCP server for me. Endpoint: http://localhost:4000/mcp-streamable — setup guide: https://github.com/hanlulong/stata-mcp#detailed-configurations — if I already have a stata-mcp entry in my MCP config (e.g. using mcp-proxy), replace it rather than appending. When registration succeeds, tell me to restart the client so the stata_run_selection tool becomes available.

The assistant reads the guide, detects which client it is, writes the right config (or runs the right CLI command), and tells you to restart. The stata_run_selection tool becomes visible after the restart — MCP tool lists do not refresh mid-session.

Prefer manual setup? Expand Detailed Configurations below for per-client instructions.

Usage

Running Stata Code

  1. Open a Stata .do file
  2. Run commands using:
  • Run Selection: Select Stata code and press Ctrl+Shift+Enter (or Cmd+Shift+Enter on Mac), or click the play button in the editor toolbar
  • Run File: Press Ctrl+Shift+D (or Cmd+Shift+D on Mac) to run the entire .do file, or click the run-all button in the toolbar
  • Stop Execution: Press Ctrl+Shift+C (or Cmd+Shift+C on Mac) to stop a running command
  • Restart Session: Click the restart button in the editor toolbar or use the Command Palette ("Stata: Restart Session") to reset the Stata session. This clears all in-memory data, globals, and programs — equivalent to closing and reopening Stata
  • Interactive Mode: Click the graph button in the editor toolbar to run code in an interactive browser window
  1. View output in the Stata Output panel

Note for Cursor/Antigravity Users: Toolbar buttons may be hidden by default. To show them: 1. Click the ... (three dots) menu in the editor title bar 2. Select "Configure Icon Visibility" 3. Enable the Stata buttons you want to see (Run Selection, Run File, Stop, View Data, Restart Session, Interactive)

Data Viewer

Access the data viewer to inspect your Stata dataset:

  1. Click the View Data button (fourth button, table icon) in the editor toolbar
  2. View your current dataset in a table format
  3. Filter data: Use Stata if conditions to view subsets of your data
  • Example: price > 5000 & mpg < 30
  • Type your condition in the filter box and click "Apply"
  • Click "Clear" to remove the filter and view all data

Graph Display Options

Control how graphs are displayed:

  1. Auto-display graphs: Graphs are automatically shown when generated (default: enabled)
  • Disable in Extension Settings: stata-vscode.autoDisplayGraphs
  1. Choose display method:
  • VS Code webview (default): Graphs appear in a panel within VS Code
  • External browser: Graphs open in your default web browser
  • Change in Extension Settings: stata-vscode.graphDisplayMethod

Detailed Configurations

Customize the extension behavior through VS Code settings. Access these settings via:

  • VS Code/Cursor/Antigravity: File > Preferences > Settings (or Ctrl+, / Cmd+,)
  • Search for "Stata MCP" to find all extension settings

Core Settings

Server Settings

Graph Settings

Facts

Kind
MCP server
Repo
hanlulong/stata-mcp
Group
Uncategorized
Stars
372
License
MIT
Language
Python
Last push
2026-07-05
Forks
88
Homepage
openecon.ai

More on this shelf

  1. 1Everythingmodelcontextprotocol/serversThis MCP server attempts to exercise all the features of the MCP protocol. It is not intended to be a useful server, but rather a test server for builders of MCP clients. It implements prompts, tools, resources, sampling, and more to showcase MCP capabilities.85.8k
  2. 2Fetchmodelcontextprotocol/serversA Model Context Protocol server that provides web content fetching capabilities. This server enables LLMs to retrieve and process content from web pages, converting HTML to markdown for easier consumption.85.8k
  3. 3Gitmodelcontextprotocol/serversA Model Context Protocol server for Git repository interaction and automation. This server provides tools to read, search, and manipulate Git repositories via Large Language Models.85.8k
  4. 4Memorymodelcontextprotocol/serversA basic implementation of persistent memory using a local knowledge graph. This lets Claude remember information about the user across chats.85.8k
  5. 5Sequential Thinkingmodelcontextprotocol/serversAn MCP server implementation that provides a tool for dynamic and reflective problem-solving through a structured thinking process.85.8k
  6. 6Timemodelcontextprotocol/serversA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.85.8k