Registry / llm-agents / mcpforunityserver

mcpforunityserver

JSON →
library9.7.3pypypiunverified

MCP for Unity Server is a Python library that provides the server-side implementation for the Model Context Protocol (MCP), enabling seamless integration and communication with Unity clients. It facilitates real-time data exchange and command execution between Python applications and the Unity Editor. The current version is 9.6.6, and it sees regular updates, often with significant architectural changes between major versions.

pip install mcpforunityserver
INSTALL
IMPORT
SIG · MCPFORUNITYSERVER
M
mcpforunityserver
llm-agentspythonv9.7.3
Install
12.1s avg
Import
Disk
119MB
Pass rate
8/ 10
Env Coverage8 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v9.7.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 13.68s
py 3.11
✓ —
✓ 13.2s
py 3.12
✓ —
✓ 10.63s
py 3.13
✓ —
✓ 10.73s
py 3.9
✕ build_error
✕ build_error
119MB installed
● package 119MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

FastMCP
from mcpforunityserver.main import FastMCP
from mcpforunityserver.main import FastMCP
ApiKeyService
from mcpforunityserver.main import ApiKeyService
UnityConnectionPool
from mcpforunityserver.main import UnityConnectionPool

This quickstart demonstrates how to initialize and start an MCP server, setting up basic connection and disconnection event handlers. The server listens on port 25001 and remains active indefinitely.

import asyncio from mcpforunityserver import Server async def main(): server = Server( port=25001, server_name='MyUnityServer', server_version='1.0.0' ) @server.on_connect async def handle_connect(client): print(f'Client connected: {client.id}') @server.on_disconnect async def handle_disconnect(client): print(f'Client disconnected: {client.id}') await server.start() print(f'MCP Server started on port {server.port}') # Keep the server running indefinitely while True: await asyncio.sleep(3600) # Sleep for an hour if __name__ == '__main__': asyncio.run(main())
Debug
Known issues
breakingThe constructor signatures for `Server` and `UnityClient` classes, along with their associated parameters, underwent significant changes. Additionally, the `message_id` field was removed from all message types.
fix
Review the latest documentation or source code for `Server` and `UnityClient` constructors. Update parameter names and types. Remove any reliance on `message_id` from message processing logic.
affects: >=9.0.0
breakingThe library's callback system was refactored to be exclusively asynchronous. All event handlers and callbacks must now be defined as `async def` functions and awaited if they perform asynchronous operations.
fix
Migrate all existing synchronous callback functions to `async def` functions. Ensure that any calls to these callbacks are properly `await`ed where applicable.
affects: >=8.0.0
gotchaKey types and core classes (e.g., `UnityClient`, `ServerConfig`, `Message`) were moved from the top-level `mcpforunityserver` package directly into the `mcpforunityserver.types` submodule for better organization.
fix
Update import statements from `from mcpforunityserver import MyType` to `from mcpforunityserver.types import MyType` for all affected symbols.
affects: >=9.6.0
Upgrade
Version history
9.7.3latest on PyPI · released Jun 15, 2026
Audit
Dependencies
aiohttprequiredCore dependency for asynchronous HTTP client/server communication.
websocketsrequiredCore dependency for WebSocket communication with Unity clients.
uvloopoptionalOptional dependency for performance improvement with asyncio event loop.
Agent activity
29 hits · last 30 days
node
28
OpenAI (training)
1
Resources
mcpforunityserver — pip install mcpforunityserver · libregistry