Skip to content

fix: use 127.0.0.1 instead of localhost for Revit host#30

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

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

Conversation

@chechulini

Copy link
Copy Markdown

What changed

REVIT_HOST in main.py was changed from "localhost" to "127.0.0.1".

Why

On some Windows environments, localhost resolves to ::1 (IPv6) rather than 127.0.0.1 (IPv4). The pyRevit Routes server binds exclusively to 127.0.0.1, so an IPv6 resolution causes the MCP server to fail to connect. Using the explicit IPv4 address ensures a reliable connection regardless of the system's hostname resolution behavior.

Reviewer notes

No logic changes — purely a hostname string fix. The BASE_URL already interpolates REVIT_HOST, so it now correctly produces http://127.0.0.1:48884/revit_mcp.

Some environments resolve localhost to ::1 (IPv6) rather than 127.0.0.1,
causing connection failures when pyRevit Routes binds only to 127.0.0.1.

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