add transport_security: allow 192.168.1.2 + localhost for LAN access
This commit is contained in:
1 parent
42b84909e7
commit
73eb016863
1 file changed
+5
@@ -5,6 +5,7 @@ from contextlib import asynccontextmanager
|
||||
from typing import Any
|
||||
|
||||
from mcp.server.fastmcp import FastMCP
|
||||
from mcp.server.transport_security import TransportSecuritySettings
|
||||
from starlette.requests import Request
|
||||
from starlette.responses import JSONResponse
|
||||
|
||||
@@ -160,6 +161,10 @@ mcp = FastMCP(
|
||||
lifespan=app_lifespan,
|
||||
stateless_http=True,
|
||||
json_response=True,
|
||||
transport_security=TransportSecuritySettings(
|
||||
enable_dns_rebinding_protection=True,
|
||||
allowed_hosts=["192.168.1.2:*", "localhost:*", "127.0.0.1:*", "[::1]:*"],
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user