-
Notifications
You must be signed in to change notification settings - Fork 526
HTTP Server, uvx, C# only custom tools #375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
msanatan
wants to merge
137
commits into
CoplayDev:main
Choose a base branch
from
msanatan:use-uvx
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+12,320
−18,704
Open
Changes from 125 commits
Commits
Show all changes
137 commits
Select commit
Hold shift + click to select a range
6856ac7
Remove temp folder from repo
msanatan 37eba8c
Ignore boot.config
msanatan 64d64fd
Remove buttons to download or rebuild the server
msanatan c830d56
Remove embedded MCP server in plugin
msanatan 85e9342
As much as possible, rip out logic that installs a server
msanatan d217e28
feat: migrate to uvx-based server configuration
msanatan 1314536
Cleanup the temp folders created by tests
msanatan 6f4badb
The test kept failing but the results looked correct, floating point …
msanatan fbee90b
Merge branch 'main' into use-uvx
msanatan 50902b9
feat: migrate from local server to uvx-based configuration
msanatan 08b3d18
refactor: use dynamic package version instead of hardcoded value
msanatan 014f8c7
Update CI so it only updates the Server folder
msanatan cad8c20
feat: implement uvx package source path resolution
msanatan fa54c5f
Merge branch 'main' into use-uvx
msanatan b4be068
refactor: replace Python tool syncing with custom tool registration s…
msanatan d38e246
feat: add HTTP transport support and cache management
msanatan f8e053e
refactor: simplify HTTP configuration to use URL-based approach
msanatan a16c9ec
refactor: standardize transport configuration with explicit --transpo…
msanatan 793f996
refactor: move MCP menu items under Window menu
msanatan fdb9859
feat: restructure config generation for HTTP transport mode
msanatan c181608
feat: add local HTTP server management with Git URL override
msanatan d1031b1
fix: remove automatic HTTP protocol prefix from URL field
msanatan a00e623
feat: implement proper MCP session lifecycle with HTTP transport
msanatan f875603
feat: implement JSON-RPC protocol for MCP tool execution
msanatan d0ec5e9
feat: improve text wrapping in editor window UI
msanatan 5d1522d
refactor: refresh git URL override from EditorPrefs on validation
msanatan baa61ce
fix: improve responsive layout for editor window settings
msanatan 77641da
refactor: improve thread safety in tool registration
msanatan f968c8f
refactor: replace MCP tool calls with direct HTTP endpoints for tool …
msanatan ce8625e
refactor: centralize HTTP endpoint URL management
msanatan 3bc01cf
refactor: simplify custom tools management with in-memory registry
msanatan ea75404
feat: add dynamic custom tool registration system
msanatan e9254c7
feat: add AutoRegister flag to control tool registration
msanatan 662656b
feat: add function signature generation for dynamic tools
msanatan cd88e86
refactor: remove unused custom tool registry endpoints
msanatan b270fc7
test: add transport configuration validation for MCP client tests
msanatan 696e79a
refactor: simplify uvx path resolution to use PATH by default
msanatan 8693f69
feat: use serverUrl property for Windsurf HTTP transport
msanatan 82e0bec
feat: ensure client configurations stay current on each setup
msanatan 996ca48
feat: add automatic migration for legacy embedded server configuration
msanatan 7dff066
feat: add automatic stdio config migration on package updates
msanatan a70dd3f
Centralize where editor prefs are defined
msanatan fd05458
Update custom tools docs
msanatan 54c7c85
refactor: consolidate server management UI into main editor window
msanatan a1d7128
Don't show error logs when custom tools are already registerd with th…
msanatan bd6479b
Only autoconnect to port 6400 if the user is using stdio for connections
msanatan 95c5265
Don't double register tools on startup
msanatan eafb8e8
feat: switch to HTTP transport as default connection method
msanatan db1ba22
Automatically bump the versions in the READMEs.
msanatan 11a7f52
docs: add HTTP transport configuration examples
msanatan 4928ade
feat: add WebSocket-based plugin hub for Unity connections
msanatan 8cbec21
refactor: consolidate Unity instance discovery with shared registry
msanatan 5fa98ce
Use websockets so that local and remote MCP servers can communicate w…
msanatan 7f48229
refactor: simplify port management and improve port field validation
msanatan 0ef8927
Launch the actual local webserver via the button
msanatan 1800863
Autoformat
msanatan 98ab375
Minor fixes so the server can start
msanatan dd20739
Make clear uvx button work
msanatan 9bb052c
Don't show a dialog after clearing cache/starting server successfully
msanatan fee77af
We no longer need a Python importer
msanatan e05e411
This folder has nothing in it
msanatan e2bd250
Cleanup whitespace
msanatan 10836d7
We no longer need this folder
msanatan e723071
refactor: move MCPForUnityBridge to StdioBridgeHost and reorganize tr…
msanatan 85cd5c0
Skip tools registration if the user is not connected to an HTTP server
msanatan ca81684
Fix VS Code configured status in UI
msanatan 700a7fa
Stop blocking the main thread when connecting via HTTP
msanatan 89863e5
Separate socket keep-alive interval from application keep-alive interval
msanatan e9b5ba7
Add a debug log line
msanatan b844463
Fix McpLog.Debug method, so it actually reads the checkbox value from…
msanatan ec78b5e
Add HTTP bridge auto-resume after domain reload
msanatan f93c80e
Add health verification after HTTP bridge auto-resume
msanatan aff31ff
Add name and path fields to code coverage settings
msanatan a84c2c2
Only register custom tools AFTER we established a healthy HTTP connec…
msanatan 4f22d54
Convert custom tool handlers to async functions
msanatan 2b98c2c
Correctly parse responses from Unity in the server so tools and resou…
msanatan 2311cf9
Make some clarifications for custom tools in docs
msanatan d5d738d
Use `async_send_with_unity_instance` instead of `send_with_unity_inst…
msanatan 8b4bcb6
Fix calls to async_send_with_unity_instance in manage_script
msanatan d6e2466
Rename async_send_with_unity_instance to send_with_unity_instance
msanatan 4afbab5
Fix clear uv cache command
msanatan cdbb7ed
Refactor HTTP server command generation into reusable method and disp…
msanatan 7b15b85
Ctrl/Cmd + Shift + M now toggles the window
msanatan 7d5982d
Fallback to a git URL that points to the main branch for the MCP git …
msanatan 43dae84
Add test setup/teardown to preserve and reset Git URL override Editor…
msanatan cc5bc0a
Update docs, scripts and GH workflows to use the new MCP server code …
msanatan dc791a8
Update plugin README
msanatan 09162b0
Convert integration tests to async/await pattern
msanatan b73e9cb
Update image with new UI
msanatan bad76cc
Remove unused HttpTransportClient client
msanatan b818682
Remove copyright notice
msanatan 643ba2e
Add a guide to all the changes made for this version
msanatan 1d7af89
Organize imports and remove redundant import statements
msanatan b6d5826
Minor edits
msanatan e490265
Fix stdio serializer to use the new type parameter like HTTP
msanatan 53cc232
Fix: Automatic bridge reconnection after domain reload without requir…
dsarno cc175f2
Make the server work in Docker
msanatan 44e7052
Cache project identity on initialization to avoid repeated computation
msanatan c56d794
Fix typos
msanatan 95e3de4
Merge pull request #2 from dsarno/fix/domain-reload-reconnection
msanatan edd3710
Add unity_instance_middleware to py-modules list in pyproject.toml
msanatan 0197ec5
Remove Foldout UI elements and simplify HTTP server command section
msanatan e57c0dc
Reduce height of HTTP command box
msanatan 30cd20f
Refresh HTTP server command display when Git URL override changes
msanatan 014b1f0
Make the box a bit smaller
msanatan 154b4ff
Split up main window into various components
msanatan aa63f21
Update the setup wizard to be a simple setup popup built with UI toolkit
msanatan 1a9bb00
Ensure that MCP configs are updated when users switch between HTTP an…
msanatan 9abd649
Detect Codex configuration when using HTTP or stdio configs
msanatan 0269278
Use Claude Code's list command to detect whether this MCP is configured
msanatan 9af504c
Fix and add tests for building configs
msanatan fd54f3f
Handle Unity reload gaps by retrying plugin session resolution
dsarno 01976a5
Add polling support for long-running tools with state persistence
msanatan 5d7418f
Polish domain reload resilience tests and docs
dsarno f917d94
Refactor Response helper to use strongly-typed classes instead of ano…
msanatan cd4529c
Rename Setup Wizard to Setup Window and improve UV detection on macOS…
msanatan a38d9c6
Update guide on what's changed in v8
msanatan e98498d
Update custom tool docs to use new response objects
msanatan 2c3268d
Merge remote-tracking branch 'dsarno/fix/domain-reload-retry' into fe…
msanatan 5396dff
Merge pull request #3 from msanatan/feature/domain-reload-resilience
msanatan 212f86a
Update image used in README
msanatan d05e2f6
Restructure backend
msanatan 7d0b869
Remove server_version.txt
msanatan 3dbb6b5
Feature/http instance routing (#5)
msanatan 4ffb699
Generate the session ID from the server
msanatan 28e7cfe
Force LLMs to choose a Unity instance when multiple are connected
msanatan 6271e25
Fix tests caused by changes in session management
msanatan 9d1c2f7
Whitespace update
msanatan 838144b
Exclude stale builds so users always get the latest version
msanatan aae1a3e
Set Pythonpath env var so Python looks at the src folder for modules
msanatan 8ae2bf0
Replace Optional type hints with modern union syntax (Type | None)
msanatan abb1250
Replace Dict type hints with modern dict syntax throughout codebase
msanatan 3ef7fae
Remove unused type imports across codebase
msanatan 8b8d239
Remove the old telemetry test
msanatan 465fab3
Clean up stupid imports
msanatan 5e8c4bd
Replace dict-based session data with Pydantic models for type safety
msanatan f6a4efa
Correctly call `ctx.info` with `await`
msanatan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,11 +67,19 @@ jobs: | |
| jq ".version = \"${NEW_VERSION}\"" MCPForUnity/package.json > MCPForUnity/package.json.tmp | ||
| mv MCPForUnity/package.json.tmp MCPForUnity/package.json | ||
|
|
||
| echo "Updating MCPForUnity/UnityMcpServer~/src/pyproject.toml to $NEW_VERSION" | ||
| sed -i '0,/^version = ".*"/s//version = "'"$NEW_VERSION"'"/' "MCPForUnity/UnityMcpServer~/src/pyproject.toml" | ||
| echo "Updating Server/pyproject.toml to $NEW_VERSION" | ||
| sed -i '0,/^version = ".*"/s//version = "'"$NEW_VERSION"'"/' "Server/pyproject.toml" | ||
|
|
||
| echo "Updating MCPForUnity/UnityMcpServer~/src/server_version.txt to $NEW_VERSION" | ||
| echo "$NEW_VERSION" > "MCPForUnity/UnityMcpServer~/src/server_version.txt" | ||
| echo "Updating README.md version references to v$NEW_VERSION" | ||
| sed -i 's|https://github.com/CoplayDev/unity-mcp.git?path=/MCPForUnity#v[0-9]\+\.[0-9]\+\.[0-9]\+|https://github.com/CoplayDev/unity-mcp.git?path=/MCPForUnity#v'"$NEW_VERSION"'|g' README.md | ||
| sed -i 's|git+https://github.com/CoplayDev/unity-mcp@v[0-9]\+\.[0-9]\+\.[0-9]\+#subdirectory=Server|git+https://github.com/CoplayDev/unity-mcp@v'"$NEW_VERSION"'#subdirectory=Server|g' README.md | ||
|
|
||
| echo "Updating README-zh.md version references to v$NEW_VERSION" | ||
| sed -i 's|https://github.com/CoplayDev/unity-mcp.git?path=/MCPForUnity#v[0-9]\+\.[0-9]\+\.[0-9]\+|https://github.com/CoplayDev/unity-mcp.git?path=/MCPForUnity#v'"$NEW_VERSION"'|g' README-zh.md | ||
| sed -i 's|git+https://github.com/CoplayDev/unity-mcp@v[0-9]\+\.[0-9]\+\.[0-9]\+#subdirectory=Server|git+https://github.com/CoplayDev/unity-mcp@v'"$NEW_VERSION"'#subdirectory=Server|g' README-zh.md | ||
|
|
||
| echo "Updating Server/README.md version references to v$NEW_VERSION" | ||
| sed -i 's|git+https://github.com/CoplayDev/unity-mcp@v[0-9]\+\.[0-9]\+\.[0-9]\+#subdirectory=Server|git+https://github.com/CoplayDev/unity-mcp@v'"$NEW_VERSION"'#subdirectory=Server|g' Server/README.md | ||
|
|
||
| - name: Commit and push changes | ||
| env: | ||
|
|
@@ -81,7 +89,7 @@ jobs: | |
| set -euo pipefail | ||
| git config user.name "GitHub Actions" | ||
| git config user.email "[email protected]" | ||
| git add MCPForUnity/package.json "MCPForUnity/UnityMcpServer~/src/pyproject.toml" "MCPForUnity/UnityMcpServer~/src/server_version.txt" | ||
| git add MCPForUnity/package.json "Server/pyproject.toml" README.md README-zh.md Server/README.md | ||
| if git diff --cached --quiet; then | ||
| echo "No version changes to commit." | ||
| else | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
MCPForUnity/Editor/Importers.meta → MCPForUnity/Editor/Constants.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| namespace MCPForUnity.Editor.Constants | ||
| { | ||
| /// <summary> | ||
| /// Centralized list of EditorPrefs keys used by the MCP for Unity package. | ||
| /// Keeping them in one place avoids typos and simplifies migrations. | ||
| /// </summary> | ||
| internal static class EditorPrefKeys | ||
| { | ||
| internal const string UseHttpTransport = "MCPForUnity.UseHttpTransport"; | ||
| internal const string DebugLogs = "MCPForUnity.DebugLogs"; | ||
| internal const string ValidationLevel = "MCPForUnity.ValidationLevel"; | ||
| internal const string UnitySocketPort = "MCPForUnity.UnitySocketPort"; | ||
| internal const string ResumeHttpAfterReload = "MCPForUnity.ResumeHttpAfterReload"; | ||
|
|
||
| internal const string UvxPathOverride = "MCPForUnity.UvxPath"; | ||
| internal const string ClaudeCliPathOverride = "MCPForUnity.ClaudeCliPath"; | ||
|
|
||
| internal const string HttpBaseUrl = "MCPForUnity.HttpUrl"; | ||
| internal const string WebSocketSessionId = "MCPForUnity.WebSocketSessionId"; | ||
| internal const string WebSocketUrlOverride = "MCPForUnity.WebSocketUrl"; | ||
| internal const string GitUrlOverride = "MCPForUnity.GitUrlOverride"; | ||
|
|
||
| internal const string ServerSrc = "MCPForUnity.ServerSrc"; | ||
| internal const string UseEmbeddedServer = "MCPForUnity.UseEmbeddedServer"; | ||
| internal const string LockCursorConfig = "MCPForUnity.LockCursorConfig"; | ||
| internal const string AutoRegisterEnabled = "MCPForUnity.AutoRegisterEnabled"; | ||
|
|
||
| internal const string SetupCompleted = "MCPForUnity.SetupCompleted"; | ||
| internal const string SetupDismissed = "MCPForUnity.SetupDismissed"; | ||
|
|
||
| internal const string CustomToolRegistrationEnabled = "MCPForUnity.CustomToolRegistrationEnabled"; | ||
|
|
||
| internal const string LastUpdateCheck = "MCPForUnity.LastUpdateCheck"; | ||
| internal const string LatestKnownVersion = "MCPForUnity.LatestKnownVersion"; | ||
| internal const string LastStdIoUpgradeVersion = "MCPForUnity.LastStdIoUpgradeVersion"; | ||
|
|
||
| internal const string TelemetryDisabled = "MCPForUnity.TelemetryDisabled"; | ||
| internal const string CustomerUuid = "MCPForUnity.CustomerUUID"; | ||
| } | ||
| } |
2 changes: 1 addition & 1 deletion
2
...r/Helpers/PackageLifecycleManager.cs.meta → ...y/Editor/Constants/EditorPrefKeys.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove duplicate conditional checks in MCP server installation.
Lines 62–65 are exact duplicates of lines 58–61. The second
elifforServer/pyproject.tomlcan never be reached if the first one matched, and the same applies torequirements.txt. This is a logic error introduced during refactoring.Apply this diff to remove the duplicate checks:
- name: Install MCP server run: | set -eux uv venv echo "VIRTUAL_ENV=$GITHUB_WORKSPACE/.venv" >> "$GITHUB_ENV" echo "$GITHUB_WORKSPACE/.venv/bin" >> "$GITHUB_PATH" if [ -f Server/pyproject.toml ]; then uv pip install -e Server elif [ -f Server/requirements.txt ]; then uv pip install -r Server/requirements.txt - elif [ -f Server/pyproject.toml ]; then - uv pip install -e Server - elif [ -f Server/requirements.txt ]; then - uv pip install -r Server/requirements.txt else echo "No MCP Python deps found (skipping)" fi📝 Committable suggestion
🤖 Prompt for AI Agents