-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat: Allow remote connection to blender #115
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughA new configuration option was added to allow the Blender MCP server to bind to all network interfaces, controlled by a checkbox in the UI. The server host can now be set via an environment variable for remote access. Documentation was updated to explain remote connection setup. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant BlenderAddon
participant BlenderMCPServer
participant RemoteClient
User->>BlenderAddon: Enable "All interfaces" option
User->>BlenderAddon: Start server
BlenderAddon->>BlenderMCPServer: Start(host='0.0.0.0' or 'localhost')
RemoteClient->>BlenderMCPServer: Connect using BLENDER_SERVER_HOST
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
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.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
addon.py (1)
424-430: 🛠️ Refactor suggestionConsider security implications of binding to all interfaces.
The logic correctly sets the host based on the checkbox state. However, binding to all interfaces (0.0.0.0) has security implications.
While the implementation is correct, consider adding a warning or documentation about the security implications of binding to all interfaces. When the server binds to 0.0.0.0, it becomes accessible from any network interface, potentially exposing the Blender instance to unauthorized access from the network.
Consider adding a tooltip warning to the checkbox:
bpy.types.Scene.blendermcp_host_all_interfaces = bpy.props.BoolProperty( name="All interfaces", - description="Serve on all interfaces to allow remote connection", + description="Serve on all interfaces to allow remote connection (WARNING: This exposes Blender to network access)", default=False )
🧹 Nitpick comments (1)
README.md (1)
128-133: Fix grammar and improve clarity.The documentation clearly explains the remote connection setup, but there's a grammatical issue that should be addressed.
Apply this diff to improve the grammar:
-If connecting to blender on a remote machine pass the host name to the blender mcp server using the environmental variable BLENDER_SERVER_HOST. +If connecting to Blender on a remote machine, pass the host name to the Blender MCP server using the environment variable BLENDER_SERVER_HOST.This change:
- Adds a missing comma after "remote machine"
- Capitalizes "Blender" consistently
- Uses "environment variable" instead of "environmental variable" (more precise terminology)
🧰 Tools
🪛 LanguageTool
[uncategorized] ~130-~130: A comma might be missing here.
Context: ...s If connecting to blender on a remote machine pass the host name to the blender mcp s...(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
README.md(1 hunks)addon.py(4 hunks)src/blender_mcp/server.py(2 hunks)
🧰 Additional context used
🪛 LanguageTool
README.md
[uncategorized] ~130-~130: A comma might be missing here.
Context: ...s If connecting to blender on a remote machine pass the host name to the blender mcp s...
(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
🔇 Additional comments (5)
src/blender_mcp/server.py (2)
20-21: LGTM! Clean environment variable configuration.The implementation correctly uses an environment variable to make the Blender host configurable while providing a sensible default of "localhost". This enables remote connections as intended.
231-231: LGTM! Proper usage of configurable host.The BlenderConnection instantiation correctly uses the module-level variables, making the connection configurable via the environment variable.
addon.py (3)
389-389: LGTM! UI addition follows Blender conventions.The checkbox addition to the UI panel is well-integrated and follows Blender's property display patterns.
466-470: LGTM! Property registration follows best practices.The new boolean property is properly registered with appropriate name, description, and default value.
🧰 Tools
🪛 Ruff (0.11.9)
466-466: Do not use bare
except(E722)
1525-1525: LGTM! Proper cleanup in unregister function.The property is correctly cleaned up in the unregister function, following Blender addon best practices.
User description
This change allows connection to blender on a remote machine in the cases where your MCP server is not running on the same machine as blender.
This changes adds:
PR Type
Enhancement, Documentation
Description
Added support for remote Blender connections via server host configuration
Updated documentation for remote access setup
Changes walkthrough 📝
addon.py
Add UI and logic for remote server binding optionaddon.py
binding
server.py
Support configurable Blender host via environment variablesrc/blender_mcp/server.py
Blender host
README.md
Document remote Blender access configurationREADME.md
Summary by CodeRabbit