GTerm logo

GTerm

Community
Earu

Garry's Mod external console software with MCP and Websocket support.

PublisherEaru
RepositoryGTerm
LanguageC#
Forks
6
Stars
28
Available tools
0
Transport typestreamable-http
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    GTerm exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    28 stars and 6 forks from the linked repository.

GTerm

Garry's Mod external console software.

Client Installation

  • Download the latest release.
  • Launch the gterm executable whenever Garry's Mod is running.
  • Restart Garry's Mod to complete the installation.
  • Enjoy!

Server Installation (steamcmd)

  • Download the latest release of gterm.
  • Move the .dll (even on macos/linux!) under srcds/garrysmod/lua/bin (if the bin folder doesnt exist, create it).
  • In srcds/garrysmod/lua/includes/init.lua add at the top of the file require("gterm").
  • Restart the server.
  • Launch the gterm executable.
  • Enjoy!

IMPORTANT NOTE: GTerm communicates with the gmod module over a localhost TCP socket (127.0.0.1:27514), so GTerm must run on the same host as the server. If you run your server inside a docker container or any other sandbox, run GTerm inside that same sandbox (or otherwise share the loopback interface).

In case GTerm does NOT detect your Garry's Mod CLIENT installation

  • Download the latest release of gterm.
  • Move the .dll (even on macos/linux!) under GarrysMod/garrysmod/lua/bin (if the bin folder doesnt exist, create it).
  • In GarrysMod/garrysmod/lua/menu/menu.lua add at the bottom of the file require("gterm").
  • Restart Garry's Mod.
  • Voila!

WebSocket API

GTerm includes a WebSocket server for console streaming and command execution.

Setup:

  1. Enable API in Config.json: "API": true
  2. Connect WebSocket clients to ws://localhost:27512/ws/

Configuration Options:

json
{
  "API": true,
  "APIPort": 27512,
  "APISecret": "your_secret_here"
}

Example Payloads:

Sending commands (text message):

status

Receiving console output (JSON):

json
{
  "Time": 1704123456,
  "Data": [
    {
      "Color": { "R": 255, "G": 255, "B": 255, "A": 255 },
      "Text": "hostname: My Server\n"
    }
  ]
}

MCP Server Integration

GTerm includes an MCP (Model Context Protocol) server for AI agents such as Cursor, Vscode, Zed, Claude Code, etc..

Setup:

  1. Enable MCP in Config.json: "MCP": true
  2. (Optional) Set "MCPSecret" for authentication
  3. Configure your MCP client to connect to http://localhost:27513 (add ?secret=... if using authentication)

Available Tools:

  • get_game_status - Report whether GMod is connected, in a session, and which Lua realms can run code right now (map, gamemode, players). Works even while GMod is closed. Agents should call this first.
  • run_gmod_command - Execute a console command and capture its output
  • execute_lua_code - Execute Lua in a required realm (server or client).
  • validate_lua_syntax - Compile-check Lua with the game's own CompileString without executing it
  • check_game_file - Ask the running game whether a path exists in its virtual filesystem (mounted addons/GMAs included), not just on disk
  • capture_console_output - Monitor console output for a duration
  • list_gmod_directory - Browse the Garry's Mod file structure on disk
  • read_gmod_file - Read a text file from the installation on disk
  • read_game_file - Read a file's contents from the running game's virtual filesystem (mounted addons, Workshop GMAs), which the on-disk reader can't see
  • take_screenshot_region - Capture one rectangle of the screen and return it enlarged, so a HUD element, viewmodel or panel is actually legible. Preferred over the full-screen shot for anything specific
  • take_screenshot - Capture the whole screen. Last resort: prove things with Lua state and arithmetic first
  • read_gmod_wiki - Fetch a page from the Garry's Mod wiki (wiki.facepunch.com/gmod) to check a function's real signature before using it
  • list_tool_packages - Lists all the third party tools provided by addons in lua/gterm_packages/*.lua (see below)
  • request_tool_packages - Ask the user, in GTerm's own console, which packages to enable. The agent cannot choose by itself
  • call_package_tool - Run one tool from an enabled package with a JSON args object

Every tool result is prefixed with a [GTerm] status line so the agent always knows the connection and realm state. When a precondition is not met (disconnected, wrong realm, no session), the tool returns an error explaining what to do rather than failing silently; pass force: true to attempt the call anyway.

Seeing what an agent is doing. MCP clients show the tool name but usually not the arguments, so GTerm surfaces them itself: every tool call prints a magenta [agent] line in GTerm's console before it runs. Lua is shown in full on its own lines with Monokai syntax highlighting, and console commands are highlighted inline.

MCP Tool packages (opt-in)

Addons and servers can provide their own tools to the agent as Lua files at lua/gterm_packages/<package>.lua. GTerm discovers and loads packages with client-realm Lua (sv_allowcslua must be 1).

Enabling is done manually in GTerm's console using packages in GTerm, or when the agent calls request_tool_packages. Consent is stored in Config.json under ToolPackageConsent per scope (server IPv4, or local for listen servers and singleplayer).

The file returns a table: optional description, optional server (IPv4; only usable on that server), and tools. Each tool has name ([a-z][a-z0-9_]*), description, inputSchema (JSON schema, type = "object"), optional realm ("client", the default, or "server"), and run(args). Its return value (string or table) comes back as the result, capped at 4096 characters by print. Limits: 32 tools, 512-character descriptions, 8 KB input schema, 256 KB definition. Package names: [a-z0-9][a-z0-9_-]{0,63}.

Example lua/gterm_packages/my_addon.lua:

lua
return {
    description = "Helpers for my addon.",
    tools = {
        {
            name = "find_entities",
            description = "Lists entities of a class near the local player.",
            inputSchema = {
                type = "object",
                properties = {
                    class = { type = "string", description = "Entity class, e.g. prop_physics" },
                    radius = { type = "number", description = "Search radius in units (default 512)" },
                },
                required = { "class" },
            },
            run = function(args)
                local out = {}
                for _, e in ipairs(ents.FindInSphere(LocalPlayer():GetPos(), args.radius or 512)) do
                    if e:GetClass() == args.class then out[#out + 1] = { id = e:EntIndex(), pos = tostring(e:GetPos()) } end
                end
                return out
            end,
        },
        {
            name = "count_props",
            description = "Counts props on the server (listen server or singleplayer only).",
            inputSchema = { type = "object" },
            realm = "server",
            run = function() return #ents.FindByClass("prop_physics") end,
        },
    },
}

Configuration Options:

json
{
  "MCP": true,
  "MCPPort": 27513,
  "MCPCollectionWindowMs": 1000,
  "MCPSecret": "your_secret_here"
}

MCP Client Example (with secret):

json
{
  "mcpServers": {
    "gterm": {
      "url": "http://localhost:27513?secret=your_secret_here"
    }
  }
}

Use GTerm MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once GTerm is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP connects through a hosted MCP server URL in TypingMind.

Add an MCP server URL

Use this when GTerm is already hosted remotely or your team wants one shared connector that multiple users can access.

1

Open MCP connectors

In TypingMind, go to Plugins, open MCP connectors, then choose Add URL.

  1. Open TypingMind in your browser.
  2. Go to Plugins.
  3. Open MCP connectors.
  4. Click Add URL.
TypingMind Add Custom MCP Server URL form
2

Paste the server URL

Enter the MCP server URL from the provider in the Server URL field. Add a connection name, description, icon, custom HTTP headers, or OAuth client settings if the server requires them.

  1. Paste the MCP server URL from the provider into the Server URL field.
  2. Enter a connection name for GTerm.
  3. Add a description and icon if you want it to be easier to identify.
  4. Add custom HTTP headers or OAuth client details if the server requires authentication.
3

Create the connection

Click Create connection, then return to the Plugins list and confirm the new MCP connection is active.

  1. Click Create connection.
  2. Return to the MCP connectors list.
  3. Confirm the GTerm connection appears as active.
  4. Refresh the plugin list if the connection does not appear immediately.
4

Switch models without reconnecting

Start a chat with your preferred model, enable the GTerm tools from Plugins, and switch to another model whenever needed. The MCP connection stays available to the TypingMind workspace.

  1. Start a new chat in TypingMind.
  2. Select the AI model you want to use.
  3. Enable the GTerm tools from Plugins.
  4. Ask the model to use the tool when needed.
  5. Switch to another AI model and reuse the same MCP connection.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use GTerm to help me with this task?
GTerm
Sure. I read it.
Here is what I found using GTerm.

Frequently asked questions

What is the GTerm MCP server used for?

GTerm is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use GTerm MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use GTerm with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use GTerm MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With GTerm connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect GTerm MCP to TypingMind?

GTerm can be connected in TypingMind by adding its hosted MCP server URL. This is useful when you want a remote MCP connection that is available from your TypingMind workspace.

What tools does GTerm MCP provide in TypingMind?

GTerm exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use GTerm MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If GTerm requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇