Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MB2_DEBUGNoSet to 1 to log tool timings to stderr0
MB2_REDACTNoSet to 0 to show the real home folder, user and computer names in tool output (default: masked)1
MB2_DATA_DIRNoHistory and backups (default `%LOCALAPPDATA%\mb2-mcp`)
MB2_GAME_DIRNoGame folder (auto-detected otherwise)
MB2_READONLYNoSet to 1 to disable module edits; cleanup actions can still delete server-owned records0
MB2_TOOLSETSNoTool groups to expose: `core,edit,l10n,scene,assets,editor,logs` (default all; fewer tools for small context windows)
MB2_WORKSHOPNoSet to 0 to not index Steam Workshop modules1
MB2_MAX_OUTPUTNoMax characters per tool result (default 40000)40000
MB2_POWERSHELLNoPath to Windows PowerShell for XSD/XSLT
MB2_MODULE_DIRSNoExtra folders with your own modules (writable), `;`-separated — link them into `<game>/Modules` for the game to load them

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
game_infoA

Start here. Shows the detected Mount & Blade II: Bannerlord install, game version, module folders, which modules are writable, the launcher's enabled mods, index/validation status and the recommended editing workflow.

list_modulesA

Lists installed modules (official, Steam Workshop, your own) with id, version, flags (official / writable / workshop / enabled in launcher) and folder. filter: all | official | mods | writable | workshop | enabled.

module_infoA

Details of one module: SubModule.xml fields, dependencies (installed versions), DLL entries, every registration with its resolved files and object counts, XSLT patches, unregistered files and language files.

list_typesA

Summarizes game data by XmlName id (Items, NPCCharacters, SPCultures, Factions, Kingdoms, Settlements, partyTemplates, …) with the object tags and counts per module. Use it to learn what exists before searching.

search_objectsA

Searches every module's XML objects (items, troops, heroes, clans, kingdoms, settlements, cultures, crafting pieces, party templates, strings, …) by id / name and attribute filters. Chinese queries also match the 简体中文 names. Returns 'Tag.id "Name" — module file:line | key attributes'.

get_objectA

Returns the XML of a game object, e.g. ref='Item.empire_sword_1_t2', 'NPCCharacter.imperial_recruit', 'Culture.empire' or a bare id. Shows which module's definition wins (load order), other definitions, XSLT patches that touch it and the absolute file path.

find_referencesA

Lists objects that reference a given object (e.g. which troops carry Item.x, which troops upgrade into NPCCharacter.y, which settlements belong to Faction.z). Accepts 'Prefix.id' or a bare id.

describe_schemaA

Explains which elements/attributes are valid, from the game's own XSD files (XmlSchemas folder) plus real values observed in official data. Use before writing XML. No args: list XmlName ids. xml_id only: root and object elements. element (+path for nested ones, e.g. element=Weapon path=Item/ItemComponent/Weapon): attributes with types/enums and children.

create_moduleA

Scaffolds a new module folder with SubModule.xml (dependencies on the installed official modules) and ModuleData/. Optional C# project (Source/.csproj + SubModule.cs that builds into bin/Win64_Shipping_Client). Default location: /Modules.

edit_submoduleA

Edits a writable module's SubModule.xml in place (formatting preserved): name/version/url/category, add or remove dependencies, register or unregister ModuleData XML files, add or remove DLL SubModule entries.

write_objectA

Writes one or more objects (e.g. , , , , , , , ) into a writable module. Replaces an object with the same tag+id in that module, otherwise appends it to the module's file for that data type (creating ModuleData/_.xml and registering it in SubModule.xml). Runs the game's XSD check afterwards.

clone_objectA

Copies an existing object (usually vanilla) into a writable module under a new id, optionally changing attributes — the fastest way to make a new weapon/troop/hero/culture based on an existing one. With new_id omitted the copy keeps the id and fully overrides the original. A plain 'name' gets a fresh {=id}.

set_attributesA

Changes attributes of an object that lives in a writable module, editing the file in place. Use path to reach nested elements (mini XPath): ItemComponent/Weapon, skills/skill[@id='OneHanded'], Equipments/EquipmentRoster[1]/equipment[@slot='Item0']. For objects owned by other modules use xslt_patch.

delete_objectA

Removes an object definition from a writable module's XML (all definitions of that id in the module).

xslt_patchA

Changes an object owned by vanilla or another mod without copying it, by adding a rule to your module's XSLT (ModuleData/XSLT/_.xslt, registered automatically — the same mechanism the official DLC uses). One call per target node; repeated calls merge. Operations: set attributes, remove attributes, remove the node, replace it, append child XML, or clear the rule. Shows a before/after diff computed with the game's XSLT engine.

xslt_previewA

Runs the game's merge + XSLT pipeline (System.Xml XslCompiledTransform, like the game) for a module and shows before/after diffs of every object its XSLT rules target (or only targets). Also reveals XSLT errors that would break loading.

validate_moduleA

Checks a module like the game would: SubModule.xml (ids, versions, dependencies, DLLs), every registered XML (exists, well-formed, game XSD), XSLT compiles, duplicate ids, unresolved references (Item.x, NPCCharacter.x …) against its dependencies, unregistered files, and localization (missing/conflicting {=ids}, translation coverage).

l10n_scanA

Scans a module's XML data, GUI prefabs and C# code (Source/ or code_dir) for {=id}Text strings. Reports texts without ids, empty ids, ids reused with different texts, ids colliding with other modules, and translation coverage per language. fix_missing_ids / fix_conflicts rewrite the module's XML with fresh unique ids.

l10n_statusA

Lists a module's strings for one language as JSON lines {"id","text"[,"tr"]}: untranslated (default), translated, all, or stale (translations whose id no longer exists). Strings already translated by the game/other modules (same id and text) are skipped. Translate them and send the result to l10n_set.

l10n_setA

Writes translations for one language into the module's ModuleData/Languages// files (creates language_data.xml and _strings.xml when missing; existing ids are updated in place). Warns when {PLACEHOLDERS} differ from the source text.

scene_listA

Lists scenes (SceneObj//scene.xscene) of all or selected modules with size, date and whether terrain/navmesh data exists.

scene_infoA

Overview of a scene file: header, environment/atmosphere settings, terrain, entity/prefab/script/tag statistics, spawn points, bounding box, where the game references it, and checks (unknown prefabs/meshes/physics shapes, XML errors). live=true reports the scene currently open in the Modding Kit editor instead (needs the editor bridge).

scene_entitiesA

Lists entities of a scene file with handles ([12], [12/0] for children), name, prefab, mesh, position, rotation (degrees), scale, tags and scripts; filters by name/prefab/tag/script/mesh or distance. entity=<handle|name> returns the entity's XML. live=true lists the scene open in the Modding Kit editor (#handles are session ids for scene_edit live=true).

scene_editA

Adds, updates, deletes or duplicates entities. File mode edits scene.xscene of a writable module (formatting preserved, undoable). live=true edits the scene open in the Modding Kit editor through the bridge (then save with Ctrl+S in the editor); live also supports select, focus and snap_to_ground. add: place a prefab (prefab=…) or a mesh (mesh=…, physics=bo_…) or raw <game_entity> XML, count+offset make rows. update: position/move_by, rotation/rotate_by (degrees unless rotation_unit=rad), scale, name (exact for every target unless number_names), add_tags/remove_tags, attributes, script+variables, levels (file mode). Live targets: #handles from scene_entities live (valid until the scene is reopened) or names (child entities included). Siege spawner names are protected: the editor derives their prefab from the name.

scene_createA

Creates SceneObj// in a writable module: a copy of an existing scene (template=…, any module; terrain/navmesh files are copied, name and unique token renewed) or a minimal empty scene like the editor's New Scene (envmap probe + ground plane, terrain off).

scene_settingsA

Reads or changes a scene's <environment_properties> (e.g. atmosphere_name, is_indoors, water_level, physics_world_min, gi_data_exists), its atmosphere.xml values (time_of_day, color_grade_name, season, fog_density, sun_altitude, …), its level definitions (base, siege, civilian… — entities join them with scene_edit levels) and the editor camera saved in <editor_data>. Without changes it lists the current values.

prefab_searchA

Searches prefab definitions (Modules//Prefabs/.xml — what the editor's prefab browser shows) by name, mesh, script or tag. name= returns the prefab's XML. Use the names with scene_edit action=add prefab=….

prefab_createA

Saves a prefab into /Prefabs/_prefabs.xml from a scene entity (from_scene + entity; its position is reset to the origin) or from <game_entity> XML. The editor loads module prefabs at startup (restart it to see new ones).

asset_importA

Copies FBX meshes and textures (png/tga/dds/tif/psd/bmp/jpg) into /AssetSources (the folder the Modding Kit editor imports from), checks them (FBX version, texture size, naming) and creates Assets/. Copying is not converting: new files become Assets/*.tpac only through the editor's Resource Browser → Import new asset; the result says what to do next, in which order (materials before FBX, with an editor restart in between) and whether the running editor has the module loaded. Folders are expanded (top level).

asset_statusA

Compares a module's AssetSources with the editor's imported packages (Assets/*.tpac): imported, pending (copied but never converted), stale (source changed after import) and orphaned packages, plus the meshes/materials/textures/physics shapes each package contains. Checks the packages like the editor will when loading them: sub-meshes without a material or with an unknown one, resource names corrupted with control characters, physics shapes without their mesh.

asset_searchA

Searches resource names inside every module's asset packages (vanilla AssetPackages and mod Assets): meshes, materials, textures, physics shapes, skeletons, animations, particle systems, shaders. Use the names in scenes (meta_mesh_component, physics shape), items (mesh=…) or materials.

editor_statusA

Shows whether the Modding Kit (scene editor) is installed, whether the MB2-MCP editor bridge module is installed and current, which Bannerlord processes run, message boxes that block the game (e.g. 'RGL WARNING', 'Safe Mode') and — if the bridge is connected — the editor state, open scene, entity and selection counts.

editor_bridge_installA

Compiles the MB2-MCP editor bridge (a small C# module) against your installed game with the Windows .NET compiler and installs it as Modules/MB2MCP.EditorBridge. Inside the Modding Kit editor it lets the live tools (scene_* live=true, editor_command) inspect and edit the open scene. Re-run after game updates.

editor_launchA

Starts the Modding Kit build (bin/Win64_Shipping_wEditor/Bannerlord.exe) with the official singleplayer modules, the given modules and the editor bridge, and (open_editor=true) enters the scene editor automatically (with an empty scene; open yours in the editor). Loading usually takes 1–5 minutes; poll editor_status until it reports 'edit mode ON'. While it loads, 'RGL WARNING' message boxes about other mods' SubModule.xml entries (common with Workshop mods made for launcher extensions) are answered automatically with OK, together with the two prompts that follow each of them (the crash watchdog's 'collect necessary files?' → No, nothing is collected or uploaded; 'Always Ignore?' → Cancel, no setting changes) and the shader-cache notices ('Mod change detected').

editor_commandA

Live actions in the running Modding Kit editor (needs the bridge): console (run a developer console command), list_commands (console commands by prefix; entries ending in '.' are groups such as 'scene.', 'resource.', 'prefab.' — list them with that prefix), check_scene (editor's scene problem check), reimport_assets (re-converts changed sources of earlier imports — new files need the Resource Browser's Import new asset), raycast (from/to or a position straight down → hit point), ground_height, warning (show a message in the editor), enter_editor (from the main menu), ping, quit (confirm=true; closes the game without saving). Also without the bridge: screenshot (captures the game window and returns the image; when the game is frozen or has no window yet, the message box blocking it), dialogs (the game's message boxes such as 'RGL WARNING', prompts Windows shows for it, the scene editor's modal Qt dialogs such as 'Do you want to save the scene?' with their texts, fields and buttons, and its other open windows), dismiss_dialogs (press OK, or button, on them; editor dialogs and file dialogs only with a named button) and fill_dialog (type into an editor dialog's input fields, set its check boxes and select a list/tree item — by label or #n — then read everything back; it never presses a button). With the bridge also: perf (frame times over seconds: average, percentiles, fps, plus the engine's main/renderer fps). cleanup deletes the screenshots, walk traces and dialog/bridge logs this server left in the bridge folder.

editor_playA

Play mode of the Modding Kit editor (needs the bridge). start plays the open scene with the editor's test mission — the same managed entry the editor's Play button reaches; the player spawns at spawnpoint_player_test or spawnpoint_player — and waits until the player is there. It loads the scene's SAVED file: save first (start refuses when changes made through this server are newer than the file). stop returns to the editor exactly like the leave key does in play mode, and waits for it. status / missions report. While playing, live scene_* commands are refused (they act on the edited scene); use mission, navmesh_query and editor_command screenshot.

missionA

In play mode (editor_play) or another running mission (needs the bridge): status (player position, direction, mission state); objects (usable objects near the player — doors, chairs, passages, ladders… — and whether the player can use them); dismount (the editor's test mission spawns a horseman); walk (the player walks a route with the game's own AI movement on the navigation mesh, never teleported, and each leg reports reached / stuck / timed out with the closest approach; the position trace is saved as JSON — evidence that a route can be walked, or where it is blocked); walk_status / walk_stop; teleport (positioning before a test, reported as such — not evidence of a walkable route); use (use an object within reach, the same callback as the interaction key); stop_using.

navmesh_queryA

Read-only queries with the engine's own path finding (the one AI agents use) on the navigation mesh of the scene open in the editor, or of the running mission (needs the bridge): summary (face count, face ids with their face counts, CRC), at (the face under a position: index, id, island, center, open edges), path (whether two positions are connected, path length against the straight distance, corner points), line (whether a straight move from a position stays on the mesh), group (faces with one id: count and extent). Use mission action=walk to prove a route with a real agent.

editor_cameraA

The live viewport camera (needs the bridge): get (position, view direction, pitch and heading of the last rendered frame — also in play mode), set (move the editor camera to a position, keeping its direction), move (by a delta). The engine offers no call to turn the live editor camera: scene_edit action=focus zooms toward an entity keeping the direction, and scene_settings editor_camera sets the saved camera used when the scene is opened.

read_logsA

Reads Bannerlord's logs to debug a mod: rgl_log_*.txt (main log), rgl_log_errors_*.txt, launcher and crash files under ProgramData and Documents. action=list shows recent files; action=read (default) shows the tail of the latest log or matches of grep / errors_only.

edit_historyB

Lists recent changes made through this MCP server (every write is journaled with a backup), newest first.

forget_historyA

Deletes this server's edit journal and the file backups it keeps for undo_edit (in MB2_DATA_DIR, default %LOCALAPPDATA%\mb2-mcp\history): all of it, or only edits older than older_than_days. Forgotten edits can no longer be undone. Needs confirm=true. (Screenshots and traces in the bridge folder: editor_command action=cleanup.)

undo_editA

Reverts one change made through this server (default: the most recent not yet undone, optionally of one module), restoring backed-up files and deleting files it created. Refuses if the files changed afterwards unless force=true.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.8/5.0

Scored across 43 tools

Disambiguation4/5

Tools generally target distinct resources and actions (modules, XML objects, scenes, assets, editor, history), and the descriptions clarify boundaries. However, with 43 tools there is some potential overlap between editor_command, editor_play, mission, and navmesh_query, and between scene_info, scene_entities, and scene_settings, which could cause occasional misselection.

Naming Consistency4/5

All names use snake_case, with domain prefixes (scene_, prefab_, asset_, editor_, l10n_) for related groups. The pattern is not strictly verb_noun throughout (e.g., module_info vs list_modules), but it is consistent and readable.

Tool Count2/5

43 tools is well above the 25-tool threshold for 'too many', even for a complex domain. While many tools earn their place, the set is heavy and could be consolidated.

Completeness5/5

The surface covers the full modding lifecycle: discovery, module/XML editing, XSLT patching, localization, scene/prefab editing, asset import, editor integration, play-testing, and history/undo. No obvious critical gaps for the stated purpose.

Maintenance

ActivityMaintained
ResponsivenessNo issues