Releases: hanlulong/stata-mcp
Release list
v0.5.3 - Windows locale port fix, streaming output fix, user log coexistence
What's Changed
Fixed
- Python setup crash "Exit code: 9 - bad option: --js-flags" (#61): the dependency installer no longer inherits Electron-specific flags from the host IDE.
- Empty output panel despite successful do-file execution (#62): streaming execution now writes to the exact log file the stream monitors, with a fallback that emits the final result directly if log tailing produced nothing.
- User
log usingcommands broken by output capture (#63): the server now captures output through its own named log (__mcp_log) and never touches user logs;log using/log closein your do-files work as in native Stata. If your code runslog close _all, MCP capture automatically resumes. - Port reclaim failed on non-English Windows (#64): all three port-cleanup paths are now locale-independent (netstat parsing without state-word matching in Python; PowerShell
Get-NetTCPConnectionin the extension and standalone launcher). IPv4+IPv6 covered. workingDirectorysetting now honored in multi-session mode (#36), including thenoneoption.- Interactive window works behind path-prefixing proxies (#54) — relative URLs instead of root-relative.
- Data Viewer no longer materializes the full filtered dataset before applying the row limit (related to #59).
Changed
- Session log filenames use a sanitized session id + short hash (prevents invalid filenames/path traversal).
- MCP
stata_run_selectionacceptstimeout,working_dir, andsession_id; timeouts enforced server-side in single-session mode. - Compact output mode strips Stata log header/footer noise from selection results.
start-server.jsforwards--log-file-location/--custom-log-directory.- Temporary preprocessed do-files are cleaned up on all execution paths.
Full Changelog: v0.5.2...v0.5.3
v0.5.2 - Graph Viewer Rewrite + Preserve/Restore Fix
What's Changed
Graph Viewer Rewrite (Issue #60)
- Stable webview shell with message-based (
postMessage) hydration — no more full-document replacement on every update - External CSS/JS assets loaded with nonce-based Content Security Policy, matching Microsoft's recommended webview pattern
- Execution-scoped graph artifacts — each batch lives under its own directory with a manifest, so
graph1.png/graph2.pngno longer overwrite each other across runs - Graph state centralized in a dedicated
GraphStoreon the extension side - Webview resource paths resolved through
fs.realpathSync, so images load correctly on filesystems with symlinks or reparse points (macOS/private/var, Linux symlinked/tmp, Windows OneDrive, cloud-synced install locations)
Fixed
- "Already preserved r(621)" error (Issue #58): Data Viewer filter no longer touches the user's preserve stack — replaced with isolated
frame copy - Session restart recovery: users stuck in the r(621) state can recover via "Restart Stata Session"
- Help endpoint if/else syntax error: fixed malformed Stata code in HTML help lookup
- View Data toolbar button overflow: added explicit
navigation@Nordering so the button stays visible - Graph viewer black-screen / missing content (Issue #60): resolved by the webview rewrite and path-resolution changes above; also added defensive
onerrorhandling and server-side file-size validation for empty/corrupt PNG exports
Hardened
- Session manager: explicit
session_idrequests no longer silently reroute; execution timeouts recover the session in place; dead default sessions are now recovered; non-execution timeouts no longer reset a session unnecessarily
Tests
- New
tests/test_graph_artifacts.pycovering execution-scoped artifact layer - Rewrote
tests/test_notifications.pyandtests/test_streaming_http.pyto make real assertions when a local integration server is available and skip cleanly otherwise - Expanded
tests/test_session_manager.pyfor the session hardening changes
Full Changelog: v0.5.1...v0.5.2
v0.5.1 - Fix Streaming Output in Cursor/Trae
What's Changed
Fixed
- Streaming output not displaying in Cursor/Trae (Issue #57): Force Node.js HTTP adapter for streaming requests to prevent axios from selecting the incompatible XHR adapter in VS Code forks
Full Changelog: v0.5.0...v0.5.1
v0.5.0 - Interactive Window Panel Mode & Remote Environment Fixes
What's Changed
Interactive Window as VS Code Panel (Issue #54)
- New setting
stata-vscode.interactiveDisplayMode: choosepanel(default) to open the Interactive Window as a VS Code webview tab, orbrowserfor external browser - Panel mode executes code and displays output/graphs inline with interactive command input
Fixed
- Interactive Window URL broken in code-server:
asExternalUri()was stripping the/interactivepath in proxied environments. Fixed by resolving the base URL first, then re-appending path and query. - Graph viewer scrolling lockup: Added proper overflow CSS and capped graph history at 50 entries to prevent unbounded DOM growth.
- Same
asExternalUrifix applied to external browser graph display URLs.
Full Changelog: v0.4.9...v0.5.0
v0.4.9 - Help Command Support with Rich SMCL Rendering
What's Changed
Help Command Support (Issue #55)
- Type
help regress,man logit,h merge, etc. via Run Selection or the Interactive Window to display Stata help in a dedicated webview panel - Rich SMCL rendering — full formatting with bold, italic, command styling, proper fonts and colors (matches Stata's native Viewer)
- Clickable links — click any help reference to navigate to that topic
- Back/Forward navigation with history
- Table of contents from
{viewerjumpto}entries for quick section navigation - "Also see" section with clickable related topics
- Synopt tables rendered as proper HTML tables
- VS Code theme-aware — adapts to light and dark themes
- Supports
help,man,chelp,whelpcommands (including abbreviations) - Handles multi-word topics,
#-prefixed topics, and options - MCP tool calls (AI agents) are NOT affected
Note: The help interception works when a single help command line is selected and run. If
helpis embedded inside a longer do-file or multi-line selection, it goes through normal Stata execution.
Full Changelog: v0.4.8...v0.4.9
v0.4.8 - Fix Graphs in Remote Environments
What's Changed
Fixed
- Graphs Fail in Remote Environments (Issue #54): Fixed graph display in code-server, Remote-SSH, and proxied environments
- Replaced
http://localhostimage URLs withwebview.asWebviewUri()for loading graphs from disk - Added proper
localResourceRootsto webview panels - Updated Content Security Policy to use
webview.cspSource - External browser display now uses
vscode.env.asExternalUri()for correct URL resolution
- Replaced
- Path traversal protection on
/graphs/HTTP endpoint - Graph output parsing fixed for lines with
[CMD: ...]suffix - Null reference guard in interactive panel when closed during async operation
- HTML escaping hardened for graph names, URLs, and file names
Full Changelog: v0.4.7...v0.4.8
v0.4.7 - Restart Session & Fix Globals Persistence
What's Changed
Added
- Restart Stata Session command — reset the Stata session to a clean state from the editor toolbar, context menu, or Command Palette. Equivalent to closing and reopening Stata.
Fixed
- Globals and macros lost between runs (Issue #51) — removed overly aggressive
capture program drop _allandcapture macro drop _allfrom the Run File wrapper. Sequential workflows now work correctly: runconfig.doto define globals, thenanalysis.docan access them. - Windows trailing backslash path issue (Issue #52) — fixed working directory path handling when path ends with
\.
Full Changelog: v0.4.6...v0.4.7
v0.4.6 - Data Viewer Large Dataset Support
What's Changed
Added
- Data Viewer Large Dataset Support: Efficient virtual scrolling for handling up to 500K rows
- Only renders visible rows (~50-100 DOM elements) instead of all rows
- Smooth scrolling experience even with large datasets
- New setting
stata-vscode.dataViewerMaxRows(default: 100K, max: 500K) - Warning: Setting above 500K may cause slow loading due to JSON transfer size
Fixed
-
Row Number Display After Filtering: Row numbers now correctly show original Stata observation numbers
- Previously showed sequential numbers (1, 2, 3...) after filtering
- Now displays actual observation numbers from original dataset (e.g., 10, 25, 50...)
-
Number Formatting in Data Viewer: Fixed regex escaping issue in template literals
- Trailing zeros now correctly removed from decimal numbers
-
Data Loading with obs Parameter: Fixed
pdataframe_from_data(obs=...)usage- Efficient row limiting without data copying
Full Changelog: v0.4.5...v0.4.6
v0.4.5 - Fix MCP Tool Name Length Issue
What's Changed
Fixed
- MCP Tool Name Too Long: Fixed 400 error caused by auto-generated tool names exceeding API length limits (Issue #48)
- Hidden streaming endpoints (
/run_file/stream,/run_selection/stream) from MCP schema - Streaming endpoints remain functional for HTTP but are no longer exposed as MCP tools
- Prevents
invalid_request_errorwhen using Claude Code or other MCP clients
- Hidden streaming endpoints (
Full Changelog: v0.4.4...v0.4.5
v0.4.4 - Bug Fixes for Windows & VS Code
What's Changed
Fixed
-
HTTP Protocol Error on Windows: Fixed h11 "MUST_CLOSE" error during streaming execution (Issue #45)
- Restructured
run_selection_streamto matchrun_file_streamapproach - Moved temp file cleanup from generator's try-finally to worker thread
- Prevents protocol violations when client disconnects mid-stream
- Restructured
-
Unwanted .cursor Directory Creation: Fixed extension creating
.cursor/mcp.jsonin VS Code (Issue #45)- Added IDE detection using
vscode.env.appName - MCP config auto-update now only runs when using Cursor IDE
- Added IDE detection using
Full Changelog: v0.4.3...v0.4.4