Overview
GLuaLS includes a built-in MCP (Model Context Protocol) server. It exposes your connected SRCDS instance as tools for AI agents. When the debugger is connected, GitHub Copilot Chat (and other MCP-capable tools) can run Lua code, fetch console output, read errors, and check debug state without leaving chat.The GLuaLS team tests AI features with GitHub Copilot Chat. Other MCP AI providers may work, but GLuaLS does not support them.
Available MCP tools
When the debugger is connected, AI agents can use these tools:| Tool | Description |
|---|---|
run_lua | Execute a Lua string on the server and return the output |
run_command | Send a console command and return the result |
run_file | Run a specific Lua file on the server |
get_output | Fetch recent console output from the server |
get_errors | Get recent Lua errors from the error tracking panel |
get_debug_state | Get the current debugger state (paused, running, realm, etc.) |
Setting up
The extension starts the MCP server when it loads. It also registers tools with GitHub Copilot. To connect Copilot:Connect the debugger
Code execution tools (
run_lua, run_command, run_file) require an active debug session. get_output, get_errors, and get_debug_state can work whenever the MCP server is running.Configure Copilot to use the MCP server
The VS Code extension usually handles this step. Check that the “Garry’s Mod Language Server” toolset is enabled.