@@ -84,8 +84,7 @@ def stateless_http_server_url(stateless_http_server_port: int) -> str:
8484def make_fastmcp_app ():
8585 """Create a FastMCP server without auth settings."""
8686 transport_security = TransportSecuritySettings (
87- allowed_hosts = ["127.0.0.1:*" , "localhost:*" ],
88- allowed_origins = ["http://127.0.0.1:*" , "http://localhost:*" ]
87+ allowed_hosts = ["127.0.0.1:*" , "localhost:*" ], allowed_origins = ["http://127.0.0.1:*" , "http://localhost:*" ]
8988 )
9089 mcp = FastMCP (name = "NoAuthServer" , transport_security = transport_security )
9190
@@ -101,10 +100,9 @@ def echo(message: str) -> str:
101100
102101
103102def make_everything_fastmcp () -> FastMCP :
104- """Create a FastMCP server with all features enabled for testing."""
103+ """Create a FastMCP server with all features enabled for testing."""
105104 transport_security = TransportSecuritySettings (
106- allowed_hosts = ["127.0.0.1:*" , "localhost:*" ],
107- allowed_origins = ["http://127.0.0.1:*" , "http://localhost:*" ]
105+ allowed_hosts = ["127.0.0.1:*" , "localhost:*" ], allowed_origins = ["http://127.0.0.1:*" , "http://localhost:*" ]
108106 )
109107 mcp = FastMCP (name = "EverythingServer" , transport_security = transport_security )
110108
@@ -237,10 +235,9 @@ def make_everything_fastmcp_app():
237235
238236
239237def make_fastmcp_streamable_http_app ():
240- """Create a FastMCP server with StreamableHTTP transport."""
238+ """Create a FastMCP server with StreamableHTTP transport."""
241239 transport_security = TransportSecuritySettings (
242- allowed_hosts = ["127.0.0.1:*" , "localhost:*" ],
243- allowed_origins = ["http://127.0.0.1:*" , "http://localhost:*" ]
240+ allowed_hosts = ["127.0.0.1:*" , "localhost:*" ], allowed_origins = ["http://127.0.0.1:*" , "http://localhost:*" ]
244241 )
245242 mcp = FastMCP (name = "NoAuthServer" , transport_security = transport_security )
246243
@@ -266,16 +263,11 @@ def make_everything_fastmcp_streamable_http_app():
266263
267264
268265def make_fastmcp_stateless_http_app ():
269- """Create a FastMCP server with stateless StreamableHTTP transport."""
266+ """Create a FastMCP server with stateless StreamableHTTP transport."""
270267 transport_security = TransportSecuritySettings (
271- allowed_hosts = ["127.0.0.1:*" , "localhost:*" ],
272- allowed_origins = ["http://127.0.0.1:*" , "http://localhost:*" ]
273- )
274- mcp = FastMCP (
275- name = "StatelessServer" ,
276- stateless_http = True ,
277- transport_security = transport_security
268+ allowed_hosts = ["127.0.0.1:*" , "localhost:*" ], allowed_origins = ["http://127.0.0.1:*" , "http://localhost:*" ]
278269 )
270+ mcp = FastMCP (name = "StatelessServer" , stateless_http = True , transport_security = transport_security )
279271
280272 # Add a simple tool
281273 @mcp .tool (description = "A simple echo tool" )
0 commit comments