StationeersLua VS Code Extension

StationeersLua is a VS Code extension for editing Lua chips used by the StationeersLua and ScriptedScreens mods.
It gives you a practical workflow for writing chip code in VS Code while syncing with the in-game IC editor through the mod's REST API.
What this extension does
- Connects to the running StationeersLua game server (auto-connects on startup)
- Shows accessible Lua chips in a Chip Explorer sidebar, grouped by data cable network
- Chips show status (selected, on/off, error, library, loaded libraries, source size)
- Opens chip source into temporary
.lua files in your system temp directory
- Syncs the selected chip's in-game editor draft when you save in VS Code
- Detects external source changes (from AI editors or other players) and prompts to sync
- Lets you export code explicitly from the Chip Explorer row action or command palette
- Generates MCP config files for AI editors (Cursor, Windsurf, Claude Code, VS Code Copilot)
- Bundles Lua stubs/snippets for StationeersLua and ScriptedScreens APIs
- [Experimental] Attach a VS Code debugger to a running Lua chip (breakpoints, step, variables)
Important architecture note
This extension is not an MCP client.
- The extension talks to StationeersLua using the normal REST endpoints under
/api/*
- AI editors talk to the separate MCP endpoint exposed by the game mod
That split is intentional.
Requirements
- Stationeers with the StationeersLua mod installed on the game host
- IC10Editor mod installed in-game
- VS Code with this extension enabled
- Default game server URL:
http://127.0.0.1:3030
For multiplayer, point the extension at the host machine running the mod.
Setup
- Install the extension in VS Code.
- Make sure the StationeersLua mod is installed and the in-game HTTP server is available.
- Open your Lua workspace in VS Code.
- The extension auto-connects on startup. Use StationeersLua: Connect to Game Server if it doesn't.
- Open the in-game IC editor.
- The currently selected chip opens automatically in a VS Code tab.
Editing workflow
Chip Explorer
The Chips sidebar groups all accessible Lua chips by data cable network. Each chip row shows:
- Housing name (the device the chip is installed in)
- Chip type (Lua or IC10), on/off state, error indicator
- Whether it is the currently selected chip in the in-game editor
- Library modules it exports (for library chips)
- Libraries it has loaded
Click a chip row to open its source in VS Code.
Save to sync the in-game editor
When stationeers-lua.syncOnSave is enabled, saving the file (Ctrl+S) updates the in-game IC editor's draft for the currently selected chip.
Saving does not export to the chip or compile it.
Export explicitly
Use one of these when you want the code compiled onto the chip:
- The Export (upload) icon on the chip row in the sidebar
- StationeersLua: Export Chip to Game from the command palette
Pull code from game
- The Pull (download) icon on a chip row pulls the compiled source from the chip into the local file.
- For the currently selected chip, pull will fetch the live in-game editor draft.
Conflict detection
When an external source change is detected (AI editor, another player, in-game edit):
- If the local file has no unsaved changes, the update is applied silently.
- If the local file has unsaved changes, you are prompted to accept the remote update or keep local.
The extension never silently overwrites unsaved local work.
Commands
| Command |
Description |
StationeersLua: Connect to Game Server |
Manually connect to the in-game HTTP server |
StationeersLua: Disconnect from Game Server |
Disconnect and stop polling |
StationeersLua: Refresh Chip Explorer |
Refresh chip metadata in the sidebar |
StationeersLua: Open Chip |
Open a chip by ref ID |
StationeersLua: Export Chip to Game |
Compile and export local source to the chip |
StationeersLua: Pull Code from Chip |
Pull compiled source from a chip into VS Code |
StationeersLua: Configure AI Editor (MCP) |
Generate MCP config for your AI editor |
StationeersLua: Debug Chip |
(Experimental) Attach the VS Code debugger to a chip |
The Debug Chip command and its sidebar button are only visible when EnableExperimentalDebugger = true is set in the mod's BepInEx config.
Settings
| Setting |
Default |
Description |
stationeers-lua.gameServerUrl |
http://127.0.0.1:3030 |
URL of the in-game HTTP server. Change the port if you modified [MCP Server] Port in the mod config. |
stationeers-lua.syncOnSave |
true |
Push local file to the in-game editor draft on save. Does not export/compile. |
stationeers-lua.autoRefreshChipExplorer |
true |
Poll chip metadata automatically. Never overwrites local code buffers. |
stationeers-lua.chipExplorerRefreshIntervalMs |
5000 |
Polling interval in ms (1000–60000). |
Status bar
The status bar item (bottom-left) shows connection state:
- Disconnected — click to connect
- Connected: No Editor — connected but the in-game IC editor is not open
- Connected:
<chip name> — shows the currently selected chip name when the editor is open
Debugger (Experimental)
⚠️ The debugger is experimental and may have bugs. Please report issues on the Discord server.
The extension supports attaching a VS Code debugger to a running Lua chip via the Debug Adapter Protocol (DAP).
Requirements:
EnableExperimentalDebugger = true must be set in the mod's BepInEx config file before starting the game.
- The Debug Chip button only appears in the Chip Explorer when the game reports the debugger is available.
Capabilities:
- Set breakpoints in the tracked
.lua file
- Step over, step into, step out
- Inspect local variables and upvalues when paused
- Evaluate expressions in the Debug Console
- Multiplayer-aware: sessions are proxied through the mod's network layer
To start: click the Debug (bug) icon on a chip row in the Chip Explorer, or use the stationeers-lua debug configuration in VS Code's Run & Debug panel.
AI editor integration
Use StationeersLua: Configure AI Editor (MCP) to generate MCP config files.
Supported editors:
| Editor |
Config file written |
| Cursor |
.cursor/mcp.json |
| Windsurf / Cascade |
~/.codeium/mcp_config.json |
| Claude Code |
.mcp.json (requires HTTPS) |
| VS Code Copilot |
.vscode/mcp.json |
This writes the stationeersLua server entry into your AI editor's MCP config so it can connect directly to the in-game MCP server.
Bundled language support
The extension includes:
- StationeersLua API stubs (
stationeers-ic.lua, stationeers-globals.lua, stationeers-util.lua)
- ScriptedScreens API stubs (
stationeers-ss.lua)
- Snippets for common Lua patterns
- Syntax highlighting for Stationeers-focused Lua workflows
Stubs are injected into Lua.workspace.library automatically while the extension is connected and removed on disconnect.
Troubleshooting
Not connecting
- Verify the mod's HTTP/MCP server is enabled in-game (check mod config)
- Verify the configured URL and port match
[MCP Server] Port in BepInEx config
- In multiplayer, point the extension at the host machine
No chips shown
- Open the in-game IC editor first
- Make sure the selected device has a Lua chip installed
- Refresh the chip explorer
Export warns that the chip must be opened first
The extension exports your local tracked source. Click the chip in the Chip Explorer to open it in VS Code before exporting.
EnableExperimentalDebugger = true must be set in the mod's BepInEx config and the game must be restarted.
License
MIT