BannerlordSage
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
BannerlordSage
An MCP server for Mount & Blade II: Bannerlord that provides source code search and data browsing.
Editor MCP is an experimental test version — PRs welcome! Local editor authoring is currently validated against an aligned Bannerlord game and Modding Kit v1.4.8. Prefab layout, scene saving and viewport capture have been tested; terrain editing, playable Missions, navigation and sailing are not yet validated. Submit a PR or report an issue.
It reads your local Bannerlord installation, imports XML, decompiles official DLLs, builds a SQLite index, and exposes MCP tools for AI coding agents. Use cases:
Mod development
Reverse engineering
Structured gameplay lookups
Reading local mod source code
AI-Assisted Install
To have a coding agent (Codex, Claude, Gemini, Copilot, etc.) install and configure this for you:
Send the repository URL to the AI
Tell it to read
AGENTS.mdfirstTell it to follow
AI_QUICKSTART.mdProvide your
<BANNERLORD_GAME_DIR>when asked
Related MCP server: GitHits
Attribution
BannerlordSage includes work derived from RimSage by Vortex.
The project remains under the MIT License. See LICENSE.
Tool Overview
BannerlordSage provides 43 tools across two entrypoints:
Entrypoint | Tools | Notes |
| 36 | Query, analysis, mod-source work, project memory and experimental editor status |
| 43 | Adds workspace creation, XSLT patch generation and experimental editor authoring |
Basic workflow: run setup → start MCP → let the model call tools
Tool List
Diagnostics
Tool | Description |
| Check module health: missing dependencies, duplicate DLLs, load order issues |
| Check whether BannerlordSage is initialized and the local index is ready |
Local Editor — Experimental
Tool | Description |
| Check local bridge configuration, installed version alignment and the active scene |
| Read managed object IDs, prefabs, GUIDs and complete transforms |
| Check a prefab and optional mesh bounds in the running editor |
| Create or update up to 64 managed prefab roots with stable IDs |
| Save the active dedicated scene through the native editor |
| Return the current native viewport as a PNG image through MCP |
Status is available in both entrypoints; the other five tools require full mode.
Install the local C# bridge and open its dedicated scene first, then pass an
optional absolute local sessionPath or set BANNERSAGE_EDITOR_PROBE_SESSION in
the MCP service environment. The session JSON contains a local credential and
must stay out of Git. Public tools do not launch, replace, reload or close scenes.
See setup, CLI, blueprints and tested limits.
Project Memory
Tool | Description |
| Store one project memory entry |
| Store a session summary plus decisions, pitfalls, preferences, TODOs, and notes in one call |
| Search project memory before answering questions about past work |
| Show recent project memory entries |
| Load key active memory at session start |
| Mark an old memory as inactive |
Official Source & XML
Tool | Description |
| Full-text search across decompiled official source — use this when you don't know which file to look in |
| Read the decompiled definition of a C# type by name |
| Read a specific line range from a known file path |
| Browse the imported official asset directory |
| Search official XML files for an ID, field, token, or concept |
| Resolve in-game localization tokens like |
| Inspect Gauntlet UI file bindings and interaction logic |
Official/Community Docs & API
Tool | Description |
| Natural-language unified entrypoint; use first when the user says they want to make a mod, feature, patch, UI, XML edit, or calls MCP without naming a specific tool |
| Search official tutorials and BannerlordModding.LT community docs for workflows, editor usage, assets, Gauntlet UI, module structure, and practices |
| Search official API Doxygen symbols; when the API version does not match the installed game, treat it as historical reference and prefer local decompiled source |
Structured Gameplay Lookups
Tool | Description |
| Query the full upgrade path for a troop type |
| Query detailed stats for a weapon, equipment, or smithing piece |
| Query a hero's skills, traits, and background |
| Query a clan or faction's members, strength, and relations |
| Query a kingdom's territories, policies, and current state |
| Query a culture's unique units, bonuses, and style |
| Query a town, village, or castle |
| Query a skill's attributes, bonuses, and related perks |
| Query a policy's description, support info, and cross-references |
| Query a perk's skill tree, paired perk, character bonuses, and description |
Local Mod Source
These tools read your own local mod source code, not the official imported source.
Tool | Description |
| Check whether a mod source workspace is configured and indexed |
| Index a local mod source directory for search and type lookup |
| Search across your local mod source code |
| Read a specific source file from your local mod |
| Browse your local mod's directory structure |
| Read a C# type definition from your local mod by name |
Patch & Code Generation
Tool | Description |
| Generate a Harmony patch code scaffold with method signature hints — parameter types need manual completion |
| Generate a new mod project structure (SubModule.xml, .csproj, C# entry point) — ready to |
| Generate an XSLT patch template for modifying official XML — does not validate XPath or fragment syntax, treat as a starting template |
⁺ Only available in
start:bannerlord:full.
Common Workflows
Browse official source:
search_source— locate the fileread_file— read the relevant sectionread_csharp_type— inspect the type definition
Browse XML or localization:
search_xml— locate the fileread_file— read the contentresolve_localization— resolve tokens
Known game ID, direct lookup:
Use the structured query tools directly:
get_item_stats,trace_troop_tree,get_hero_profile, etc.
Read local mod source:
mod_source_status— confirm the workspacesearch_mod_source— search the coderead_mod_file/read_mod_type— read the details
Resume work with project memory:
project_memory_wakeup— load the key active context for the workspaceproject_memory_search— check whether a similar decision, pitfall, or preference already existsproject_memory_capture_session— store the useful session output near the end of the task
Daily MCP Usage
Once BannerlordSage is installed and connected to your AI client, the normal daily loop is:
Start or resume a task and call
project_memory_wakeupExplore official behavior with
search_source,read_file, andread_csharp_typeExplore your own mod with
mod_source_status,search_mod_source,read_mod_file, andread_mod_typeUse the structured query tools when you already know an in-game id
Before stating project history, call
project_memory_searchNear the end of the task, call
project_memory_capture_session
Project Memory Workflow
Project memory is a local recall layer. It does not change the model's context window. It gives the agent a place to store decisions, pitfalls, preferences, and follow-up state.
Use it like this:
start a resumed task with
project_memory_wakeupsearch memory before claiming project history
store only durable conclusions
prefer
project_memory_capture_sessionnear task completioninvalidate old memories when they are no longer true
Installation
1. Prerequisites
Windows
A legitimately owned local Bannerlord installation
One-liner to install all dependencies:
powershell -c "irm bun.sh/install.ps1 | iex"
winget install BurntSushi.ripgrep.MSVC
winget install Microsoft.DotNet.SDK.8
dotnet tool install --global ilspycmd2. Install packages
bun install3. Run setup
bun run setup:bannerlord -- --game-dir "<BANNERLORD_GAME_DIR>"Replace <BANNERLORD_GAME_DIR> with the absolute path to your local Bannerlord installation. The first run takes a while; subsequent runs are incremental.
Setup also indexes public official/community documentation and official API search data by default. The docs/API data is stored in the local SQLite database, reused on later runs, and only refreshed when missing or when --reindex-docs is passed. Use --skip-docs for offline or local-only setup.
Common flags:
Flag | Description |
| Decompile core TaleWorlds DLLs only (fastest) |
| Core + modding support libs (Newtonsoft.Json, etc.) |
| All official module DLLs |
| Official + third-party module DLLs (most complete, slowest) |
| Import official module XML only |
| Official + all locally installed third-party module XML |
| Skip the interactive disclaimer prompt |
| Wipe local assets and rebuild indexes from scratch, including docs/API unless |
| Do not download/index official docs or API docs during setup |
| Force refresh official/community docs and all official API versions |
4. Start MCP
# Default (recommended)
bun run start:bannerlord
# Full toolset
bun run start:bannerlord:fullMCP Client Configuration
[mcp_servers.bannerlordsage]
command = "bun"
args = ["run", "src/entrypoints/bannerlord-stdio.ts"]
cwd = "<REPO_DIR>"
enabled = trueFull toolset:
[mcp_servers.bannerlordsage]
command = "bun"
args = ["run", "src/entrypoints/bannerlord-full-stdio.ts"]
cwd = "<REPO_DIR>"
enabled = trueReplace <REPO_DIR> with the absolute path to this repository on your machine.
Environment Variables
Variable | Description |
| Active game profile — currently always |
| Default Bannerlord installation path |
| Generic default game path |
| Override the |
| Skip the interactive disclaimer prompt |
Scripts
bun run setup:bannerlord -- --game-dir "<BANNERLORD_GAME_DIR>" # initialize/update local and public docs indexes
bun run start:bannerlord # start default MCP
bun run start:bannerlord:full # start full MCP
bun run verify:memory # verify native project-memory tools
bun run index:gameplay # rebuild gameplay index only
bun run index:docs # manually refresh official and community docs
bun run index:api-docs # manually refresh official API symbol versions
bun run index:mod-source -- --source-dir "<MOD_SOURCE_DIR>" # index local mod source
bun run verify:bannerlord -- --game-dir "<BANNERLORD_GAME_DIR>" # local regression check
bun run smoke:release # quick build validation
bun run report:scopes -- --game-dir "<BANNERLORD_GAME_DIR>" # output scope reportProject Structure
Path | Description |
| MCP and setup entrypoints |
| Setup, indexing, verification, and release scripts |
| MCP tool implementations |
| Shared runtime and indexing logic |
| Roslyn-based C# indexer |
| Locally generated runtime data (not committed) |
| Installation instructions for AI coding agents |
| Copy-paste install prompt template for users |
Disclaimer
This project is for personal learning, research, and mod development with a legitimately owned copy of the game.
The repository does not include or redistribute Bannerlord game assets.
Users are responsible for complying with the game EULA and applicable local law.
Decompiled and indexed content remains local by default.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Search and inspect source-pinned agent skills, plugins and tools through a free public MCP.
An MCP server that gives your AI access to the source code and docs of all public github repos
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to search code by meaning, explore codebase structure, store and query knowledge with temporal facts, and read source code through a set of MCP tools.7MIT

GitHitsofficial
AlicenseNot gradedqualityAmaintenanceEnables AI coding agents to search and access open-source code, documentation, and package information via a local MCP server.1,894 npm140Apache 2.0- AlicenseNot gradedqualityCmaintenanceExposes 10 tools that let AI agents search Nexus Mods, inspect locally installed game modules, populate and fix translation flags, generate and translate templates with Microsoft/Google/DeepLX engines, and build external translation modules. Two of the tools write to disk, rewriting ModuleData XML files and creating sibling translation directories under the game's Modules folder.103 npm2MIT
- AlicenseAqualityBmaintenanceEnables AI agents to connect local knowledge bases, preview and index selected directories, search for traceable snippets with source metadata, and read indexed document versions through MCP tools.6MIT