You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Yes. ASP.NET is currently incompatible with the Unity Editor, which prevents hosting an SSE (Server-Sent Events) server using this framework. This limitation makes it difficult to implement real-time communication features in Unity projects using ASP.NET.
Describe the solution you'd like
I’ve implemented an SSE server for Unity using ModelContextProtocol (MCP) with EmbedIO. You can check out the implementation here: https://github.com/WHedlund/ModelContextProtocolUnityEmbedIO
I’d love to see something like this officially supported or incorporated into the main MCP repository.
Describe alternatives you've considered
I initially tried using ASP.NET-based approaches, but the lack of compatibility with the Unity Editor was a blocker. Other solutions either required external services or added unnecessary complexity.
Additional context
Feel free to adopt or improve on my implementation if it fits within the project’s goals!
The text was updated successfully, but these errors were encountered:
I'm still fairly new to these frameworks, so I might not have the full technical details, but from my experience and what I’ve gathered, Unity has limited support for ASP.NET Core. Specifically, it doesn't seem possible to run ASP.NET Core web services directly within a Unity game or the Unity Editor.
I asked ChatGPT for some clarification, and here's a helpful summary:
As of April 2025, Unity and ASP.NET Core continue to operate on separate runtime environments, and direct integration remains unsupported. Unity primarily uses its own runtime (Mono or IL2CPP), while ASP.NET Core is built on the .NET Core runtime. This separation means that running an ASP.NET Core project directly within the Unity Editor or referencing ASP.NET Core libraries in Unity scripts is not feasible. However, you can establish communication between Unity and an ASP.NET Core backend through standard networking protocols.
So essentially, while Unity can talk to an ASP.NET Core backend, it can’t host one internally. That’s why I reimplemented the SSE server using EmbedIO, which works inside Unity.
I doubt we'd ship an official package with an EmbedIO dependency, but you should be able to leverage the SseResponseStreamTransport and StreamableHttpServerTransport to make an EmbedIO-based implementation easier. These are the types used by MapMcp to write SSE responses implement the SSE and Streamable HTTP transports respectively.
Is your feature request related to a problem? Please describe.
Yes. ASP.NET is currently incompatible with the Unity Editor, which prevents hosting an SSE (Server-Sent Events) server using this framework. This limitation makes it difficult to implement real-time communication features in Unity projects using ASP.NET.
Describe the solution you'd like
I’ve implemented an SSE server for Unity using ModelContextProtocol (MCP) with EmbedIO. You can check out the implementation here:
https://github.com/WHedlund/ModelContextProtocolUnityEmbedIO
I’d love to see something like this officially supported or incorporated into the main MCP repository.
Describe alternatives you've considered
I initially tried using ASP.NET-based approaches, but the lack of compatibility with the Unity Editor was a blocker. Other solutions either required external services or added unnecessary complexity.
Additional context
Feel free to adopt or improve on my implementation if it fits within the project’s goals!
The text was updated successfully, but these errors were encountered: