mcpField
S
se-dev-server-code

se-dev-server-code

github.com/cometworksDevelopment1172 installsUpdated 2d ago
Repository

About se-dev-server-code

SE Dev Server Code Skill helps Space Engineers server developers inspect decompiled C# code and textual server content. It prepares versioned local data and provides search actions for APIs, code structure, and content references.

Key features

  1. 01Prepare decompiled server sources
  2. 02Search classes, methods, and fields
  3. 03Inspect class hierarchies
  4. 04Track source changes by server version
  5. 05Search textual content and code references

Use cases

  1. 01Check an API before calling or patching it
  2. 02Compare code between server releases
  3. 03Find content files used by C# code

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/cometworks/skills --skill se-dev-server-code

After installing, type/se-dev-server-codein Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

.python-version
Advanced.md
check_index.py
check_version.py
Clean.bat
clean.sh
CodeSearch.md
CommandExecution.md
CommandExecutionDetails.md
common-posix.sh
ContentTypes.md
copy_content.py
Decompile.sh
DecompileDll.sh
DetectServerRoot.bat
fix_case_collisions.py
hash_server_files.py
hierarchy_tree.py
HierarchySearch.md
Implementation.md
index_code.py
index_content.py
Prepare.bat
Prepare.md
prepare.sh
pyproject.toml
actions/
bash.md
prepare.md
search.md
test.md

Details

From the project README

SE Dev Server Code Skill

Allows reading the decompiled C# code of the Space Engineers Dedicated Server. Server "game logic" is largely the same as game (client) runs. Entry point (main executable), some aspects of logging and configuration differ. Also, some libraries are not used by server, but they may still present to provide necessary data structures and some backend functionality.

⚠️ CRITICAL: Commands run in a UNIX shell. Use bash syntax. On Windows this is BusyBox; on Linux use the native shell.

Examples:

  • ✅ test -f file.txt && echo exists
  • ✅ ls -la | head -10
  • ❌ if exist file.txt (echo exists) - This will NOT work

Actions:

  • prepare: Run the one-time preparation (Prepare.bat on Windows, prepare.sh on Linux)
  • bash: Run UNIX shell commands (busybox on Windows, native shell on Linux)
  • search: Run code searches using search_server_code.py
  • test: Test this skill by running test_search_server_code.bat on Windows or test_search_server_code.sh on Linux

Routing Decision

Check these patterns in order - first match wins:

PriorityPatternExampleRoute
1Empty or bare invocationse-dev-server-codeShow this help
2Prepare keywordsse-dev-server-code prepare, se-dev-server-code setup, se-dev-server-code initprepare
3Bash/shell keywordsse-dev-server-code bash, se-dev-server-code grep, se-dev-server-code catbash
4Search keywordsse-dev-server-code search, se-dev-server-code find class, se-dev-server-code lookupsearch
5Test keywordsse-dev-server-code test, se-dev-server-code verify, se-dev-server-code checktest

Requirements

Host system must have the following on PATH:

  • Python 3.11 or newer
  • git command line client (used to version each decompiled server build)
  • dotnet SDK (for installing ilspycmd)

Getting Started

⚠️ CRITICAL: Before running ANY commands, read CommandExecution.md to avoid common mistakes that cause command failures.

If Prepare.DONE file is missing in this folder, you MUST run one-time preparation steps first. See the prepare action.

If server auto-detection fails, set SE_SERVER_ROOT before running preparation script. Point it to the dedicated server root (on Linux it may also point directly to the DedicatedServer64 directory).

Folder Layout

After preparation the skill folder contains a Data junction/symlink. Actual data lives outside the skill folder so it is preserved across Clean.bat / Prepare.bat / prepare.sh cycles.

skills/se-dev-server-code/
├── Data/                 (junction/symlink → per-user persistent server-code data)
│   ├── .git/             local Git repository tracking decompiled sources
│   ├── .gitignore        ignores CodeIndex/, graphify-out/, __pycache__, *.py[cod], *.bak, *.log
│   ├── game_version.txt  recorded SE_VERSION / CLIENT_BUILD_NUMBER / SERVER_BUILD_NUMBER
│   ├── server_files.json SHA256 of every original server file (committed - diffable)
│   ├── Decompiled/       decompiled C# sources only, organised per assembly (committed)
│   ├── Content/          textual server content (committed - definition changes reviewable)
│   ├── CodeIndex/        CSV indexes (NOT committed - regenerated)
│   └── graphify-out/     Graphify graph of Decompiled/ (NOT committed - regenerated)
├── Bin64/                (junction/symlink → server's DedicatedServer64, removed after preparation)
└── ...                   skill scripts and documentation

The Data folder is a junction/symlink to per-user persistent server-code data directory (%USERPROFILE%\.se-dev\server-code on Windows, ~/.se-dev/server-code on Linux). Treat Data/Decompiled, Data/Content and Data/CodeIndex exactly as before.

Graphify Graph

Preparation builds a separate Graphify graph for decompiled server code under Data/Decompiled (or SE_DEV_SERVER_CODE_GRAPH_ROOT). The graph is written beside the graphed tree, to Data/graphify-out (or SE_DEV_SERVER_CODE_GRAPH_OUT), so Data/Decompiled holds nothing but decompiled C# code. Prepare installs Graphify on Python 3.12 with the fast native Rust Leiden clustering backend and, when that backend is available (needs uv), builds the graph automatically in ~1-2 minutes. Where the fast backend cannot be provisioned it falls back to the slow single-core clustering (~10-30 minutes) and stays opt-in with SE_DEV_GRAPHIFY=1 (ask the user first); SE_DEV_GRAPHIFY=0 disables it. Read these on demand — skip them for normal search work:

Health check and query test (only meaningful once a graph is built):

bash ../se-dev/graphify-check.sh Data --deep   # is the graph usable?
./test_graphify_server_code.sh                            # run a few graph queries

Local Versioning of Decompiled Sources

The Data folder is a local Git repository. Every successful preparation creates a commit of the decompiled C# sources whose message is server version label, e.g. 1.208.015 b4.

This means:

  • All previously decompiled server versions are preserved in local Git history. You can git checkout any past commit inside Data/ to inspect or diff against older build.
  • Server updates are detected automatically by comparing binaries' embedded version constants with Data/game_version.txt. If they differ (or file is missing), Decompiled/, Content/, CodeIndex/, graphify-out/ and server_files.json are wiped and fresh decompilation runs.
  • This makes it easy to update plugins, mods and scripts for compatibility with new server releases: diff the relevant source between two commits inside Data/ to see exactly what changed.

Repository uses internal author/email (se-dev-skills@localhost) so commits work even on machines without configured global Git identity.

Original Server File Hashes

Preparation also records SHA256 of every file in the Space Engineers Dedicated Server install into Data/server_files.json (path relative to install root → lower-case hex digest, alphabetically sorted, one pair per line) and commits it under the version label. Diffing it between two version commits shows exactly which binaries a game update changed — including assets that are neither assemblies nor text, so they appear in neither Data/Decompiled nor Data/Content.

Verify an install against the recorded digests with ./verify_server_files.sh (Linux) or .\VerifyServerFiles.bat (Windows). Read ServerFileHashes.md for the file format, the diffing recipe and the verification output.

Essential Documentation

  • CommandExecution.md - ⚠️ READ THIS FIRST - Windows command execution details; on Linux keep bash syntax and use prepare.sh

Code Search Documentation

Quick Search Examples

# Find class declarations
uv run search_server_code.py class declaration MyCubeBlock

# Find method signatures
uv run search_server_code.py method signature UpdateBeforeSimulation

# Find class hierarchy
uv run search_server_code.py class children MyTerminalBlock

# Count results before viewing (useful for large result sets)
uv run search_server_code.py class usage MyEntity --count

# Limit number of results
uv run search_server_code.py class usage MyEntity --limit 10

# Paginate through results
uv run search_server_code.py class usage MyEntity --limit 10 --offset 0
uv run search_server_code.py class usage MyEntity --limit 10 --offset 20

Check the server code when you need exact APIs, method bodies or IL: the code you are about to call or patch. For how a system works overall, read the se-dev-server-book handbook first if it is installed; it is faster than searching. Without the handbook, this skill is the reference for that too.

Custom Scripting

For building your own utility scripts to work with the indexes and decompiled code:

Server Content Data

Textual part of server's Content is copied into Data/Content folder for free text search:

  • Language translations, including string IDs
  • Block and other entity definitions
  • Default blueprints and scenarios
  • See ContentTypes.md for full list of content types
Content Index

Data/CodeIndex/content_index.csv maps every textual content file to decompiled C# source files that reference it. Columns: rel_path (path relative to Data/Content/) and usage (path of a C# source file in Data/Decompiled/ that references it). Each content file appears once per usage, so you can filter and page by rel_path to see all C# code that loads or references a given content file. Files with no known usages have single row with empty usage column.

Running the Dedicated Server

Server executable is SpaceEngineersDedicated.exe in the DedicatedServer64 folder.

Headless Mode (No UI)
SpaceEngineersDedicated.exe -console

Bypasses Telerik WinForms configuration UI and runs server directly.

Configuration

Server is configured via XML files. Primary configuration file is SpaceEngineers-Dedicated.cfg in server's AppData directory (typically %APPDATA%\SpaceEngineersDedicated\).

Key configuration areas:

  • Server settings (name, world, mods, max players)
  • World settings (game mode, inventory size, welding speed)
  • Network settings (port, public/private)

Configure by editing the XML files directly. This skill ships no configuration, world or mod management utilities - see ScriptingGuide.md if you need to script such a task.

Server-Only Assemblies
AssemblyDescription
SpaceEngineersDedicatedServer entry point (replaces SpaceEngineers.exe)
VRage.DedicatedDedicated server framework, lifecycle, configuration
VRage.RemoteClient.CoreRemote client support (RCON-like functionality)

General Rules

  • In Data/Decompiled folder search only inside C# source files (.cs) in general. If you work on transpiler or preloader patches, then also search IL code (.il) files, if preparation produced them (off by default, see DecompileDll.sh).
  • In Data/Content folder search files appropriate for the task. See ContentTypes.md for list of types.
  • Do not search for decompiled server code outside Data/Decompiled folder. Decompiled server source tree must be there if preparation succeeded.
  • Do not search for server content data outside Data/Content folder. Copied server content must be there if preparation succeeded.

Action References

Follow detailed instructions in:

Remarks

Original source of this skill: https://github.com/CometWorks/skills

Comments

Markdown supported