Model Context Protocol dla Gothic 1 i Gothic 2 (ZenGin + Union) Model Context Protocol for Gothic 1 & Gothic 2 (ZenGin + Union)

Twórz i debuguj wtyczki Gothic 1 & 2
z pomocą AI

Build & Debug Gothic 1 & 2
Plugins with AI

Połącz Claude Code, Cursor lub VS Code bezpośrednio z nagłówkami GothicAPI dla 4 silników, linterem C++ i Daedalus (.d), budowaniem .vdf oraz mostem McpGothic.dll do uruchomionej gry.

Connect Claude Code, Cursor, or VS Code directly to 4-engine GothicAPI headers, C++ & Daedalus (.d) linters, VDFS (.vdf) packaging, and the live McpGothic.dll in-game bridge.

$ git clone https://github.com/pen996k/mcpgothic.git && cd mcpgothic
$ python run_server.py install --client claude-code
$ git clone https://github.com/pen996k/mcpgothic.git && cd mcpgothic
$ python run_server.py install --client cursor
$ git clone https://github.com/pen996k/mcpgothic.git && cd mcpgothic
$ python run_server.py install --client antigravity
$ git clone https://github.com/pen996k/mcpgothic.git && cd mcpgothic
$ python run_server.py install --client claude-desktop
{
  "mcpServers": {
    "mcpgothic": {
      "command": "python",
      "args": ["-B", "/path/to/mcpgothic/run_server.py"]
    }
  }
}
Działa z: Works with: Claude Code Cursor Antigravity Claude Desktop VS Code Windsurf • G1 G1A G2 G2A • Python 3.8+ (0 deps)
Zobacz w akcji See It In Action

Jak AI rozmawia z silnikiem Gothica How AI Talks to the Gothic Engine

Kliknij scenariusz po lewej stronie, aby zobaczyć jak asystent wywołuje narzędzia mcpgothic. Select a scenario on the left to see how your AI assistant uses mcpgothic tools.

„Stwórz nową wtyczkę Union o nazwie Compass z menu w grze i jednym plikiem DLL obsługującym Gothic 1 oraz Gothic 2 NotR.” "Create a new Union plugin called Compass with an in-game options menu and a single-DLL launcher for Gothic 1 and Gothic 2 NotR."
⚡ Tool Call: gothic_template OK
gothic_template(name="Compass", folder="...", launcher=true)
-> Created Compass\Compass.vcxproj (G1, G1A, G2, G2A | Win32 | v143 | static CRT)
-> Created Compass\Plugin\plugin.cpp (Game_*, Detach, TScreenState, LoadConfig)
-> Created Compass\Scripts\Compass_Union.d & Compass_Menu.d (Parser = Menu)
-> Created Compass\launcher\launcher.cpp (single DLL for G1 + G2A)
AI: Projekt Compass jest gotowy do kompilacji dla wszystkich 4 silników, z wpisem w menu Union & Plugins i automatycznym odczytem opcji z Gothic.ini. AI: The Compass project is ready to build across all 4 engines, complete with a Union & Plugins menu entry and live Gothic.ini option reloading.
„Znajdź adresy oCNpc::OnDamage_Hit i sprawdź czy методa oCNpc::IsDead istnieje w każdym silniku.” "Find the addresses of oCNpc::OnDamage_Hit and check if oCNpc::IsDead exists in all 4 engines."
⚡ Tool Call: gothic_api_search 4 engines
oCNpc::OnDamage_Hit(oSDamageDescriptor&)
  G1  0x00731410 | G1A 0x007700A0 | G2  0x0077D390 | G2A 0x00666610

oCNpc::IsDead()
  G1  0x00693D30 | G1A 0x006C5450 | G2  MISSING!   | G2A 0x00736740
AI: Uwaga: oCNpc::IsDead() nie istnieje w Gothic 2 Classic (G2). Aby wtyczka kompilowała się na wszystkich 4 silnikach, sprawdzaj npc->attribute[NPC_ATR_HITPOINTS] <= 0. AI: Note that oCNpc::IsDead() is MISSING in Gothic 2 Classic (G2). To keep the plugin compatible with all 4 engines, check npc->attribute[NPC_ATR_HITPOINTS] <= 0 instead.
„Sprawdź mój kod C++ i skrypty .d przed zapakowaniem do .vdf.” "Check my C++ code and .d scripts for bugs before packing the .vdf archive."
⚡ Tool Call: gothic_lint & gothic_lint_d 3 findings
ERROR ZG001 plugin.cpp:42  delete on zCObject (use Release() instead of delete)
ERROR ZG005 plugin.cpp:19  static oCNpc* g_target not cleared in Game_LoadBegin_*
ERROR DZ016 Logic.d:28     two script calls in one expression: Cost(b) - Cost(a)
                           overwrites the shared return variable
AI: Wykryto 3 krytyczne błędy: wywołanie delete na obiekcie zCObject, niewyczyszczony wskaźnik g_target przy wczytywaniu zapisu oraz nadpisanie zmiennej zwracanej w wyrażeniu Daedalusa. Już je poprawiam. AI: Found 3 critical issues: calling delete on a refcounted zCObject, not clearing g_target on save load, and two script calls in one Daedalus expression overwriting the return reference. Fixing them now.
„Uruchomiłem grę. Zrób zrzut ekranu i sprawdź pozycję gracza oraz pobliskich NPC.” "I started the game. Take a screenshot and check the player position and nearby NPCs."
⚡ Tool Call: gothic_game_state + gothic_screenshot 127.0.0.1:47920
world=NEWWORLD.ZEN  time=day 1 12:14
player=PC_HERO  pos=(1240, 350, -890)  hp=40/40  mana=10/10  level=1
npc[0]: Diego (PC_THIEF) dist=412cm hp=200/200
screenshot: captured 1280x720 PNG (returned as MCP image to AI)
AI: Widzę zrzut ekranu z gry — okno kompasu rysuje się w prawym górnym rogu, a kolor czcionki screen->fontColor wokół imienia Diego jest prawidłowo przywracany. AI: I can see the live game screenshot — the compass bar renders cleanly in the top-right corner, and screen->fontColor above Diego's name is properly restored.
„Gra wyłączyła się z błędem — sprawdź zrzut pamięci .dmp i logi w folderze gry.” "The game just crashed — inspect the .dmp crash minidump and logs in my game folder."
⚡ Tool Call: gothic_diagnose minidump + DAT
CRASH: EXCEPTION_ACCESS_VIOLATION (0xC0000005) at Gothic2.exe+0x3A07CD (0x007A07CD)
  -> zCParser::GetParameter(int&) + 0x1D
  reading address 0x00000008 (null pointer + offset)
CAUSE: External 'MP_IsNear' popped 3 parameters, but .d script pushed 2.
AI: Minidump wskazuje na zCParser::GetParameter (0x007A07CD). Funkcja external MP_IsNear w C++ pobiera ze stosu 3 parametry, a deklaracja w skrypcie .d przekazuje tylko 2. AI: The crash dump points to zCParser::GetParameter (0x007A07CD). Your C++ external MP_IsNear pops 3 parameters from the parser stack, while the .d declaration only pushes 2.
Architektura Architecture

Jak to jest połączone How It Works

1. AI Client
Claude / Cursor / VS Code
Piszesz po polsku lub angielsku co chcesz stworzyć lub naprawić we wtyczce. Prompt in natural language to create, lint, build, or debug your plugin.
⇄ stdio
JSON-RPC
2. MCP Server
mcpgothic (Python 3.8+)
25 narzędzi: indeks GothicAPI (4 silniki), lintery ZG/DZ, kompilacja MSBuild, pakowanie VDFS i czytnik GOTHIC.DAT. 25 tools: 4-engine GothicAPI index, ZG/DZ linters, MSBuild runner, VDFS packer, and GOTHIC.DAT reader.
⇄ localhost
127.0.0.1:47920
3. In-Game Plugin
Gothic 1/2 + McpGothic.dll
Wtyczka Union (tylko do odczytu) zwraca stan świata, NPC, zmienne skryptowe i zrzuty ekranu z gry. Read-only Union bridge returning live world state, NPCs, script variables, and in-game screenshots.
Konfiguracja Quick Setup

Gotowe do pracy w 3 krokach Up and Running in 3 Steps

1

Pobierz mcpgothic

Get mcpgothic

Sklonuj repozytorium lub pobierz gotową paczkę ZIP z zakładki Releases. Wymagany jest wyłącznie Python 3.8+.

Clone the repository or download the release ZIP. Only standard Python 3.8+ is required (zero pip packages).

git clone https://github.com/pen996k/mcpgothic.git
2

Podłącz do swojego AI

Register in Your AI App

Uruchom instalator dla swojego klienta AI i zrestartuj aplikację (Claude Code, Cursor, Claude Desktop).

Run the one-line installer for your AI client and restart your editor (Claude Code, Cursor, Claude Desktop).

python run_server.py install --client cursor
3

Opcjonalnie: wrzuć most do gry

Optional: Install Game Bridge

Jeśli chcesz, aby AI robiło zrzuty ekranu i czytało stan włączonego Gothica, zainstaluj most do Data\Plugins.

To let the AI capture screenshots and inspect a running Gothic session, install the bridge into Data\Plugins.

gothic_bridge action=install game="..."
Możliwości Capabilities

Wszystko, czego potrzebuje twórca wtyczek Union Everything Needed for Union Plugin Development

G1 • G1A • G2 • G2A

Indeks GothicAPI dla 4 silników

4-Engine GothicAPI Index

Dokładne adresy metod, pola klas z offsetami, zmienne globalne i stałe klawiszy. Automatycznie ostrzega o różnicach rozmiarów klas między G1 i G2.

Exact method addresses, class field offsets, globals, and key constants. Automatically flags class size and layout differences between G1 and G2.

ZG001–ZG027 & DZ001–DZ023

50 reguł lintera C++ i Daedalus

50 C++ & Daedalus Linter Rules

Wyłapuje błędy pamięci zCObject, brak Release(), nieprzywrócony kolor czcionki screen, błędne kodowanie cp1250 oraz nadpisywanie referencji w wyrażeniach .d.

Catches zCObject memory bugs, uncleaned world pointers, shared screen state corruption, UTF-8 vs cp1250 encoding, and Daedalus stack reference overwrites.

VDFS 2.00 + Release Audit

Pakowanie .vdf i kontrola wydania

VDFS Packaging & Release Check

Pakuje DLL i skrypty .d do SYSTEM\AUTORUN\, sprawdza kompilację pod właściwy silnik oraz skanuje binaria pod kątem prywatnych ścieżek PDB przed publikacją.

Packs DLLs and .d scripts into SYSTEM\AUTORUN\, verifies target engine addresses, and scans binaries for local PDB paths before release.

GOTHIC.DAT Bytecode

Podgląd skompilowanego GOTHIC.DAT

Compiled GOTHIC.DAT Inspector

Przeszukuje NPC, przedmioty, dialogi i funkcje bezpośrednio w skompilowanym pliku GOTHIC.DAT (także wewnątrz paczek .mod i .vdf) bez źródeł skryptów.

Searches NPCs, items, dialogs, and functions directly inside compiled GOTHIC.DAT files (including inside .mod / .vdf archives) without source scripts.

Conflict Detector

Wykrywanie kolizji między wtyczkami

Cross-Plugin Conflict Detection

Porównuje wtyczki pod kątem tych samych klawiszy, hooków (w tym funkcji podmienianych przez renderer DX11 GD3D11), sekcji Gothic.ini i prefiksów skryptowych.

Checks plugins for overlapping hotkeys, hooks (including DX11 GD3D11 hooks), Gothic.ini sections, and Daedalus symbol prefixes.

Single-DLL Launcher

Jeden plik DLL dla Gothic 1 i Gothic 2

Single-DLL G1 + G2A Launcher

Opcja launcher=true w generatorze projektu tworzy lekki plik DLL zawierający zasoby G1 oraz G2A i automatycznie ładujący odpowiednią wersję przy starcie gry.

Passing launcher=true to the project generator creates a single DLL carrying both G1 and G2A builds and loading the matching one at runtime.

Dokumentacja techniczna Technical Reference

Pełna lista 25 narzędzi i 50 reguł All 25 Tools & 50 Linter Rules

Spis wszystkich 25 narzędzi MCPAll 25 MCP Tools 25 tools
ToolOpisDescription
gothic_templateGeneruje projekt wtyczki Union (4 silniki, menu, skrypty .d, opcjonalny launcher G1+G2A).Generates a 4-engine Union plugin project (vcxproj, menu, .d scripts, optional G1+G2A launcher).
gothic_recipeGotowe wzorce kodu: text, key, menu_option, save_data, hook, script_replace, external, console.Ready code patterns: text, key, menu_option, save_data, hook, script_replace, external, console.
gothic_api_searchWyszukuje metody, pola, zmienne globalne i stałe KEY_* w GothicAPI (4 silniki).Searches methods, fields, globals, and KEY_* constants across all 4 GothicAPI engines.
gothic_api_classPokazuje rozmiar, dziedziczenie, offsety pól i adresy metod klasy w 4 silnikach.Inspects class size, inheritance, field offsets, and method addresses across 4 engines.
gothic_pitfalls76 zasad silnika ZenGin i Union SDK zapobiegających crashom.76 ZenGin and Union SDK rules preventing common plugin crashes.
gothic_knowledgePrzeszukuje wbudowaną bazę wiedzy i reguł.Searches the built-in ZenGin & Union knowledge base.
gothic_graphOdpytuje opcjonalny graf kodu projektu (graphify).Queries an optional project code graph (graphify).
gothic_lintLinter C++ dla wtyczek Union (reguły ZG001–ZG027).C++ linter for Union plugins (rules ZG001–ZG027).
gothic_lint_dLinter skryptów Daedalus .d (reguły DZ001–DZ023 + kontrola z GOTHIC.DAT).Daedalus .d script linter (rules DZ001–DZ023 + GOTHIC.DAT verification).
gothic_conflictsWykrywa kolizje klawiszy, hooków, sekcji ini i symboli między wtyczkami.Detects hotkey, hook, ini section, and script symbol conflicts between plugins.
gothic_buildBuduje wtyczkę przez MSBuild dla G1, G1A, G2, G2A (Win32) i sprawdza pliki DLL.Builds plugins with MSBuild across G1, G1A, G2, G2A (Win32) and validates output DLLs.
gothic_vdf_packPakuje DLL i skrypty .d do archiwum .vdf (VDFS 2.00) z kopią zapasową.Packs DLL and .d scripts into a VDFS 2.00 .vdf archive with automatic backup.
gothic_vdf_checkSprawdza strukturę .vdf, ścieżki AUTORUN, silnik DLL i brakujące skrypty.Validates .vdf structure, AUTORUN paths, DLL target engine, and missing scripts.
gothic_dll_checkSprawdza 32-bit PE, eksporty Game_*, statyczny CRT i docelowy silnik DLL.Checks 32-bit PE, Game_* exports, static CRT, and target engine of a DLL.
gothic_release_checkAudyt paczki .vdf przed publikacją (ścieżki lokalne, PDB, Debug CRT, brakujące DLL).Pre-release audit of a .vdf archive (local paths, PDB strings, Debug CRT, missing DLLs).
gothic_packageOtwiera i wypakowuje archiwa .vdf oraz .mod.Lists, previews, checks, and extracts .vdf and .mod archives.
gothic_githubPobiera i sprawdza dowolną wtyczkę Union z GitHuba.Downloads and audits any Union plugin repository and release from GitHub.
gothic_gameWyszukuje instalacje Gothica 1/2, opisuje wtyczki i instaluje/wyłącza paczki .vdf.Finds Gothic 1/2 installations, inspects plugins, and installs/disables .vdf packages.
gothic_diagnoseDiagnoza crashy: logi sesji, .dmp minidump oraz puste externale w GOTHIC.DAT.Crash diagnostics: session logs, .dmp minidumps, and empty externals in GOTHIC.DAT.
gothic_logCzyta logi gry i wtyczek oraz tłumaczy adresy błędów na funkcje silnika.Reads game and plugin logs and resolves crash addresses to engine functions.
gothic_addressZamienia adres hex (np. 0x007A9910) na funkcję z GothicAPI.Resolves hex addresses (e.g. 0x007A9910) to GothicAPI function names.
gothic_scriptsCzyta skompilowany GOTHIC.DAT (NPC, przedmioty, dialogi, funkcje, referencje).Inspects compiled GOTHIC.DAT bytecode (NPCs, items, dialogs, functions, xrefs).
gothic_bridgeInstaluje i sprawdza most McpGothic.dll (install, ping, print).Installs and manages the McpGothic.dll bridge (install, ping, print).
gothic_game_stateOdczytuje stan działającej gry: gracz, świat, NPC, waypointy, zmienne, ekwipunek.Reads live game state: player, world, NPCs, waypoints, script variables, inventory.
gothic_screenshotZrzut ekranu z działającej gry przekazywany jako obraz do AI.Captures a live game screenshot and returns it as an MCP image.