Because the server is already running once the status bar says Stata, connecting an assistant is just pointing it at localhost:4000. The practical payoff is the loop: the model writes a do-file, runs it, reads the actual Stata output, and corrects itself — which is the part that is tedious when you are pasting between windows.
An extension for VS Code, Cursor and Antigravity that adds Stata execution, syntax highlighting and a local MCP endpoint any AI client can connect to.
- stata_run_selection — run the selected code and get the results back
- stata_run_file — run an entire .do file
- Real-time output in an editor panel, plus a data viewer for the loaded dataset
- Syntax highlighting for .do, .ado, .mata and .doh files
- Multiple Stata sessions running in parallel, and a restart that clears in-memory data, globals and programs
- Keyboard shortcuts for run selection, run file and stop, plus an interactive browser mode for graphs
Stata 17 or higher installed locally, and the uv package manager, which the extension installs for you if it is missing. Install the extension from the marketplace; it starts the server itself and listens on http://localhost:4000/mcp-streamable, with an SSE fallback at /mcp. First install sets up dependencies and can take a couple of minutes.
One command — code --install-extension DeepEcon.stata-mcp
