Positron Extensions
- Positron Stata extension installed and configured.
Why? Positron extensions add language support, tooling, and AI features to the editor. The extensions below are required for AI-assisted Stata workflows in this course.
What you need to do:
- Install extensions in positron:
- Positron Stata extension (or alternative Stata MCP).
- stataglow extension for Stata syntax highlighting.
- databot extension for AI-assisted data analysis in R (optional).
- Other extensions as desired (e.g., Python, R, Quarto support).
- Set correct settings for some extensions, e.g.
- Set Stata installation path in Positron settings.
- Set Stata MCP server settings for autonomous agent use (optional).
- Set stataEdition to
mp,se, orbedepending on your Stata license.
- Verify that Stata runs correctly from Positron.
Extensions overview
Positron/VS Code ships with minimal built-in functionality by design — extensions add support for specific languages, tools, and workflows without bloating the core editor.
Notable extensions for this course:
- Positron Assistant — installed by default; provides AI code suggestions and completions via GitHub Copilot and other AI providers.
- Claude Code — agentic AI coding using Anthropic’s Claude models.
- Positron Databot — AI-assisted data analysis and visualization.
Installing any extensions
Open the Extensions panel with Ctrl+Shift+X or click the square icon
on the left sidebar.
To install any extension:
- Search for it by name
- Click Install
- If prompted “Do you trust the publisher?”, click Trust and Install
- If needed, reload Positron:
Ctrl+Shift+P→Developer: Reload Window
Positron–Stata integration
Stata has no built-in editor integration. Extensions bridge the gap by connecting Positron to Stata’s backend, enabling an AI-assisted coding workflow. Three components work together:
- Stata 18+ with Model Context Protocol (MCP) support executes Stata code.
- Python +
uv— sends code to Stata and captures output. - A Positron extension — surfaces results in the editor UI.
- Custom logs not supported —
log using <filename>conflicts with the extension’s own logging. Stata only allows one log at a time. Usecapture log using <filename>to bypass this limitation. - Bugs are possible — report issues to the extension developers (links below).
Which extension to install?
Two extensions provide Stata integration. Install one — not both.
| Extension | Recommendation | Highlights |
|---|---|---|
| Positron Stata | Recommended | Native Positron integration (console, data viewer, plots) |
| Stata MCP | Alternative | More mature; better for VS Code / Cursor users |
| stataglow | Stata syntax highlighting | works with either extension |
Key differences:
| Feature | Positron Stata | Stata MCP |
|---|---|---|
| Console output in Positron | ✅ | ✅ |
| Data viewer | ✅ | ❌ |
| Multiple Stata sessions | ✅ | ❌ |
| AI agent integration | ✅ | ✅ |
| MCP support | ✅ | ✅ |
| Maturity | New (2026) | More mature (2023) |
| Good for… | Positron users who want native integration | VS Code / Cursor users who want MCP support |
Positron Stata
Native Positron integration of Stata with console, data viewer, plots. Help and documentation are on GitHub along with issue reporting: github.com/ntluong95/positron-stata.
To install it:
Open the Extensions panel (
Ctrl+Shift+X)Search for Positron Stata or
ntluong95.positron-stataClick Install -> Trust and Install
Reload Positron:
Ctrl+Shift+P→Developer: Reload WindowOpen settings in Positron (
Ctrl+,).Search for
positron.stata.installationPathSet the path to your Stata installation, e.g.
C:\Program Files\StataNow19\(adjust if Stata is installed elsewhere).Create a new
.dofile and run exemplary code to verify the extension is working (or open an existing one).create
test.dowith:sysuse auto summarize price display "Stata is working!"Save the file (
Ctrl+S) — unsaved edits are not executed.Run the file (
Ctrl+Shift+DorCtrl+Shift+P→Stata: Run Current File)
Stata MCP Extension
The Stata MCP extension enables Model Context Protocol (MCP) for Stata. Help and documentation are on the Open VSX page.
To install it:
Open the Extensions panel (
Ctrl+Shift+X)Search for Stata MCP or
DeepEcon.stata-mcpClick Install -> Trust and Install
Reload Positron:
Ctrl+Shift+P→Developer: Reload WindowOpen settings in Positron (
Ctrl+,).Search for
stata-vscode.stataPathSet the path to your Stata installation, e.g.
C:\Program Files\StataNow19\(adjust if Stata is installed elsewhere).Search for
stata-vscode.stataEditionand set it tomp,se, orbedepending on your Stata license.Create a new
.dofile and run exemplary code to verify the extension is working (or open an existing one).create
test.dowith:sysuse auto summarize price display "Stata is working!"Save the file (
Ctrl+S) — unsaved edits are not executed.Run the file (
Ctrl+Shift+DorCtrl+Shift+P→Stata: Run Current File)




