GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - WHedlund/ModelContextProtocolUnityEmbedIO: An implementation of a SSE server in EmbedIO that can be run within unity, unity editor, unity editor (in play mode)

This repository was archived by the owner on Mar 30, 2026. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

13 Commits
13 Commits

Folders and files

NameName
Last commit message
Last commit date
ModelContextProtocol/EmbedIO
ModelContextProtocol/EmbedIO
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 

Repository files navigation

Deprecated. use https://github.com/WHedlund/csharp-sdk instead

Unity EmbedIO Extensions for the MCP C# SDK

Unstable: This package tracks the evolving Model Context Protocol (MCP) and is subject to breaking changes as the MCP package updates.

About

This package enables Unity projects to run a fully functional Model Context Protocol (MCP) server using EmbedIO as a lightweight HTTP server. It is designed specifically for Unity, since ASP.NET Core is not fully compatible with the Unity runtime (Mono).

Key features:

  • Native Unity integration for MCP servers.
  • Uses EmbedIO for lightweight HTTP/SSE transport.
  • Runs the HTTP server in a separate thread to avoid blocking the Unity main thread.
  • A MainThreadDispatcher may be added for safe Unity object interaction.
  • Automatic tool discovery: Finds tools on the same GameObject (see EchoToolWithInstance).
  • Updated to match latest MCP type/name changes.

This is a community-driven project and not officially maintained by the MCP core team.


🚀 Installation & Getting Started

1. Add This Package to Your Unity Project

Simply clone or copy this repository into your project’s Assets folder.

Assets/
└── ModelContextProtocol/
    └── EmbedIO/
        ... (all scripts here)

2. Install Dependencies

Use NuGet for Unity to install the required packages:

  • EmbedIO 3.5.2
  • ModelContextProtocol 0.1.0-preview.10

Enable "Show Prerelease Packages" in NuGet for Unity’s settings to find the correct MCP version.


3. Add Components to Your Scene

  1. Create a new GameObject in your Unity scene.
  2. Attach both EmbedIOServerHost and EchoToolWithInstance scripts to this GameObject.

When you press Play, the MCP server starts automatically (in a background thread) and is available at:

http://localhost:8888/api/sse

You can test your server using the MCP Inspector tool from MCP[cli].

To add more tools, just add additional tool scripts as components on the same GameObject for automatic discovery!


🧩 Usage & Examples

Tools are automatically discovered when added as components to the same GameObject as the server host.
Here’s an example of an instance tool using MonoBehaviour:

using UnityEngine;
using ModelContextProtocol.Tools;

public class EchoToolWithInstance : MonoBehaviour
{
    [McpServerTool(Description = "Echoes the input message (instance)")]
    public string Echo(string message)
    {
        return $"Echo: {message}";
    }
}
  • Attach your tool script (like EchoToolWithInstance) to the same GameObject as EmbedIOServerHost.
  • All [McpServerTool] methods will be registered and available to MCP clients.
  • You can test tool calls using MCP Inspector or any MCP-compatible client.

🔗 Related Projects & Links

  • ModelContextProtocol C# SDK (NuGet)
  • ModelContextProtocol.AspNetCore (reference)
  • Official Model Context Protocol Specification
  • MCP Inspector (Python SDK/CLI tool)

About

An implementation of a SSE server in EmbedIO that can be run within unity, unity editor, unity editor (in play mode)

Resources

Readme
Activity

Stars

3 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.