Skip to content

Commit fd353c5

Browse files
committed
remove host param from example servers
1 parent 926745a commit fd353c5

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

examples/servers/simple-auth/mcp_simple_auth/auth_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,7 @@ async def run_server(server_settings: AuthServerSettings, github_settings: GitHu
196196

197197
@click.command()
198198
@click.option("--port", default=9000, help="Port to listen on")
199-
@click.option("--host", default="localhost", help="Host to bind to")
200-
def main(port: int, host: str) -> int:
199+
def main(port: int) -> int:
201200
"""
202201
Run the MCP Authorization Server.
203202
@@ -217,6 +216,7 @@ def main(port: int, host: str) -> int:
217216
raise ValueError("GitHub credentials not provided")
218217

219218
# Create server settings
219+
host = "localhost"
220220
server_url = f"http://{host}:{port}"
221221
server_settings = AuthServerSettings(
222222
host=host,

examples/servers/simple-auth/mcp_simple_auth/legacy_as_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,13 @@ async def get_user_profile() -> dict[str, Any]:
116116

117117
@click.command()
118118
@click.option("--port", default=8000, help="Port to listen on")
119-
@click.option("--host", default="localhost", help="Host to bind to")
120119
@click.option(
121120
"--transport",
122121
default="streamable-http",
123122
type=click.Choice(["sse", "streamable-http"]),
124123
help="Transport protocol to use ('sse' or 'streamable-http')",
125124
)
126-
def main(port: int, host: str, transport: Literal["sse", "streamable-http"]) -> int:
125+
def main(port: int, transport: Literal["sse", "streamable-http"]) -> int:
127126
"""Run the simple GitHub MCP server."""
128127
logging.basicConfig(level=logging.INFO)
129128

@@ -134,6 +133,7 @@ def main(port: int, host: str, transport: Literal["sse", "streamable-http"]) ->
134133
if not github_settings.github_client_id or not github_settings.github_client_secret:
135134
raise ValueError("GitHub credentials not provided")
136135
# Create server settings
136+
host = "localhost"
137137
server_url = f"http://{host}:{port}"
138138
server_settings = ServerSettings(
139139
host=host,

examples/servers/simple-auth/mcp_simple_auth/server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,14 @@ async def get_user_info() -> dict[str, Any]:
137137

138138
@click.command()
139139
@click.option("--port", default=8001, help="Port to listen on")
140-
@click.option("--host", default="localhost", help="Host to bind to")
141140
@click.option("--auth-server", default="http://localhost:9000", help="Authorization Server URL")
142141
@click.option(
143142
"--transport",
144143
default="streamable-http",
145144
type=click.Choice(["sse", "streamable-http"]),
146145
help="Transport protocol to use ('sse' or 'streamable-http')",
147146
)
148-
def main(port: int, host: str, auth_server: str, transport: Literal["sse", "streamable-http"]) -> int:
147+
def main(port: int, auth_server: str, transport: Literal["sse", "streamable-http"]) -> int:
149148
"""
150149
Run the MCP Resource Server.
151150
@@ -163,6 +162,7 @@ def main(port: int, host: str, auth_server: str, transport: Literal["sse", "stre
163162
auth_server_url = AnyHttpUrl(auth_server)
164163

165164
# Create settings
165+
host = "localhost"
166166
server_url = f"http://{host}:{port}"
167167
settings = ResourceServerSettings(
168168
host=host,

0 commit comments

Comments
 (0)