MCP server for IW4X/MW2 modding — IWD file ops and DVAR reference
IW4X Toolkit has 17 tools with generally good naming (verb_noun patterns like iwd_extract, iwd_read) and descriptions present on all tools. However, the implementation has significant gaps in schema completeness and parameter documentation. Only 4 of 17 tools show complete parameter schemas with type definitions and descriptions visible in the source. Most tools lack documented return schemas, making it difficult for LLMs to understand what fields to expect. Error handling is present but lacks recovery guidance. The codebase is well-organized and uses Zod for validation, but the actual schema definitions in tool registrations are incomplete or truncated in the provided source.
Lints GSC (Game Script) code for syntax errors, undefined variables, bad patterns, and best practice violations. Use this to validate GSC scripts before testing in-game. Supports vibe coding: the LLM should run this after writing/modifying .gsc files.
Search the GSC built-in function reference. Use this to find correct function signatures and descriptions. Helps prevent hallucinated function names in vibe coding.
Generate GSC code from common templates. Use this to quickly scaffold common patterns like callbacks, gam[truncated content in source]
Copy an entry from one IWD archive to another (or within the same archive). Useful for duplicating entries or moving files between mod packages. Set dry_run=true to validate without modifying anything.
Compare two IWD files and report added, removed, modified (CRC mismatch), and identical entries. Use entry_glob to limit comparison to a specific subset of files. Set content_diff=true to include diffs for modified text entries. Use diff_format='side-by-side' for a visual two-column view.
Missing documented return schemas. No tool has an explicit description of its output structure. LLMs cannot infer what fields to expect from responses (e.g., iwd_list returns entries but no documented field names, types, or total count for pagination planning).
gsc_template description is truncated in source ([truncated content in source]) and lacks detail on what templates are available and when to use the tool. Cannot determine template coverage or template resolution behavior.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | C | 66 | 2026-07-28+ | v2 |
| 2026-03-09 | D | 57 | - | v1 |
Extract entries from an IWD archive to a directory on disk. Once extracted, standard shell tools (rg, fd, bat) work natively. Use entry_glob to extract only a subset of files. Returns the destination path and list of extracted files.
Get metadata for a single entry in an IWD archive without reading its content. Use this before iwd_read to check file size and type, avoiding accidental large or binary reads.
List entries in an IWD archive. Defaults to compact name-only output — efficient for discovery. Use summary_only=true for a one-line type breakdown (e.g. '45 .gsc, 12 .menu, 8 binary') — the cheapest first call on any IWD. Use pattern to filter by glob (e.g. '*.gsc', 'ui_mp/*.menu'). Pass names_only=false only when you need file sizes.
Zips the entire contents of a workspace directory into a BRAND NEW IWD archive. WARNING: If the destination file already exists, it is completely overwritten and replaced. If you want to inject a few changed files into an existing archive without deleting everything else, use iwd_sync instead.
WARNING: For editing multiple files or doing large overhauls, use iwd_extract + workspace tools + iwd_sync instead. Perform a surgical string replacement inside a single text entry in an IWD archive. Returns a ±3-line diff snippet around the change so you can verify the edit without re-reading the file. Only replaces the first occurrence by default — use count=-1 to replace all. Set dry_run=true to preview what would change without modifying the archive.
Read a file from inside an IWD archive. Returns UTF-8 text for text files (.gsc, .menu, .cfg, .csv, etc.) and base64 for binary files (.iwi, .d3dbsp, etc.). Use limit and offset to read sections of large files without flooding context. Use iwd_info first to check file size and type before reading large files.
Remove an entry from an IWD archive. Creates a .bak backup on first modification per session. Set dry_run=true to validate without actually removing the entry.
Rename or move an entry within an IWD archive in a single operation. Equivalent to iwd_read + iwd_write + iwd_remove, but faster and atomic. Set dry_run=true to validate without modifying the archive.
Injects or overwrites specific files from a workspace directory into an EXISTING IWD archive. Crucially, it leaves all other files in the archive untouched. Use this (instead of iwd_pack) when you've extracted a mod, edited a few files, and want to put just those files back into the original archive.
WARNING: For editing multiple files or doing large overhauls, use iwd_extract + workspace tools + iwd_sync instead. Write or replace an entire single file inside an IWD archive. For targeted edits to a small part of a large file, prefer iwd_patch instead (avoids re-sending full content). Creates a .bak backup on first modification per session. Content must be UTF-8 text. When replacing an existing text entry, returns a ±3-line diff for verification. Set dry_run=true to validate the operation without committing it.
Copies modified loose files from your workspace directly into a specific mods/<modname> folder. The engine prioritizes loose files over packed .iwd files, enabling rapid live testing.
Copies modified loose files from your workspace into the MW2 userraw installation folder. Files placed here are loaded globally by the engine, overriding everything else.
gsc_lookup lacks return schema documentation. No description of what fields the function reference returns (is it name, signature, parameters, return type, category?). LLMs cannot extract the correct information from search results.
iwd_list accepts 'limit' parameter but no documented pagination cursor/next_token. With potentially hundreds of files in an archive, LLMs cannot request subsequent pages of results.
Destructive operations (iwd_write, iwd_patch, iwd_remove, iwd_pack) lack explicit confirmation/dry-run guidance in descriptions. While dry_run parameter exists, the descriptions do not emphasize that LLMs should always validate with dry_run first.
Error handling descriptions missing. Tools do not document what errors can occur, what causes them, or how to recover (e.g., iwd_read on binary file, iwd_patch with non-matching old string, invalid IWD file format).
gsc_lint and gsc_lookup depend on 'knowledge base' files (gsc-builtins.json, templates.json) loaded from getKnowledgeDir(), but availability and format are not documented. Tools can silently fail with empty caches if files are missing.
iwd_read parameters 'limit' and 'offset' are documented for text files only, but behavior for binary files (base64 encoding) is unclear. What does 'limit' mean for binary? Does offset apply?