MCP Server for Space Engineers Plugin Development
For support please join the SE Mods Discord.
Please consider supporting my work on Patreon or a one-time donation via PayPal.
Thank you and enjoy!
What's this?
This is an MCP Server for "AI" coding agents, providing useful functionality for plugin development.
This tool supports only Space Engineers 1, currently.
Prerequisites
- Space Engineers installed via Steam
- .NET 8.0 SDK, Windows x64
- ILSpy version 8.2.0.7535 - Install it by running
SetupILSpy.bat - Python 3.12 or newer
- Git
- At least 1GB free disk space
Make sure these executables are available on PATH:
ilspycmdpythongit
Define this environment variable: SPACE_ENGINEERS_ROOT
- Usual value:
C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers - If you installed the game at a custom path, then use that path.
Preparation
Run Prepare.bat, it should take about 10-20 minutes to fully decompile the game and install code-index-mcp.
It should print DONE at the end.
Connecting to a coding agent in your IDE
The following setup is known to work well:
- VSCode: Install the original from Microsoft, not the OSS VSCodium, because that lacks some AI API integration we need.
- Copilot plugin: Just follow the instructions
- Cline plugin: Just follow the instructions
In Cline's Settings select this API Provider: "VS Code LM API"
Make sure you have the Cline and Chat tabs open on the right side panel.
In Cline's tab click on the MCP Servers button, it has the "stack of 3 servers" icon at the top. Select the "Configure"tab, then click on the "Configure MCP Servers" button. Copy the "space-engineers-code-index" entry from the mcp.jsonfile generated by Prepare.bat into the MCP server list of your editor.
Your IDE will automatically start an instance as needed and manage its lifetime. The decompiled game code is huge,so it may cause some delays due to indexing. It is still well worth the time and effort if you use any AI for coding.
Best practices
For Plan mode select GPT-5, for Act mode select GTP-5-mini. You may choose other models as you wish or available.
If you want to use it a lot, then it is well worth buying the $100/year Copilot Pro subscription (as of November 2025).
You can do the full development in VSCode, or keep VSCode open in the same repository as your regular IDE (VS, Rider)and use the regular IDE for manual changes, build and debugging, while running the coding agent in VSCode in parallel.
This latter setup worked the best for me since it allows for doing planning in parallel to testing/debugging easily,since they don't involve changing any code.
Serving MCP over HTTP transport
MCP can be served over HTTP transport, which allows for connecting to it from coding agents running on another machine or server.
The preparation script will create a HttpServer.bat batch file, you can use to run the MCP Server over HTTP.Connect to 127.0.0.1:8000 with your coding agent (MCP client).
Test: http://127.0.0.1:8000/sse/ - It should say event: endpoint
SSE: Server-Sent Events is a technology that allows a server to send automatic updates to a client over an HTTP connection.
If you want to connect an external host or server (like GitHub Copilot) to this MCP server, then you have toforward 127.0.0.1:8000 to a publicly visible endpoint, ideally in a way which wraps it as HTTPS (reverse proxy).
Your publicly visible hostname (or domain) needs to be whitelisted in the GitHub Copilot settings for this to work.
- TODO: Forwarding HOWTO: SSH port forwarding, reverse proxy setup, open port on router, etc.
- TODO: Authentication with a secret URL path.
- TODO: Authentication with a Bearer token.