Skip to main content

Model Context Protocol Integration

For LLM-based workflows, LHM provides a configurable MCP server. It can be set to be accessible both from only the machine as well as in private network. The tools are focused on creating, editing and deleting teams/players/matches/tournaments, as well as LHM and game state management.

warning

Use LLM integration with caution; some of the tools are destructive and the model may use them to delete or overwrite existing records in LHM database.

MCP Server is available under /mcp endpoint and it uses Authorization header for authentication. It doesn't use OAuth.

Configuration

To turn on MCP Server and configure it, go to LHM Settings tab. In Additional section, there are 3 settings related to MCP Server:

MCP Settings in LHM

  • MCP server toggle lets you turn the server on.
  • MCP access select lets you choose whether the MCP integration should be available over LAN, or just from the current device.
  • MCP token option lets you generate and copy a new token, to be used in Authorization header in MCP requests.

OpenCode

To integrate LHM MCP tools into OpenCode, you can use following tool definition, by e.g. putting it into opencode.json file in your project:

{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"lhm": {
"type": "remote",
"url": "http://<LHM APP IP>:1349/mcp",
"enabled": true,
"oauth": false,
"headers": {
"Authorization": "Bearer <LHM MCP TOKEN>"
}
}
}
}

It's important to fill the <LHM APP IP> and <LHM MCP TOKEN> fields with appropriate values.

Tools

Tool list

ToolKindConfirmationDescription
get_current_gameReadNoReturns the selected game and supported game list.
get_latest_game_stateReadNoReturns the last captured game-state payload for the selected game.
get_map_infoReadNoReturns map data for the selected game, including veto-pool IDs, map metadata, loading state, and radar configs.
get_arg_statusReadNoReturns LHM Replay automation status.
get_hud_manager_versionReadNoReturns the running LHM version.
get_temporary_upload_asset_upload_infoReadNoGives local helpers the upload details needed to add image files for later save operations.
create_temporary_upload_assetWriteNoTemporarily stores an image so it can be used when saving a player, team, or tournament.
refresh_frontendWriteNoReloads LHM views and HUD browser pages so recent data changes appear.
list_playersReadNoLists current-game players; avatar values are served image references for display or retrieval.
save_playersWriteNoCreates players without _id and updates current-game players with _id.
update_player_fieldsWriteNoUpdates the custom fields available on players for the current game.
list_teamsReadNoLists current-game teams; logo values are served image references for display or retrieval.
save_teamWriteNoCreates a team without _id or updates a current-game team with _id.
update_team_fieldsWriteNoUpdates the custom fields available on teams for the current game.
delete_resourcesWriteYes, confirm: 'delete'Deletes one player, team, match, tournament, or signal; team deletion can optionally remove its players.
list_matchesReadNoLists matches for the current game.
save_matchWriteNoCreates a match or updates an existing match, filling missing match and veto details for the selected game.
save_matchesWriteNoSaves multiple matches at once and reports which entries were created, updated, or failed.
get_current_matchReadNoReturns the active match for the current game.
set_current_matchWriteNoToggles the active match for the selected game; calling it with the active match ID clears the active match.
reverse_sidesWriteNoReverses sides for the active match or active map veto.
create_match_vetoWriteNoCreates an online veto setup for a match when veto support is available.
delete_match_vetoWriteYes, confirm: 'delete'Deletes an online veto setup.
list_tournamentsReadNoLists current-game tournaments; logo values are served image references for display or retrieval.
save_tournamentWriteNoCreates a tournament without _id or updates a current-game tournament with _id.
get_current_tournamentReadNoReturns the active tournament for the current game.
set_current_tournamentWriteNoSets, clears, or toggles the active tournament for the selected game.
bind_match_to_matchupWriteNoBinds a match to a tournament matchup.
create_tournament_playoffsWriteNoCreates a playoff tournament from a group tournament.
recreate_tournament_matchWriteYes, confirm: 'recreate'Recreates and rebinds one tournament matchup match.
recreate_all_tournament_matchesWriteYes, confirm: 'recreate'Recreates missing tournament matches for a stage and may delete invalid downstream matches.
set_current_gameWriteNoSwitches LHM to another game and reloads game-specific data and HUDs.
list_hudsReadNoLists HUDs available for the current game.
refresh_hudsWriteNoRefreshes active HUDs, with an optional hard refresh.
get_hud_launch_paramsReadNoReturns saved HUD launch parameters for all games.
set_hud_launch_paramsWriteNoStores HUD launch parameters for the selected game.
launch_gameWriteNoDispatches the existing launcher for the requested supported game.
check_cs2_workshop_toolsReadNoChecks CS2 Workshop Tools installation status.
get_hud_ordersReadNoReturns persisted HUD ordering entries by game.
set_hud_ordersWriteNoSaves HUD ordering for the requested game.
update_togglesWriteNoUpdates HUD toggle settings for the current game.
get_live_player_orderReadNoReturns live player ordering for the current game.
set_live_player_orderWriteNoSets or clears a team-specific live player order for the requested game.
get_scout_stateReadNoReturns Scout automation state.
get_adrReadNoReturns ADR metrics for live CS2 players.
set_camera_delayWriteNoApplies a camera delay value to supported HUD configurations for the current game.
send_players_to_cameraWriteNoUpdates camera-room players, password, and quality, optionally broadcasting camera status changes.
regenerate_camera_roomWriteNoRegenerates the camera room UUID and re-registers current room players.
set_camera_fake_modeWriteNoEnables or disables fake camera-room mode.
get_hlae_statusReadNoReturns whether HLAE/MIRV is connected.
set_hlae_xrayWriteNoSets the live HLAE X-Ray color configuration for Counter-Strike.
revert_xray_configWriteNoReverts shared X-Ray configuration to defaults.
list_keybindsReadNoLists available LHM keybind actions and user overrides.
set_keybindWriteNoUpdates a user keybind mapping.
toggle_signalWriteNoToggles a signal preset active or inactive for the selected game.
test_signalWriteYes, confirm: 'send'Sends a test press to the configured Companion address.
save_signalWriteNoCreates or updates a current-game signal preset.
set_companion_addressWriteNoUpdates the Companion integration address.
update_acoWriteNoUpdates Scout settings.
toggle_acoWriteNoToggles Scout setting or sets it explicitly.
connect_streamdeckWriteNoConnects to a Stream Deck by device path.
disconnect_streamdeckWriteNoDisconnects the current Stream Deck.

Images upload

As putting an entire image in a MCP tool payload could result in huge message size, LHM provides a dedicated workflow. get_temporary_upload_asset_info_tool returns an URL that the agent should use to send a request with the image file, and then it should use the returned ID when saving players, teams or tournaments. Incorrect usage of the flow by the agent can result in the uploaded images being corrupted.

Frontend refresh

Most of the editing endpoints don't cause their changes to be shown live in the app. To remedy that, there's a dedicated refresh_frontend tool that the agent should be using when finishing edits.