File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
examples/servers/simple-auth/mcp_simple_auth Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ class ServerSettings(BaseSettings):
35
35
model_config = SettingsConfigDict (env_prefix = "MCP_GITHUB_" )
36
36
37
37
# Server settings
38
- host : str = "0.0.0.0 "
38
+ host : str = "localhost "
39
39
port : int = 8000
40
40
server_url : AnyHttpUrl = AnyHttpUrl ("http://localhost:8000" )
41
41
@@ -196,7 +196,9 @@ async def exchange_authorization_code(
196
196
(
197
197
token
198
198
for token , data in self .tokens .items ()
199
- if token .startswith ("gho_" ) and data .client_id == client .client_id
199
+ # see https://github.blog/engineering/platform-security/behind-githubs-new-authentication-token-formats/
200
+ # which you get depends on your GH app setup.
201
+ if (token .startswith ("ghu_" ) or token .startswith ('gho_' )) and data .client_id == client .client_id
200
202
),
201
203
None ,
202
204
)
@@ -341,7 +343,7 @@ async def get_user_profile() -> dict[str, Any]:
341
343
342
344
@click .command ()
343
345
@click .option ("--port" , default = 8000 , help = "Port to listen on" )
344
- @click .option ("--host" , default = "0.0.0.0 " , help = "Host to bind to" )
346
+ @click .option ("--host" , default = "localhost " , help = "Host to bind to" )
345
347
def main (port : int , host : str ) -> int :
346
348
"""Run the simple GitHub MCP server."""
347
349
logging .basicConfig (level = logging .INFO )
You can’t perform that action at this time.
0 commit comments