Server data from the Official MCP Registry
MCP server for Garry's Mod: Lua in every realm, maps, console, errors, screenshots, hook tracing.
About
MCP server for Garry's Mod: Lua in every realm, maps, console, errors, screenshots, hook tracing.
Security Report
Valid MCP server (1 strong, 1 medium validity signals). No known CVEs in dependencies. Imported from the Official MCP Registry.
6 files analyzed · No issues found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
Permissions Required
This plugin requests these system permissions. Most are normal for its category.
How to Install
Install command not verified. See the repository for install instructions.
View repositoryDocumentation
View on GitHubFrom the project's GitHub README.
gmod-mcp
The GMod MCP server that runs inside the game: Lua in every realm, maps, console, errors, screenshots, hook tracing, test clients and long-running jobs, straight from inside the game.
[!TIP]
Quick start (Claude Code, Windows)
1. In Claude Code, run:
/plugin marketplace add ExtReMLapin/gmod-mcp /plugin install gmod-mcp@gmod-mcp2. Restart Claude Code.
3. Ask Claude:
set up gmod-mcpThat's it. Claude installs the module in your game (it asks first) and starts Garry's Mod with
-mcp.4. Turn on updates (recommended):
/plugin→ Marketplaces →gmod-mcp→ Enable auto-update. Claude Code keeps auto-update off for marketplaces other than Anthropic's, and noclaude pluginsubcommand turns it on. See Updates.Other MCP clients, Linux or a dedicated server: see Install. Tested with Claude Code 2.1.325.
An MCP server that lives inside Garry's Mod. Drop one native module into your game and an AI coding agent (Claude Code or any MCP client) can run Lua in the menu, client and server realms, load maps, read the console and errors, inspect and edit the world, take screenshots, trace hooks and look up the documentation — on your own machine.
- Self-contained: one DLL, one small Lua file and a small block in
menu.lua(see What gets modified). With Claude Code, the plugin brings the module and adds a small bridge that Claude Code starts by itself. No Python, no Node, nothing to run yourself. - Local only: listens on
127.0.0.1with a bearer token, refuses pages from other sites, inactive unless the game is started with-mcp. - Safe by default: never touches the client realm while you are connected to someone else's server.
Contents
- Install
- Updates
- Feedback from agents
- Comparison with other servers
- Tools
- How it works
- Several games at once
- Code Mode (Claude Code)
- Configuration
- Security
- What gets modified in your game folder
- Uninstall
- Limitations
- Building from source
Install
You need Garry's Mod with the 64-bit binaries (the default on current Steam builds: bin\win64\gmod.exe, or
gmod_win64.exe at the root of the game folder on older installs). Two ways: the Claude Code plugin (the Quick start at
the top of this page), or by hand for any other MCP client.
Claude Code plugin
The repository is also a Claude Code plugin marketplace. In Claude Code:
/plugin marketplace add ExtReMLapin/gmod-mcp
/plugin install gmod-mcp@gmod-mcp
From a shell: claude plugin marketplace add ExtReMLapin/gmod-mcp, then claude plugin install gmod-mcp@gmod-mcp.
Restart Claude Code, then ask Claude set up gmod-mcp: its skill copies the two files into the game (after asking
you) and starts the game with -mcp. Claude Code stays connected while the game is closed: the tools say so, Claude
starts the game again instead of giving up, and they work again as soon as it is up, no reconnection needed. Updates:
see Updates.
The plugin holds:
- the
gmodMCP server:gmod-mcp-bridge, a small stdio program Claude Code starts by itself. It relays to the game, stays connected while the game is closed (tools then answergame_not_running), and tells Claude Code when the game is back. It reads the token from its file, so nothing secret lands in Claude Code's settings; - the module of the same version, for the game (Windows and Linux binaries);
- one skill: how to install or update the module, find the game folder, start the game with
-mcp, run several games, set up a dedicated server. It asks before touching the game folder and never restarts a game you just closed.
Each release publishes the plugin as one zip (gmod-mcp-plugin.zip, pinned by its SHA-256 in the marketplace), so the
repository holds no binaries.
If you added the server by hand earlier (claude mcp add ... gmod), the plugin does not replace that entry: both
stay and every tool is listed twice. Remove the old one with claude mcp remove gmod (add -s user if you added it
with --scope user; an entry added without a scope only exists in the folder where you ran the command).
Right after the install, Claude Code may say "1 userConfig option not yet set": that is the option that turns the feedback offers on or off, which is on by default. Nothing to do.
Remove the plugin with /plugin uninstall gmod-mcp@gmod-mcp.
By hand, 1. Garry's Mod side (drag and drop)
-
Download
gmod-mcp-win64.zip(Windows) orgmod-mcp-linux64.zip(a Linux dedicated server) from the latest release. -
Open it. Everything sits in a top folder,
gmod-mcp-win64/(orgmod-mcp-linux64/): drag thegarrysmodfolder from inside it onto your game folder (…\steamapps\common\GarrysMod, the one that already contains agarrysmodfolder). Accept the merge. That adds two files:garrysmod/lua/bin/gmsv_mcpagent_win64.dllandgarrysmod/lua/autorun/server/mcpagent_boot.lua. -
In Steam: Garry's Mod → Properties → Launch options, add:
-mcpRecommended, so the game keeps running at full speed in the background:
-mcp -windowed +engine_no_focus_sleep 0 +snd_mute_losefocus 0 -
Start the game and load any map once (Start new game). The module installs its main-menu loader by itself; from then on it starts at the main menu every time. The console says
[mcpagent] main-menu loader installed ….
By hand, 2. MCP client side
Open the game console (~) and type:
mcpagent_setup
It prints the exact setup for your machine, token included. For Claude Code without the plugin, paste this in a
terminal (--scope user makes it available in every folder; without it the entry only exists in the folder where you
ran the command):
claude mcp add --scope user --transport http gmod http://127.0.0.1:27080/mcp --header "Authorization: Bearer <token>"
Restart Claude Code. That's it. The same output also shows a .mcp.json snippet for other MCP clients (Streamable
HTTP + bearer token). The token is created once in %APPDATA%\gmod-mcp\token (Linux:
$XDG_CONFIG_HOME/gmod-mcp/token, ~/.config/gmod-mcp/token by default), never changes, and is only printed when you
ask for it — keep it private.
Without the plugin, Claude Code only connects if the game is already running when it starts; otherwise use /mcp,
Reconnect, once the game is up. The plugin avoids that. Other MCP clients can do the same with gmod-mcp-bridge from the
release zip, a stdio server that stays up while the game is closed.
Each release also attaches gmod-mcp.mcpb, the same bridge (Windows and Linux x86-64) as an
MCP Bundle, and is listed in the
official MCP Registry as io.github.ExtReMLapin/gmod-mcp: MCP clients that
install from the registry or open .mcpb files can use it. It is only the bridge: the game still needs the module from
step 1 above, and the game still has to run with -mcp.
Dedicated server
Same zip (gmod-mcp-linux64.zip for a Linux server), same drag and drop of its garrysmod folder into the server's
folder (the one that holds garrysmod and the server binary), and start the server with -mcp. Only the server realm
exists in that mode. The module is 64-bit: start srcds_win64.exe (Linux: srcds_run_x64). On Linux the default branch
of the dedicated server has no 64-bit binary: install it with +app_update 4020 -beta x86-64.
Linux server branches:
x86-64works on Ubuntu 22.04 (glibc 2.35, where it was tested) and newer.dev(64-bitsrcds_linux64) needs glibc 2.38 andGLIBCXX_3.4.32(Ubuntu 24.04 or newer): the server binary itself does not start on older systems, with or without the module.- The public (default) branch is 32-bit only. The module is 64-bit and is not loaded there; the server starts normally, without gmod-mcp and without a crash.
game_quit on a dedicated server: the engine blocks the console quit from server Lua, so on Linux the module ends the
process itself with SIGTERM (the server's own clean shutdown) half a second after it answered. On a Windows dedicated server
there is no such path and game_quit answers the error blocked (stop the server from its console, or use
game_terminate, which kills it at once). game_terminate works the same on both systems.
mcpagent_setup works in the server console too. The plugin and the bridge reach a server running on your machine
like a game: a server alone takes port 27080; next to a client game, use instances_list and pass instance
(see Several games at once). The plugin's skill can also set a server up for you.
Updates
-
What updates by itself. With auto-update on (
/plugin→ Marketplaces →gmod-mcp→ Enable auto-update), Claude Code updates the plugin a few minutes after a session starts; the new version runs from the next start of Claude Code (or after/reload-plugins). Claude Code keeps it off for third-party marketplaces and noclaude pluginsubcommand turns it on: use that menu. -
By hand, in a shell:
claude plugin marketplace update gmod-mcp claude plugin update gmod-mcp@gmod-mcpthen restart Claude Code (or
/reload-plugins). The first command matters: Claude Code compares with its local copy of the marketplace, and without refreshing itplugin updateanswers "already at the latest version". -
What is in the plugin: the bridge Claude Code talks to, the skill, and a copy of the module for the game.
-
What does not update by itself: the module loaded by the game (
garrysmod/lua/bin/gmsv_mcpagent_*.dll). After a plugin update, quit Garry's Mod and ask Claudeupdate gmod-mcp: the skill copies the new module into the game. Until then, tool results carry a warning that names both versions: the bridge learns the module's version when the game first answers, so it shows from a moment after that, and the server instructions carry it too. -
Without the plugin: quit the game (it keeps the DLL locked), download the new zip from the releases and overwrite the two files. The version warning is a feature of the bridge, so only the plugin gives it.
-
What the commands download:
/plugin marketplace addclones this repository (to read its.claude-plugin/marketplace.json);/plugin installand updates download only the release zip of that version (gmod-mcp-plugin.zip, checked against its SHA-256), not the source code.
Feedback from agents
Agents using gmod-mcp are asked (server instructions, guide, skill) to note the frictions they meet with it and, at the
end of a task, to offer you to report the ones that cost real time or a feature. If you agree, they draft the issue in
English with no secrets, paths, project names or code, look for duplicates, and file it with gh when it is installed
and signed in (otherwise they give you a prefilled link: one click). Issues carry the agent-feedback label.
To turn the offers off, set the plugin option feedback_offers (on by default) to false: /plugin configure gmod-mcp@gmod-mcp in Claude Code, or in a shell:
echo '{"feedback_offers": "false"}' | claude plugin configure gmod-mcp@gmod-mcp --values-stdin
Then restart Claude Code.
Comparison with other servers
As of 2026-11-14, gmod-mcp covers the most capabilities of the 22 Garry's Mod MCP servers we compared. Code read, nothing executed · method & full table
Repos: ExtReMLapin/gmod-mcp · AmyJeanes/GMod-MCP-Server · Sycatle/gmod-mcp · TomDotBat/gmcl_mcp · Pollux12/vscode-gmod-glua-ls · Celant/GmodMCP · Earu/GTerm · mathis1M/gmod-mcp · 14 more
Tools
| Area | Tools |
|---|---|
| Session | status, map_list, map_load (then: {tool, args} runs one follow-up, e.g. lua_exec or tests_run, in the same call once the map is loaded), disconnect, game_quit, game_terminate, wait_for, wait_frames |
| Lua | lua_exec, lua_exec_file, lua_reload (run an addon file again from the disk, in its realms), lua_check (syntax and globals of a snippet, file or whole addon, without running it), lua_job (long work spread over frames, with progress; async: true with lua_job_status / lua_job_cancel), lua_inspect, lua_function_source (is a running function the code on disk?), lua_mount (this game loads Lua from your worktree first), lua_file_write / _read / _list / _delete, tests_run (GLuaTest format; compact answer by default, path may be an array of globs, exclude leaves files out) |
| Hooks | hook_list, hook_trace, perf_hook_cost |
| Console | console_exec (a 1; b 2 runs two commands like the console; an unknown command is an error; convars it sets are read back), console_read, console_wait (block until N lines match, e.g. the end of a batch), console_buffer, convar_get, convar_set, concommand_list |
| Errors | errors_since (Lua errors from all three realms, with stack; grouped by message by default, at most 20 groups, group_by: "none" for the raw list), errors_clear |
| World | ents_find, ent_info, ent_spawn, ent_remove, ent_fire, players_list, player_set, bots_add, trace, trace_through (every surface crossed, with thickness and material) |
| Rendering | screenshot (works at the main menu, in a dialog and on a loading screen too, on Windows; at most 960 px wide as a JPEG by default, full: true for the full size; wait_frames: N waits N frames first), screenshot_from (arbitrary camera), debug_draw, debug_clear |
| UI input | ui_click (click or scroll at a pixel of a screenshot), ui_key (keys and text; characters outside the machine's ANSI code page are refused, the engine would alter them): dialogs, Derma and menu buttons that have no console command. Windows test clients only; posted to the game's own window, your real mouse and focus are untouched |
| Sound | sound_emit, sound_trace |
| Performance | perf_snapshot |
| Documentation | api_search (what really exists in each realm), wiki_search, wiki_page (wiki.facepunch.com, cached) |
| Events | events_wait (long-poll: map_loaded, lua_error, main_thread_stalled…), reports_read / reports_channels / reports_clear (fed by mcpagent.report() from your scripts) |
| Instances | instances_list; with the plugin (Windows): instances_launch (1 to 8 test clients), instances_close, instance_select (the session's default instance) |
Besides tools, the server offers:
- Prompts (slash commands in Claude Code):
write-lua-job,debug-errors,run-tests,check-map, with completion of map names, realms and test files. - Resources: the agent guide (
mcpagent://guide),gmod://errorsandgmod://console(subscribable: the client is told when they change), and the templatesgmod://wiki/{page}andgmod://lua/{path}. - Progress and cancellation: long tools report progress while they run, and stop when the client cancels.
Long operations (
map_load, long waits, long jobs) run as background MCP Tasks for clients that support them. - Confirmation: changing a convar saved in your
config.cfgasks you first (when the client supports it).
Long-running Lua jobs
lua_exec runs code in one go, and the game is frozen while it runs. For anything longer, lua_job runs the script
as a coroutine resumed once per frame. The script talks back through a job object, and its progress shows up in
Claude Code while it runs:
local props = 0
local all = ents.GetAll()
for i, ent in ipairs(all) do
if ent:GetClass() == "prop_physics" then props = props + 1 end
if i % 100 == 0 then job:progress(i, #all, props .. " props so far") end
job:step() -- hands control back to the game once this frame's time slice is used
end
return { props = props }
Also available: job:sleep(seconds), job:frames(n), job:wait(fn, timeout), job:report(value) for intermediate
results, job:dt() (real seconds since the last resume; FrameTime() on the server is the tick step, not that interval), job:call(realm, code) (runs a chunk in the other realm of the instance and returns its values, so one job can move the player on the server and check what the client sees), and args (also job.args) for the call's arguments. async: true returns at once with a job id
(lua_job_status returns only the reports added since your previous call and, with wait_s of 15 or more, comes back by itself; lua_job_cancel), and fresh_env: true keeps the script's globals out of the game's _G. The agent learns this protocol from the tool description and the
write-lua-job prompt.
Testing a branch: the mounted Lua folder
Every game process loads the addons from the same garrysmod/addons/ folder, so an agent that works in a git worktree
of an addon cannot test its branch in one test client without changing the folder every other client (and your own
game) uses. The mounted folder solves this per process: lua_mount {path: "D:/dev/my-addon-wt"} (or
instances_launch {lua_mount: "D:/dev/my-addon-wt"} for a new test client) makes that one game look for Lua files in the
worktree before every addon. include(), autorun files and AddCSLuaFile then get the branch's files, at every map
load, and the other games keep the installed addon.
instances_launch {count: 1, owner: "fork-a", lua_mount: "D:/dev/my-addon-wt", map: "gm_construct"}
lua_function_source {realm: "server", expr: "MyAddon.Update"} -> source: the worktree's file
pathis the addon's root (the folder that containslua/) or itslua/folder, absolute. Itsgamemodes/folder is overlaid too (materials, sounds and models are not: see the table below).- The path must be ASCII-only: the game's file system lists a folder with non-ASCII characters but loads none of its
files, so
lua_mountrefuses it. Use an ASCII junction instead (mklink /J C:\dev\my-addon "D:\Développement\my-addon"). - It applies to files loaded from then on. Code that already runs is not run again: after
lua_mount, callmap_load.instances_launch {lua_mount}sets it before the first map, so nothing more is needed there. lua_mount {}shows the current mounted folder and the engine's Lua search paths;lua_mount {path: null}removes it (from the next map load).- The engine caches Lua files by name and file time;
lua_mountempties that cache when it changes (so an addon file and its worktree copy with the same name and time cannot be mixed up). Example: the worktreeD:/dev/my-addon-wtof the addon installed asgarrysmod/addons/my_addon, mounted withlua_mount {path: "D:/dev/my-addon-wt"}thenmap_load:
| File on disk | What this game does with it |
|---|---|
D:/dev/my-addon-wt/lua/autorun/my_addon.lua | runs as autorun/my_addon.lua (instead of the installed one) |
D:/dev/my-addon-wt/lua/my_addon/core.lua | what include("my_addon/core.lua") loads |
D:/dev/my-addon-wt/lua/my_addon/new.lua (only in the branch) | found by include("my_addon/new.lua") |
garrysmod/addons/my_addon/lua/my_addon/old.lua (deleted in the branch) | still loaded from the installed addon |
D:/dev/my-addon-wt/gamemodes/<gm>/... | gamemode files |
materials/, sound/, models/, anything else | not mounted |
- What sees the mounted folder (checked in game): autorun files,
include(),AddCSLuaFile(the client gets the folder's copy), the console'slua_openscript/lua_openscript_cl,file.Read/file.Findwith"LUA", and gmod-mcp'slua_exec_file,lua_job {path},lua_check,lua_reloadandlua_function_source, which look in the same order as the engine. Not affected: materials, sounds, models,data/. - A file of the folder hides the installed addon's file with the same Lua path; files only in the game are still loaded, including a file your branch deleted.
- The engine names the folder's files from the folder's root:
debug.getinfo(f).sourceis@lua/my_addon/x.lua, not@addons/my_addon/lua/my_addon/x.lua. - No autorefresh:
status.lua_mount.stale_fileslists the folder's files that changed since each realm loaded them;lua_reload {mounted_changed: true}runs them again (orlua_reload {path}for one file, ormap_load), thenlua_function_sourceto check that the running function is the file's. A reload re-runs the file: it does not undo hooks or entities the old copy created.map_loadwarns when the folder changed during the load, and empties the engine's Lua file cache first. - Which copy ran:
lua_function_sourceandlua_inspecton a function returnfrom_mountand the realdiskpath (@lua/x.luais the same name for the folder's copy and an installed one). It is recorded when the folder was put in front of the realm's Lua path, not guessed from the name. - Windows game clients only for now: not on Linux (the engine's filesystem interface is not verified there) nor on a dedicated server (its filesystem interface is not reachable the same way).
- How it works: the engine's own search paths (
IFileSystem::AddSearchPathat the head of the Lua path IDs), put back in front at every map start; see docs/REVERSE.md. Nothing is written to the game folder.
How it works
A Garry's Mod process runs up to three Lua states: menu (always there), client and server (created when a map loads, destroyed when it unloads). The module is loaded once per process, in the menu state, and drives the other two, re-injecting its small Lua runtime each time a map loads.
flowchart LR
agent["AI agent<br/>(Claude Code)"] -- "MCP over HTTP<br/>127.0.0.1:27080" --> http
subgraph game["the 64-bit game (one process)"]
direction TB
subgraph dll["gmsv_mcpagent (native module, loaded once)"]
http["HTTP / MCP server<br/>(network thread)"] -- "job queue" --> pump["pump<br/>(main thread, every frame)"]
end
pump --> menu["menu state<br/>always present"]
pump --> client["client state<br/>after a map loads"]
pump --> server["server state<br/>singleplayer / listen"]
end
All Lua runs on the game's main thread; the network thread only queues work, so a frozen game can still be inspected
(status) and killed (game_terminate).
With the plugin, Claude Code does not talk to the game directly: it starts gmod-mcp-bridge (stdio) and the bridge
relays every message to the game over that same HTTP connection. The bridge listens on nothing, answers while the game
is closed (every tool listed, calls saying the game is not running), tells Claude Code when the game is back, and holds
the tools that must work without a game: instances_launch, instances_close, instance_select.
Several games at once
Each game process (a client, a dedicated server…) has its own MCP server on its own port: 27080, then 27081, 27082… Nothing is shared between processes except a directory.
flowchart LR
agent["AI agent"] --> coord["client game<br/>:27080 (holds the base port)"]
coord -- "relay: instance=srcds-…" --> srcds["dedicated server<br/>:27081"]
srcds -. "heartbeat every 2 s" .-> coord
- The process holding the base port also acts as a directory and relay:
instances_listshows every running game, and any tool accepts aninstanceargument to target another game. So Claude Code needs a single entry. - With one game running, nothing changes: no
instanceneeded. With several, calls withoutinstanceare refused withambiguous_instance(listing the ids) instead of guessing, and every answer says which game produced it (answered_by). - A game that crashes is told apart from one that quit: calls to it answer
client_crashed(server_crashedfor a dedicated server) with the name of the crash dump incrashes/(when one was written) and the exit code, andinstances_listshows it ascrashedfor an hour. The coordinator decides from the game's own goodbye at shutdown, agame_quit/game_terminatesent through it, a dump written just before the process ended, and its exit code. A process killed from outside with no dump looks like a crash with exit code 1. A call in flight to a game that dies is answered at once, and the answer carries the free memory of the machine (out of memory is a likely cause). - A game that is hung is flagged:
instances_listgivesstalled_s(seconds its main thread has been blocked) andfps_low_s(seconds under 10 fps), and the state becomeshungafter 60 s (180 s during a map load) with the advice to close and relaunch; a call to a frozen process fails withinstance_hungafter 30 s without heartbeat.instances_launchchecks the free commit and RAM first and refuses withlow_memory(the figures, how many clients run) when they cannot hold the clients;ignore_low_memory: trueoverrides it. - If the game holding the base port exits, the others keep running; within a few seconds one of them takes the base port over and the rest register with it.
- A long call (an MCP task) lives in the game that runs it. A
lua_job,map_load, longwait_for... started as a task for another instance is created by that instance, and its task id starts with that instance's id (client-1234.<hex>). The coordinator only relaystasks/get,tasks/result,tasks/cancelandtasks/list, so whichever game holds the base port later finds the task again: closing or losing the coordinator no longer loses it, as long as the game that runs it lives. During the hand-over (about 3 s) a task request answers the retryablecoordinator_changing(the plugin retries it for you); if the owning game ended, it answersinstance_gone,client_crashedorinstance_hungwith the reason, never "task not found".async: trueis still the way to keep a job's result in the game for a poll of your own.
Several clients can run side by side too. With the Claude Code plugin, the instances_launch tool starts 1 to 8
test clients (small, frame-capped, on a private desktop, Windows for now), instances_close closes them (by id, pid or owner label),
and instance_select sets the default instance of a session. Its description gives the measured cost: about 1.5 GB of
RAM and a fifth of a CPU core per client. Sub-agents of one Claude Code session share that session: each one labels its
clients with owner and closes only those. The label travels with the game (command line and heartbeat), so
instances_list shows it on every instance and instances_close {owner} still finds clients started with keep: true
by an earlier session; it never closes a game that is not one of our test clients.
Starting a game makes every other running Garry's Mod release its GPU resources for 2-10 s, and a map load ending in
that window crashes that game (engine bug, Facepunch garrysmod-issues#7137).
The bridge therefore makes instances_launch and map_load wait for each other (every session of the user shares the
lock; every result carries waited_s / waited_reason (0 / null when nothing waited), duration_s and load_s (the games' own time), errors map_load_in_progress / launch_in_progress when the wait would
exceed timeout_s), and instances_launch {map} loads its maps after a 15 s settle delay; at most 2 maps load at a time across all sessions (a third map_load or launch load waits, map_load_in_progress at the timeout). It also sees map
loads it did not start (console map, Lua, a script talking to the game: every game reports loading in instances_list),
instances_launch waits for them too and map_load lists them (other_games_loading). It cannot hold back a game you
start by hand, nor a console or Lua map load started while a launch is creating its processes: do not do those while
other games load or launch.
Right after a game starts, the other games can be unreachable for 15-18 s (instance_unreachable): wait and retry. Best
order: launch all clients in one instances_launch, then work. GMOD_MCP_FP7137_WORKAROUND=0 turns the wait off.
The game that holds the base port is the coordinator (instances_list shows it): when it ends, another game takes the role over in about 3 s and calls with instance answer the retryable coordinator_changing meanwhile (the bridge retries for 10 s); instances_close says when it closed the coordinator.
The clients start on a private Windows desktop (desktop: "private", the default; Windows only). What makes your own game
freeze and glitch when a test client starts is the new game's broadcast, which only reaches the windows of its own
desktop: a client on another desktop of the same window station never finds your game, so your game is not disturbed
at all (measured: no video-memory drop, no blocked main thread). One desktop per bridge session, created at the first
launch and closed once its last client is gone. What it changes: the clients have no window and no taskbar button (close
them with instances_close, not by hand), they never take your focus (no -mcp_return_focus), and they are silent by
default (-nosound; pass sound: true for sound tests, as SoundDuration of ADPCM WAV files differs without sound).
ui_click, ui_key and screenshot still work (the module posts window messages inside the game's own process, and
the screenshot is the engine's own capture). desktop: "shared" starts them on your desktop as before (visible window,
the foreground handed back to you). The clients of one session share their desktop, so they still disturb each other:
the waits above still apply. Games started by hand are not on it: they are covered by the waits only.
The clients share the game folder with your own game, including data/, cfg/ and the cookies (sv.db/cl.db): a
test that writes there changes your game too, and nothing in the module redirects or hides those writes (it does not
replace any of the game's file.* functions, so an addon that checks them sees the real ones). An addon that caches into
data/ does it in the first seconds after the map loads (and an addon whose cache format changed may delete the old cache
there), before commands can switch it off: its convars do not exist yet. Switch its writes off with early_lua, and
clean up after the test.
early_lua runs your Lua in the client and server realms of each client before any addon's file, to set what an
addon reads before its first write (an addon's convars and globals do not exist when commands run): set its own
switch, hook a function, wrap a call. The module writes it into a small autorun file that it mounts in front of every
addon, so it replaces nothing in the game. A Lua error in it is printed to the console, not raised. status shows
early_lua (mounted, and error when the mount was refused: the code then does not run). The temporary folder of
that file is removed by instances_close and at the end of the session; a client killed together with its bridge leaves
it behind and the next launch removes folders nothing touched for three days.
Archived convars changed through commands, launch_args or fps_max are given back to your value from
cfg/config.cfg before a clean quit, like the options the tool sets itself (the module restores those that exist and
are archived at that moment; the list is fixed at launch, so a convar an addon creates later and that you set from
console_exec is not restored). instances_close kills the process: nothing is written then.
Before a launch the bridge compares the module in the game folder (lua/bin) with the one the plugin ships: an older one
refuses the launch with module_outdated and the update steps (ignore_outdated_module: true starts anyway), and
instances_list / the game_not_running error show module_outdated while no game runs.
Test clients leave your video settings alone. Garry's Mod normally saves the window size it was started with as its video setting (resolution, anti-aliasing, ... in the registry).
instances_launchstarts its clients with-dxlevel 95, the level the engine keeps on current hardware: with that option the engine neither reads nor writes those settings, so your own resolution is still there at your next start. (Clients that older versions of gmod-mcp started could overwrite it: if your game opens small, set the resolution again in the video options. Clients you start by hand with-w/-hstill save their size: add-dxlevel 95to avoid it.)
Test clients leave your frame cap and focus options alone.
instances_launchstarts its clients with+fps_max 20(30 for thenormalpreset),+fps_max_nofocusand+snd_mute_losefocus 0. Those convars are saved intocfg/config.cfgwhen a game quits cleanly, and your own game reads the same file: a test client that quit would have left yourfps_maxat 20. The clients now carry-mcp_test_client, and before one quits cleanly (game_quit, aquitsent throughconsole_exec, the main menu's Quit button, the window's close button) the module sets each of these convars back to the value yourconfig.cfghas at that moment, or to the convar's default when the file has no line for it. Not covered: aquittyped by hand in a test client's console.instances_closekills the process, which saves nothing. (A client that older versions started and then quit may have changedfps_maxin your config: check it in the options.)
Frame cap, extra options and startup commands for test clients. instances_launch takes a few options for what the
presets do not cover (they are checked before anything starts; a refused one is invalid_params naming it):
instances_launch {count: 1, fps_max: 300, fps_max_nofocus: 0,
commands: ["snd_mute_losefocus 0", "cl_showfps 1"],
launch_args: ["-noborder"], map: "gm_construct"}
fps_maxandfps_max_nofocus(integers,0= no cap, otherwise 10 to 1000) replace the preset's frame cap (fps_max_nofocusfollowsfps_maxwhen only that one is given). The result says what the clients run at (fps_max,fps_max_nofocus,fps_note).commandsare console commands run on each client once it answers, before the map loads, in order;instances[].commandssays how each went.quit/exit,connect/retry/redirect/connect_lobby(gmod-mcp never connects to a server) and map changes (map,changelevel,load: usemap) are refused.launch_argsare extra engine command-line tokens, one per array element (["+cl_showfps", "1"], a word without spaces, quotes or;). Refused: what gmod-mcp sets itself (-multirun,-mcp*,-w,-h,-width,-height, the window-mode options,-dxlevel,-condebug,-game),+connectand+map. The options are listed on the Valve Developer Community, Command line options (and the Garry's Mod wiki for the GMod-specific ones); console commands and convars are listed byapi_searchandconcommand_list.
The archived convars these options change (fps_max, a +convar token, a command such as cl_showfps 1 or toggle snd_mute_losefocus) are given back to your value before a clean quit, exactly like the built-in ones above (the bridge
lists their names to the module with -mcp_restore_convars; this needs the module of the same release, an older one
restores only the four it knew). A convar changed by exec of a cfg file is not tracked.
Code Mode (Claude Code)
Claude Code's experimental Code Mode lets the model write JavaScript that calls the tools
(await tools["mcp__plugin_gmod-mcp_gmod__status"]({})). gmod-mcp works with it:
- A result arrives as a string, the JSON of
structuredContent:JSON.parseit (and accept an object too, a later Claude Code version may pass one). - An error throws, and
e.detailis the parsed error{"error": {code, message, details, next_call?}}: the text of every error is exactly that JSON object, also the ones the bridge answers itself (game_not_running,port_conflict...) and when the plugin and the module have different versions (the warning is a field of that object,version_warning). - A long call (
map_load, a wait of 15 s or more) is answered synchronously when it comes from a script (Claude Code marks those calls), soawait map_load(...)returns the real result. Outside Code Mode, a client that supports MCP tasks getsmap_loadas a background task: setGMOD_MCP_TASKS=off(see Configuration) to turn that off for every client. - At most 10 calls run in parallel in a script. Map loads and launches are still one at a time (the
FP7137 lock), so parallel
map_loadcalls queue.
Configuration
| Launch option | Effect |
|---|---|
-mcp | Required. Without it the module prints one line and does nothing (and never touches any file). |
-mcpport <n> | Base port, 1 to 65000 (default 27080; anything else falls back to it). The module tries the base port, then the 15 next ones, and refuses to start if none is free. |
Documentation truncated — see the full README on GitHub.
Reviews
No reviews yet
Be the first to review this server!
More Developer Tools MCP Servers
Rea
Freeby Morluto · Developer Tools
Reverse engineer anything from your terminal or agent with one CLI and MCP server.
Paperclip
Freeby Paperclipai · Developer Tools
Trending hip-hop artist momentum scores across four cultural dimensions.
Scrapling
Freeby D4Vinci · Developer Tools
Web scraping with stealth HTTP, real browsers, and Cloudflare bypass. CSS selectors supported.
Server Time
Freeby Modelcontextprotocol · Developer Tools
Current time lookup and conversion between IANA timezones
Toleno
Freeby Toleno · Developer Tools
Toleno Network MCP Server — Manage your Toleno mining account with Claude AI using natural language.
MCP Marketplace
Freeby mcp-marketplace · Developer Tools
Search and install MCP servers from inside your AI client.
