skyrim-mcp-tools
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.
skyrim-mcp-tools
An MCP server that lets an AI assistant read, author and maintain
Skyrim Special Edition plugins (.esp). It can inspect vanilla and modded data (NPCs, quests,
dialogue, Papyrus scripts, cells) and build new content: NPCs, quests, dialogue, books, items, cells
and face data.
Built on esplib for plugin parsing and the Python mcp SDK (MCPServer).
Requirements
Python 3.13
Skyrim Special Edition (the
Datafolder is read for masters and scripts)Python packages from requirements.txt:
mcp,Pillowandnumpy(face painting),pytest(tests)Optional: requirements-lore.txt (
fastembed) for semantic lore searchesplib, bundled in esplib/ (modified copy; it requireslz4).requirements.txtinstalls it, or install it alone with:
pip install -e ./esplibRelated MCP server: ModWrench MCP Server
Running
python server.pyRegister it in your MCP client as a stdio server running python server.py from this folder.
Configuration (environment variables)
Variable | Default | Purpose |
|
| Skyrim |
|
| Default plugin load list ( |
|
| Where authored plugins, scripts, snapshots and packages are written |
|
| Creation Kit install folder (Papyrus compiler and |
|
| Cache of vanilla Papyrus sources used when compiling |
| (none) | Extra folders of SKSE |
|
| Skyrim SE |
|
| Local lore database (see Lore database) |
|
| Local Papyrus API database (see Papyrus API database) |
Plugin names resolve to the output folder first, then the Data folder. Absolute paths also work. Tools that modify plugins are serialized with a lock, so batched calls are safe.
Papyrus sources and compiler
Tools that compile scripts (quest stage scripts, dialogue fragments) need the Creation Kit installed.
The vanilla .psc sources in papyrus_src/ are not part of this repo (they are Bethesda's content and
are git-ignored). On first compile they are extracted automatically from the CK's Data\Scripts.rar
using tar, so no manual setup is needed beyond installing the Creation Kit and setting
SKYRIM_CK_DIR if it is not in the default location. To prepare them ahead of time, run:
python -c "from authoring.papyrus_build import ensure_sources; print(ensure_sources())"If SKSE is installed, its .psc sources in Data\Scripts\Source (or the folders listed in
SKYRIM_SKSE_SOURCES) are put ahead of the vanilla ones when compiling, so scripts can call SKSE functions such
as RegisterForMenu or RegisterForAnimationEvent. Vanilla Papyrus is preferred, but an approved behaviour is
never swapped for a vanilla approximation without asking the user first; use detect_skse and api_get to check
what a plan needs, and see the skyrim-skse-scripting skill.
Supported features
Reading and search
search_npcs,get_npc,get_npc_dialogue– find NPCs and inspect their data and dialoguesearch_quests,get_quest,get_quest_structure– quest stages, objectives, aliases, scenes, topicsget_script– decompile.pexscripts to pseudo-sourceapi_get,api_search,api_status– look up Papyrus functions and events (see the API database section)detect_skse– report whether SKSE is installed, whether the compiler can see its sources, and which output scripts use itsearch_forms,search_cells,search_references,get_cell_contents,get_recordget_npc_face,read_book,list_book_models,list_texts,audit_dialogue_length,list_conditions
NPC authoring
Draft workflow:
describe_npc_fields,create_npc_draft,update_npc_draft,add_npc_dialogue,get_npc_draft,validate_npc_draft,write_npc_pluginOne-shot
create_npc, andedit_npcfor existing NPCs (including follower/hireling setup)create_talking_object: an object (barrel, statue, door) the player can talk to, via a talking activatorFace shape and colour:
edit_npc_face,paint_npc_face
Quest authoring
add_questwith kinds fetch, kill, plant and radiant:add_fetch_quest,add_kill_quest,add_plant_quest,add_radiant_quest. A fetch quest's item is owned by the player (no theft bounty;stolen: truekeeps the cell owner) and its alias carries the Quest Object flag so it cannot be dropped.Custom quests from parts:
build_quest(whole quest, atomic) orcreate_quest,add_quest_stage,add_quest_objective; aliases withadd_quest_alias(reference, npc, location or external fill, flags),edit_quest_alias,remove_quest_alias; scripts withattach_alias_script,attach_quest_script,add_clue_set(investigation clues); stage-gated NPC lines withadd_quest_dialogue.add_quest_alias,add_quest_stage_script,add_npc_chat,staged_fight(replacerebuilds one in place),remove_chat,add_follower_controls,search_quests,quest_console_commandspackage_pluginwrites a SEQ file so start-game-enabled quests start on existing saves; the quest-authoring skill also describes a bootstrap quest that starts a plugin's quests when it is installed mid-playthrough
Records, items and world
create_record,create_faction,create_package,clone_record,clone_records,edit_record(raw bytes or named fields such as{"sig": "ENCH", "field": "cost", "value": 250}, orrecord_flags),copy_subrecords,drop_conditions,remove_records.reload_toolsreloads thetools.*Python modules in the running server (notserver.py).install_pluginprunes stale fragment scripts and reports a locked file (Skyrim running);deploy_pluginvalidates, packages and installs in one call.clone_recordclears the Non-Playable flag on ARMO and WEAP clones so they show in the inventory.diff_records(field-aware comparison of two records) andget_record(full=...)with decodedfieldsSplitting and refactoring plugins:
list_records,find_dependents(what points at a group of records),move_records(move records to another plugin, renaming editor-ID prefixes and scripts) andrename_scriptplace_item(coordinates, ornear="<something in the cell>"to pick a free spot beside it),place_items(several items on free floor spots),find_free_spots,create_cell,make_reference_persistent;get_cell_contentstakesx,y,radiusto list the nearest objects.search_cells,get_cell_contentsandfind_free_spotstaketarget_pluginto include the plugin you are authoring (list_records(plugin, signature="CELL")lists its cells)Books:
edit_book(text and in-world model)create_shader,create_unique_item(clone an item with its own name, enchantment and full charge),item_console_commands(player.additem/player.addspelllines for a plugin's items; filter withqueryandsections)
Magic: enchantments, spells and scripts
create_enchantment,enchant_item,create_script_effect(Papyrus-driven effect with adeliveryof touch, aimed, ray or self; touch is a short-range ray),create_script_effects(several effects, each attached to its item, in one call),create_script,check_script(dry-run compile, writes nothing),edit_script(patch a script's source with find/replace and recompile),enchantment_test_plan(in-game checklist for an enchanted item),resolve_form(editor ID to exact IDs),create_enchanted_item(clone boots/weapon, scripted enchantment, attach and place, in one call)create_spell,create_spell_tome,create_scrollcreate_spell_set: one script backing a whole spell family (spells, tomes, scroll, staff) placed in a cell
Text, conditions and scripts
edit_text,edit_texts,lint_text,edit_condition,edit_script
Lore database (optional, built locally)
lore_search,lore_get,lore_status,build_lore_db
This repo ships no lore text. You build a SQLite full-text index on your own machine, and it is git-ignored
(lore_db/lore.db, or set SKYRIM_LORE_DB). Sources, each stored with its license and page URL:
Source | Command | License of the text |
|
| your own game data, local use only |
|
| CC BY-SA 2.5, attribute UESP |
|
| CC BY-SA 2.5, attribute UESP |
Then python -m tools.lore status and python -m tools.lore search "Dwemer" check it. Building a source
replaces that source's rows.
Optional semantic search. Keyword search is best for exact names; vectors help with concepts and paraphrase
("who opposes the Thalmor"). Run pip install -r requirements-lore.txt (fastembed: CPU only, no PyTorch), then
python -m tools.lore build vectors. The model (BAAI/bge-small-en-v1.5, about 130 MB) downloads on first
use and everything stays local. Embedding is CPU-bound, so a full UESP import takes a long while (the 1,500
game books alone took several minutes); it is incremental, so an interrupted run resumes and only new chunks
are embedded. Once vectors exist, lore_search defaults to a hybrid of keyword and semantic results
(mode can force keyword, semantic or hybrid). Rebuilding a source drops its vectors; rerun build vectors.
Use the results as reference and cite them; do not paste wiki or game text into a published plugin or redistribute the database.
Papyrus API database (optional, built locally, separate from lore)
api_get,api_search,api_status,build_api_db
Functional facts for writing Papyrus live in their own SQLite file (api_db/api.db, or set SKYRIM_API_DB),
so lore queries never return script text and script lookups never return flavour. Both databases share the
same store and embedding code in knowledge/; lore_* tools only touch the lore file and api_*
tools only touch this one. Use api_get(script, member) for exact lookups and api_search for intent. Only
native members are indexed, so a missing member means the call does not exist unless it is a
non-native engine event such as OnInit (declared in the base script type, not natively); those return empty
even though they are valid, so confirm them against the compiler with check_script. Each result carries
skse: true for members that need the Script Extender (for example RegisterForKey, OnKeyDown,
Actor.IsSwimming), and api_get on a member searches the script's parent chain (OnPlayerLoadGame is on
ReferenceAlias, Actor and ActiveMagicEffect, not Form). Verify every call of a planned script this way
before building, and ask the user before substituting a different behaviour (see the skyrim-skse-scripting skill).
Source | Command | Notes |
|
| your own sources (extracted CK sources plus SKSE sources found by |
|
| your own game data |
|
| CC BY-SA 3.0, attribute the CK wiki |
python -m tools.papyrus_api get Actor DamageActorValue and ... search "restore health" check it. Vectors are
optional and work the same way as for lore (python -m tools.papyrus_api build vectors, same model, separate
embeddings).
Quick setup
Make sure the Papyrus sources exist: install the Creation Kit (
SKYRIM_CK_DIR) and let a first compile extractData\Scripts.rarintopapyrus_src/(see Papyrus sources and compiler). If SKSE is installed, its.pscfiles inData\Scripts\Sourceare picked up automatically.python -m tools.papyrus_api build scripts(the essential step; add--all-scriptsto index non-native scripts too), thenpython -m tools.papyrus_api build actor-values.Check it with
python -m tools.papyrus_api status, or theapi_statustool.Rerun
build scriptsafter installing or updating SKSE, otherwise SKSE-only members are not flagged[SKSE]. Thebuild_api_dbtool does the same from inside a session. Restart the MCP server if it was running with no database.
Plugin lifecycle
snapshot_plugin,list_snapshots,restore_snapshot,diff_pluginvalidate_plugin(also warns about zero-cost enchantments and old header versions),audit_plugin, andaudit_voice(per-NPC voice type, recorded lines and combat lines;audit_pluginincludes its warnings)install_plugin(copy to Data, with dry run),deploy_plugin(validate, thenmode"package", "install" or "both" for zip plus install; can remove stale loose copies) andpackage_plugin(zip);install_pluginandpackage_pluginalso take a list of plugins
Voice line editor (misc/voice_lines_gui.py)
A Tkinter app for the voiced side of a plugin. Run it from the repo root:
python misc/voice_lines_gui.py path\to\Plugin.espLists every spoken dialogue line in the plugin with quest, topic, speaker, voice type and whether audio exists, with a text filter and a "Missing audio only" toggle. Audio is found as loose files (output folder, then Data) and inside BSAs (the plugin's own archive and any
*voices*archive in Data).Play plays
.wavdirectly and decodes.fuz/.xwm(including from BSAs) through ffmpeg.Record captures the microphone to a 16-bit mono 44.1 kHz WAV; the dropdown beside it picks the input device (system default or any recording device, re-scanned when opened so a newly plugged-in mic appears). Upload audio... copies in a
.wav,.fuzor.xwm, or converts.mp3/.ogg/.flac/.m4ato WAV.Volume / pitch: Adjust selected / Adjust all lines change the volume (dB) and pitch (semitones, length kept so lip sync still fits) of the plugin's loose voice files.
.fuz/.xwmare re-encoded (needsxwmaencode, below). The original is saved once to<plugin folder>\voice_originals\(not packaged); Restore selected originals / Restore all originals bring it back. Re-recording or uploading a line discards its saved original.The line list supports multi-select (Ctrl/Shift-click); the "selected" buttons act on every selected line.
Selected to .fuz / All WAVs to .fuz generate lip sync from the line text, encode xWMA, and pack a
.fuz(the WAV is then removed), so the line lip-syncs in game. A loose WAV also plays in Skyrim SE but with a still face.New voice type... adds a VTYP record to the plugin (after a snapshot) and can assign it to the line's speaker NPCs that are defined in the plugin.
Edit response (for lines whose INFO is defined in the plugin) changes the line text, emotion type and value, the "use emotion animation" flag, and the speaker/listener body animations (any loaded
IDLE, e.g.IdlePray). Apply snapshots the plugin first (pre_dialogue_edit). Changing text doesn't change the audio, so re-record or re-convert the line. Localized plugins (string tables) can't be text-edited, and an animation must come from the plugin itself or one of its masters.Suggest fills the emotion fields from the line text using NRCLex (review, then Apply). Suggest for selected / Suggest for all Neutral set an emotion on the selected (or every) editable line still at Neutral, after a confirmation and one
pre_emotion_suggestsnapshot; lines that already have an emotion are untouched. It is a word-lookup guess (anger, disgust, fear, sad, happy, surprise; a question with no emotional words becomes Puzzled), so it misses sarcasm and negation. Needspip install nrclex(optional).Pack zip runs
package_plugin; Install to Data copies the plugin and its files into Data.
Voice files are written to <plugin folder>\Sound\Voice\<Plugin.esp>\<voice type>\<quest>_<topic>_<info id>_<n>
using the Creation Kit naming (quest cut to 10 characters, topic to 15, load-order byte of the info ID zeroed).
package_plugin, install_plugin and validate_plugin include the Sound folder for the plugin.
Requirements:
Windows (microphone recording uses the built-in waveIn API; playback uses
winsound), and Python'stkinter.Skyrim SE
Datafolder (SKYRIM_DATA_DIR) for masters and existing audio.ffmpeg on
PATHfor playing.fuz/.xwm, converting non-WAV uploads and adjusting volume/pitch. Plain WAV needs nothing extra.For
.fuzconversion: the Skyrim SEToolsfolder next toData(installed with the Creation Kit), containingAudio\xwmaencode.exe,LipGen\LipGenerator\LipGenerator.exe(withFonixData.cdf) andLipGen\LipFuzer\LIPFuzer.exe. SetSKYRIM_TOOLS_DIRif it lives elsewhere. Lip sync is generated for English.A voice type must be chosen for each line before recording or uploading, because the folder is named after it. Create one with New voice type... if the NPC has none.
Mesh & texture duplicator (misc/assets_gui.py)
A Tkinter app for giving a record its own copy of a model and its textures:
python misc/assets_gui.py path\to\Plugin.espLists the plugin's own records that use a mesh (
MODL/MOD2-MOD5) or are texture sets (TXST); tick "Include master records" and type 3+ filter characters to find vanilla ones. Meshes and textures are read from loose files (plugin folder, then Data) and from BSAs.Selecting a record previews the mesh textured with its diffuse maps (UV-mapped; untick to see plain shading, drag to rotate) and lists the textures its NIF names; selecting a texture previews it. Skinned armor is previewed too. DDS formats Pillow can't decode show "Can't preview" and render grey.
Duplicate... copies the NIF to
Meshes\<folder>\<model name>.nif(you choose the name; it defaults to the original's), every texture it names toTextures\<folder>\<model name>\, and rewrites the texture paths inside the copied NIF. Then, your choice: clone the record under a new editor ID (works for master records too), repoint the record itself (for a master's record this adds an override), or files only, which leaves every record alone. TXST records get theirTX00-TX07paths repointed. A snapshot is taken first (not for files only) and the staleMODThash subrecords are dropped.Pack zip /
package_plugininclude the loose meshes and textures the plugin's records use (model paths, texture sets, and textures named inside those meshes), not just FaceGen files.Replace texture... overwrites a texture in the plugin's own
Texturesfolder with another.dds.All models... lists every NIF a record uses: its own models (a weapon's world model, an armor's male/female models) plus those of records it points to (a weapon's first-person STAT, an armor's armor addons). Pick one, choose a folder and model name, and only that NIF is copied (with its textures) and repointed. A master's linked record is cloned (you give the editor ID) and the weapon/armor is pointed at the clone, so other items sharing the vanilla record are unaffected.
Mesh structure... shows the NIF's node/shape hierarchy with each shape's shader and textures.
BSTriShapes can be exported to.obj(one shape or all) and a shape can be replaced from an.obj; the shape keeps its shader, textures and vertex format, and normals/tangents are rebuilt. Rigged (skinned) shapes, such as armor, work too: the skeleton, bind pose and body-part slots are kept and each new vertex copies its bone weights from the nearest original vertex, so reshaping armor works but new bones can't be added. Import edits the mesh in the plugin's ownMeshesfolder, so duplicate it first. Only Skyrim SE meshes (BSTriShape, plain triangle lists) are handled: Skyrim LE meshes (NiTriShape/NiTriStrips) aren't listed as editable, and a skin partition stored as triangle strips is rejected with an error. Convert LE meshes to SE first (Cathedral Assets Optimizer or NifSkope).Use another model... / First-person model... repoint a record at one of your copies, or give a weapon its own first-person model. They also detach a weapon/armor's template record (
CNAM/TNAM), whose model would otherwise win.Only
BSShaderTextureSetpaths are rewritten; effect-shader textures (BSEffectShaderProperty) and alternate texture records (MODS) still point at the originals. Needs Pillow and numpy (in requirements.txt).
Project layout
server.py – MCP tool definitions
tools/ – everything
server.pyrelies on, grouped by form category: core/ (plugin model and editor shared by everything), quests/, npcs/ (including face data), dialogue/, papyrus/ (compile and decompile), books/, cells/ (cells, references, item placement), records/ (cloning, generic edits, text, snapshots), lore/ (local lore database builder and search), papyrus_api/ (local Papyrus API database: scripts, actor values, CK wiki), knowledge/ (SQLite/FTS store, embeddings and MediaWiki import shared by both)esplib/ – bundled, modified plugin-parsing library (MPL 2.0)
tests/ – pytest suite
.github/skills/ – assistant guidance for common Skyrim modding workflows
misc/ – standalone helper scripts (graph/tree viewers, reports, the voice line editor)
output/– generated plugins and sample builds
Testing
pip install -r requirements.txt
python -m pytestGitHub Actions (tests.yml) runs only the tests that don't need game files
(pytest -m "not game and not compiler"). Tests marked fakegame run against a small synthetic
Skyrim.esm built by tests/fake_master.py (only the records the tests use), so they
need no install and run in CI; add a record there when a fakegame test needs another vanilla one. Tests
marked game need the real Skyrim SE (they load Skyrim.esm, about 30 s), and tests marked compiler also
need the Creation Kit Papyrus compiler, so run those locally with
SKYRIM_DATA_DIR and SKYRIM_CK_DIR set if your install isn't in the default Steam location:
python -m pytest -m game
python -m pytest -m compilerWithout Skyrim.esm in the Data folder, game tests are skipped automatically.
The slow plugin-writing tests are split by area so you can run only what you changed:
tests/test_npc_tools.py, test_record_tools.py, test_quest_tools.py, test_package_tools.py,
test_enchant_tools.py (enchantments, script effects, items) and test_spell_set_tools.py. Shared fixtures
live in tests/conftest.py and shared helpers in tests/helpers.py. The CI matrix groups the files the same
way (core, spells, authoring); add new test files to a group in the workflow.
Coverage
python -m pytest --cov=tools --cov-report=term-missingThe full suite (441 tests, about 5 minutes) covers 90% of tools/ (8,722 statements, 873 missed), and every
module is at 75% or higher. Coverage was measured with the fixture master, so it needs no game files.
Area | Coverage |
| 83–99% ( |
| 75–99% ( |
| 86–100% ( |
| 79–98% ( |
| 89–100% |
| 78–100% ( |
| 83–100% |
Some tests stub the Papyrus compiler or reference persistence, and face-file paths that need real mesh assets are only partly covered, so the figures are a little generous for those areas. Numbers are a snapshot; rerun the command above for current ones.
License
Licensed under the Mozilla Public License 2.0. The bundled esplib/ is a modified copy of esplib, under the same license (esplib/LICENSE).
Skyrim is a trademark of Bethesda Softworks; this project is unaffiliated.
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
Savecraft serves real save game data and expert game knowledge to AI assistants.
Connect any AI to your Foundry VTT world: actors, combat, dice, journals, tokens, compendiums.
Read and write KukGit repositories, files, issues and pull requests from an AI assistant.
LLM chat, text tools, image generation, editing, batch image jobs, and asynchronous video generation
Related MCP Servers
- AlicenseAqualityNot gradedmaintenanceEnables AI assistants to read, write, organize, search, and compile Scrivener writing projects. Supports manuscript editing, document management, consistency checking, and PDF export for writers using Scrivener 3.228 npm-
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to search, browse, and manage mods across Nexus Mods, mod.io, Thunderstore, and Modrinth, as well as perform local diagnostics like detecting games and parsing crash logs.MIT
- AlicenseCqualityCmaintenanceProvides 46 local MCP tools to inspect and automate the Fallout 3 GECK editor, covering diagnostics, cell/object navigation, plugin inspection and backups, and file-level placement corrections. It enables AI assistants to plan and safely edit plugin records with atomic file operations and rollback support.46MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI coding tools to connect and authorize local game projects, then drive source edits, validation, preview, version saving, and mode-based creation workflows.Apache 2.0