Skip to content

fix: use 127.0.0.1 instead of localhost for REVIT_HOST#35

Open
grebyonkin wants to merge 1 commit into
mcp-servers-for-revit:masterfrom
grebyonkin:fix/revit-host-use-127-0-0-1
Open

fix: use 127.0.0.1 instead of localhost for REVIT_HOST#35
grebyonkin wants to merge 1 commit into
mcp-servers-for-revit:masterfrom
grebyonkin:fix/revit-host-use-127-0-0-1

Conversation

@grebyonkin

Copy link
Copy Markdown

Summary

  • Changed REVIT_HOST from "localhost" to "127.0.0.1" in main.py

Why

On Windows, localhost can resolve to the IPv6 loopback address (::1) depending on the system's hosts file or DNS resolver configuration. pyRevit Routes binds exclusively to the IPv4 address 127.0.0.1:48884, so any client using the hostname localhost that resolves to ::1 will fail to connect with a connection refused error.

Using the explicit IPv4 address 127.0.0.1 ensures the HTTP client always targets the correct interface regardless of the local DNS/hosts configuration.

Test plan

  • Start Revit with pyRevit Routes enabled (port 48884)
  • Run main.py and call any tool (e.g. get_revit_status)
  • Confirm connection succeeds on a system where localhost resolves to ::1

🤖 Generated with Claude Code

On some Windows setups, 'localhost' resolves to IPv6 (::1) rather than
127.0.0.1, causing connection failures when pyRevit Routes binds only to
the IPv4 loopback address (127.0.0.1:48884). Using the explicit IP
address ensures the HTTP client always targets the correct interface.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant