Repository navigation
Description
What happened?
Summary
On Windows, the HTTP server launched by the Unity package got stuck in a loop logging the same asyncio error
thousands of times per second. Library/MCPForUnity/Logs/server-launch-8080.log reached 116 GB
(growing about 2.4 MB/s) and filled the drive. The server never recovered by itself; it had to be stopped by hand.
Environment
- MCP for Unity: 10.3.0 (package
com.coplaydev.unity-mcp10.3.0, servermcpforunityserver==10.3.0) - Unity 6000.6.4, Windows 11 Pro (10.0.26300)
- Python 3.14.4 (CPython, launched through
uvx) - Transport: HTTP,
--http-url http://127.0.0.1:8080 --project-scoped-tools
Log
The whole file is this block, repeated:
2026-11-04 20:11:30,492 - asyncio - ERROR - Exception in callback BaseSelectorEventLoop._read_from_self()
handle: <Handle BaseSelectorEventLoop._read_from_self()>
Traceback (most recent call last):
File "...\Lib\asyncio\events.py", line 94, in _run
self._context.run(self._callback, *self._args)
File "...\Lib\asyncio\selector_events.py", line 132, in _read_from_self
data = self._ssock.recv(4096)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
Cause (as far as I can tell)
The event loop's internal self-pipe socket was reset. After that, every loop iteration fails in
_read_from_self and logs the error again. This looks like the open CPython bug
python/cpython#116091. I don't know what reset the socket (sleep/wake, a network
change, or security software are the usual suspects on Windows).
Expected
Even if the Python bug can't be fixed here, the server should not be able to fill the disk:
- Limit the size of
server-launch-*.log(for example a rotating file handler or a size cap). - Detect the repeating
_read_from_selferror (for example with a custom loop exception handler) and restart
or exit the server instead of logging forever. - The traceback shows a
SelectorEventLoopon Windows, where the default is theProactorEventLoop. If the
selector loop isn't required, using the default loop may avoid the problem.
Steps to reproduce
Not reliably reproducible. It happened after the server had been running for a while with the Editor open.
Reproduction steps
Not reliably reproducible. Steps that led to it:
-
Open the project in Unity 6000.6.4f1 on Windows 11. Unity starts the HTTP server automatically
(uvx --from mcpforunityserver==10.3.0 mcp-for-unity --transport http --http-url http://127.0.0.1:8080 --project-scoped-tools), running on Python 3.14.4. -
Use the server from Claude Code (desktop app) for several hours with the Editor open (normal tool calls: scenes, assets, tests, console).
-
At some point the server starts logging this block in a loop, thousands of times per second:
asyncio - ERROR - Exception in callback BaseSelectorEventLoop._read_from_self() File "...\Lib\asyncio\selector_events.py", line 132, in _read_from_self data = self._ssock.recv(4096) ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host -
Library/MCPForUnity/Logs/server-launch-8080.loggrows about 2.4 MB/s and reached 116 GB, filling the drive.
The server never recovers; stopping its processes by hand is the only fix.
Likely related to the open CPython bug python/cpython#116091 (selector loop self-pipe reset on Windows).
Expected: the log size is limited, and the server restarts or exits instead of logging forever.
Unity version
Unity 6000.6.4
MCP for Unity package version
10.3.0
Python server version
10.3.0
MCP client
Claude Code
Transport
HTTP (default)
OS
Windows
Relevant logs / console output
Checks
- I searched existing issues and did not find a duplicate
- I included logs / steps to reproduce
Activity