sts2-modding-mcp/
├── run.py # Entry point
├── pyproject.toml # Package metadata
├── requirements.txt # Dependencies
├── sts2mcp/
│ ├── __init__.py
│ ├── server.py # MCP server with all 151 tool definitions
│ ├── game_data.py # Game data indexing and querying
│ ├── mod_gen.py # Code generation templates plus project-aware workflow helpers
│ ├── pck_builder.py # Pure Python Godot PCK builder
│ ├── gdre_tools.py # GDRE Tools integration for PCK extraction, GDScript decompilation, resource conversion
│ ├── analysis.py # Code intelligence — patch suggestions, caller analysis, compatibility checks
│ ├── bridge_client.py # TCP JSON-RPC client to in-game MCPTest mod
│ └── project_workflow.py # Project inspection, apply/merge, PCK build, deploy, and validation helpers
├── tools/
│ ├── roslyn_analyzer/ # C# Roslyn-based source analyzer (auto-built on first run)
│ └── gdre_tools.exe # GDRE Tools binary (gitignored, download from GitHub releases)
├── decompiled/ # Decompiled C# source + roslyn_index.json (gitignored, ~23MB + ~17MB index)
└── recovered/ # Recovered Godot project (gitignored, generated by recover_game_project)
When you use create_mod_project, it creates:
MyMod/
├── MyMod.csproj # .NET 9.0 + BaseLib + Harmony
├── mod_manifest.json # Mod metadata
├── Code/
│ ├── ModEntry.cs # [ModInitializer] entry point
│ ├── Cards/ # Custom cards
│ ├── Relics/ # Custom relics
│ ├── Powers/ # Custom powers
│ ├── Potions/ # Custom potions
│ ├── Monsters/ # Custom monsters
│ ├── Encounters/ # Custom encounters
│ ├── Events/ # Event scaffolds
│ ├── Orbs/ # Orb scaffolds
│ ├── Enchantments/ # Enchantment scaffolds
│ ├── Actions/ # GameAction scaffolds
│ ├── Networking/ # Multiplayer net messages
│ ├── UI/ # Custom Godot UI panels
│ ├── Overlays/ # Combat/map overlays
│ ├── Utils/ # Reflection accessors
│ ├── Keywords/ # Custom card keywords
│ ├── Piles/ # Custom pile types
│ ├── Fields/ # SpireField data attachments
│ ├── Vars/ # Custom DynamicVar classes
│ ├── Characters/ # Custom characters (BaseLib)
│ ├── Config/ # Mod config (BaseLib)
│ ├── Ancients/ # Ancient scaffolds (BaseLib)
│ └── Patches/ # Harmony patches
└── MyMod/
├── localization/eng/ # Localization JSON files
├── images/ # Entity images
└── MonsterResources/ # Monster scenes and sprites
create_mod_project seeds empty localization files for cards, relics, powers, potions, monsters, encounters, events, orbs, and enchantments, plus characters.json and ancients.json when BaseLib scaffolds are enabled.
All code generation defaults to using BaseLib (Alchyr.Sts2.BaseLib), which provides:
- Abstract base classes —
CustomCardModel,CustomRelicModel,CustomPowerModel,CustomPotionModel,CustomCharacterModel - Auto-registration — ICustomModel types get prefixed IDs and pool registration automatically
- Config system —
SimpleModConfigwith auto-generated in-game UI - Card variables — ExhaustiveVar, PersistVar, RefundVar
- CommonActions — Helper methods for damage, block, draw, apply powers
- Utilities — SpireField, WeightedList, IL patching tools
Set use_baselib: false on any generation tool to get raw game API code instead.