Skip to content

Commit 314185c

Browse files
committed
fix: update default host from 127.0.0.1 to localhost
1 parent f4d4199 commit 314185c

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ cd your-project-name
6262
golf build dev
6363
golf run
6464
```
65-
This will start the FastMCP server, typically on `http://127.0.0.1:3000` (configurable in `golf.json`).
65+
This will start the FastMCP server, typically on `http://localhost:3000` (configurable in `golf.json`).
6666

6767
That's it! Your Golf server is running and ready for integration.
6868

@@ -133,7 +133,7 @@ The `golf.json` file is the heart of your Golf project configuration. Here's wha
133133
{
134134
"name": "{{project_name}}", // Your MCP server name (required)
135135
"description": "A Golf project", // Brief description of your server's purpose
136-
"host": "127.0.0.1", // Server host - use "0.0.0.0" to listen on all interfaces
136+
"host": "localhost", // Server host - use "0.0.0.0" to listen on all interfaces
137137
"port": 3000, // Server port - any available port number
138138
"transport": "sse", // Communication protocol:
139139
// - "sse": Server-Sent Events (recommended for web clients)
@@ -163,7 +163,7 @@ The `golf.json` file is the heart of your Golf project configuration. Here's wha
163163
- `"sse"` is ideal for web-based clients and real-time communication
164164
- `"streamable-http"` provides HTTP streaming for traditional API clients
165165
- `"stdio"` enables integration with command-line tools and scripts
166-
- **`host` & `port`**: Control where your server listens. Use `"127.0.0.1"` for local development or `"0.0.0.0"` to accept external connections.
166+
- **`host` & `port`**: Control where your server listens. Use `"localhost"` for local development or `"0.0.0.0"` to accept external connections.
167167
- **`stateless_http`**: When true, makes the streamable-http transport stateless by creating a new session for each request. This ensures that server restarts don't break existing client connections, making the server truly stateless.
168168
- **`health_check_enabled`**: When true, enables a health check endpoint for Kubernetes readiness/liveness probes and load balancers
169169
- **`health_check_path`**: Customizable path for the health check endpoint (defaults to "/health")

src/golf/commands/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def run_server(
5050
create_command_header("Starting Server", f"{settings.name}", console)
5151

5252
# Show server info with flashy styling
53-
server_host = host or settings.host or "127.0.0.1"
53+
server_host = host or settings.host or "localhost"
5454
server_port = port or settings.port or 3000
5555

5656
server_content = Text()

src/golf/core/builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ def _generate_server(self) -> None:
858858
" from rich.panel import Panel",
859859
" console = Console()",
860860
" # Get configuration from environment variables or use defaults",
861-
' host = os.environ.get("HOST", "127.0.0.1")',
861+
' host = os.environ.get("HOST", "localhost")',
862862
' port = int(os.environ.get("PORT", 3000))',
863863
f' transport_to_run = "{self.settings.transport}"',
864864
"",

src/golf/core/builder_auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
def generate_auth_code(
1414
server_name: str,
15-
host: str = "127.0.0.1",
15+
host: str = "localhost",
1616
port: int = 3000,
1717
https: bool = False,
1818
opentelemetry_enabled: bool = False,

src/golf/core/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class Settings(BaseSettings):
5454
output_dir: str = Field("build", description="Build artifact folder")
5555

5656
# Server settings
57-
host: str = Field("127.0.0.1", description="Server host")
57+
host: str = Field("localhost", description="Server host")
5858
port: int = Field(3000, description="Server port")
5959
transport: str = Field(
6060
"streamable-http",

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def sample_project(temp_dir: Path) -> Path:
2929
"""{
3030
"name": "TestProject",
3131
"description": "A test Golf project",
32-
"host": "127.0.0.1",
32+
"host": "localhost",
3333
"port": 3000,
3434
"transport": "sse"
3535
}"""

tests/core/test_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def test_loads_default_settings(self, temp_dir: Path) -> None:
6464
"""Test loading settings with defaults when no config exists."""
6565
settings = load_settings(temp_dir)
6666
assert settings.name == "GolfMCP Project"
67-
assert settings.host == "127.0.0.1"
67+
assert settings.host == "localhost"
6868
assert settings.port == 3000
6969
assert settings.transport == "streamable-http"
7070

0 commit comments

Comments
 (0)