BannerlordSage
AGENTS.md17 starsChanged 8 months agoMITView on GitHub
This repository is a Windows-first MCP server for Mount & Blade II: Bannerlord. Use this file when an AI coding agent is asked to inspect, install, configure, verify, or run this repo. Help the user get BannerlordSage installed and running against a local Bannerlord installation. When you first open this repo, read these files before making assumptions: If the user wants a normal install, use this order: If the user needs the authoring helpers too: Recommended MCP entry: If the…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
24 rules. About 0 are common, 14 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 5
Use this file when an AI coding agent is asked to inspect, install, configure, verify, or run this repo.
- Distinctive: line 24
Never invent a game path; ask for it or discover it from local context
- Very specific: line 25
Do not commit dist/, extracted game assets, SQLite databases, or local secrets
- Distinctive: line 29
When you first open this repo, read these files before making assumptions:
- Distinctive: line 40
If the user wants a normal install, use this order:
- Distinctive: line 52
Start the MCP server:
- Distinctive: line 55
If the user needs the authoring helpers too:
- Distinctive: line 71
If the user wants the full toolset:
- Distinctive: line 83
Use one of these:
- Very specific: line 89
If the workspace contains src/, the repo automatically uses that as the effective source root.
- Distinctive: line 116
Use these tools deliberately:
- Distinctive: line 125
Default operating rules for AI agents:
- Very specific: line 128
Before answering questions about past decisions, prior fixes, user preferences, rejected approaches, or ongoing task state, call …
- Very specific: line 130
Use project_memory_add for one important entry.
- Very specific: line 132
After a task completes, store one short session memory only if the session produced reusable knowledge that would matter in a future thread.
- Very specific: line 133
When a previous conclusion is no longer true, call project_memory_invalidate on the old memory instead of silently adding a conflicting …
- Very specific: line 153
Keep the summary to one line.
- Very specific: line 154
Keep text concrete and self-contained.
- Distinctive: line 155
Prefer one memory per conclusion.
- Very specific: line 156
Use workspace, topic, and kind consistently.
- Very specific: line 157
Add source when a file, issue, or session label would help future lookup.
- Distinctive: line 161
Prefer using the repo's real scripts instead of inventing new setup steps
- Distinctive: line 162
Prefer placeholder paths in docs and examples
- Distinctive: line 165
If asked to improve the docs, keep the README focused on:
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
BannerlordSage Agent Guide
This repository is a Windows-first MCP server for Mount & Blade II: Bannerlord.
Use this file when an AI coding agent is asked to inspect, install, configure, verify, or run this repo.
Primary Goal
Help the user get BannerlordSage installed and running against a local Bannerlord installation.
What This Repo Does
- imports Bannerlord XML from a local game install
- decompiles official Bannerlord DLLs
- builds SQLite indexes
- exposes MCP tools for Bannerlord querying, modding, and reverse engineering
- can also index and read the user's own local mod source workspace
Important Constraints
- This repo does not include Bannerlord assets
- The user must have a legitimate local Bannerlord installation
- Commands that use
--game-dirrequire the user's real local path - Never invent a game path; ask for it or discover it from local context
- Do not commit
dist/, extracted game assets, SQLite databases, or local secrets
First Files To Read
When you first open this repo, read these files before making assumptions:
README.mdpackage.jsonsrc/server.tssrc/entrypoints/bannerlord-stdio.tssrc/entrypoints/bannerlord-full-stdio.tssrc/entrypoints/bannerlord-setup.ts
Standard Human Install Flow
If the user wants a normal install, use this order:
- Install prerequisites:
- Bun
- ripgrep
- .NET SDK 8+
- ILSpyCmd
- Install repo dependencies:
bun install
- Run Bannerlord setup:
bun run setup:bannerlord -- --game-dir "<BANNERLORD_GAME_DIR>"- setup indexes local decompiled source/XML plus public official/community docs and official API search data by default; use
--skip-docsonly for offline setup
- Start the MCP server:
bun run start:bannerlord
If the user needs the authoring helpers too:
bun run start:bannerlord:full
MCP Client Config
Recommended MCP entry:
[mcp_servers.bannerlordsage]
command = "bun"
args = ["run", "src/entrypoints/bannerlord-stdio.ts"]
cwd = "<REPO_DIR>"
enabled = trueIf the user wants the full toolset:
[mcp_servers.bannerlordsage]
command = "bun"
args = ["run", "src/entrypoints/bannerlord-full-stdio.ts"]
cwd = "<REPO_DIR>"
enabled = trueIf The User Wants Their Own Mod Source Indexed
Use one of these:
- pass
workspaceRootdirectly to the mod-source tools - set
BANNERSAGE_MOD_SOURCE_DIR - set
BANNERSAGE_BANNERLORD_MOD_SOURCE_DIR
If the workspace contains src/, the repo automatically uses that as the effective source root.
Important Commands
bun run setup:bannerlordbun run start:bannerlordbun run start:bannerlord:fullbun run index:gameplaybun run index:docsbun run index:api-docsbun run index:mod-source -- --source-dir "<MOD_SOURCE_DIR>"bun run verify:bannerlord -- --game-dir "<BANNERLORD_GAME_DIR>"bun run smoke:releasebun run report:scopes -- --game-dir "<BANNERLORD_GAME_DIR>"
Validation
Minimum pre-release check:
bun run smoke:release
Stronger local validation:
bun run verify:bannerlord -- --game-dir "<BANNERLORD_GAME_DIR>"
Project Memory Workflow
Use these tools deliberately:
project_memory_wakeupproject_memory_searchproject_memory_addproject_memory_capture_sessionproject_memory_recentproject_memory_invalidate
Default operating rules for AI agents:
- At the start of a new task or resumed thread, call
project_memory_wakeupfor the active workspace before making assumptions. - Before answering questions about past decisions, prior fixes, user preferences, rejected approaches, or ongoing task state, call
project_memory_searchfirst. - Store
decision,pitfall, andpreferencememories only when they are likely to matter again. - Use
project_memory_addfor one important entry. - Near the end of a meaningful task, prefer
project_memory_capture_sessionover a burst of manual single-entry writes. - After a task completes, store one short
sessionmemory only if the session produced reusable knowledge that would matter in a future thread. - When a previous conclusion is no longer true, call
project_memory_invalidateon the old memory instead of silently adding a conflicting replacement.
What to store:
- decisions with rationale
- pitfalls with symptom and fix
- user preferences that are likely to recur
- durable TODOs or follow-up constraints
- release or validation findings that future sessions need
What not to store:
- temporary shell output
- large code dumps
- facts already covered by the indexed game data or source tools
- obvious one-off steps with no reuse value
- speculative ideas that were not acted on
Quality bar for each memory:
- Keep the
summaryto one line. - Keep
textconcrete and self-contained. - Prefer one memory per conclusion.
- Use
workspace,topic, andkindconsistently. - Add
sourcewhen a file, issue, or session label would help future lookup.
If You Are An AI Agent
- Prefer using the repo's real scripts instead of inventing new setup steps
- Prefer placeholder paths in docs and examples
- Explain clearly that
workspaceRoot?means an optional local workspace path - Explain clearly that
--game-dirpoints to the user's local Bannerlord install - If asked to improve the docs, keep the README focused on:
- tool list
- install/configure steps
- MCP client setup
- mod-source setup
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

