diff --git a/cognee-mcp/src/server.py b/cognee-mcp/src/server.py index 33cd26cb1..cc6eac09e 100755 --- a/cognee-mcp/src/server.py +++ b/cognee-mcp/src/server.py @@ -42,23 +42,14 @@ mcp = FastMCP("Cognee") logger = get_logger() -cors_middleware = Middleware( - CORSMiddleware, - allow_origins=["*"], - allow_credentials=True, - allow_methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"], - allow_headers=["*"], -) - - async def run_sse_with_cors(): """Custom SSE transport with CORS middleware.""" sse_app = mcp.sse_app() sse_app.add_middleware( CORSMiddleware, - allow_origins=["*"], + allow_origins=["http://localhost:3000"], allow_credentials=True, - allow_methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"], + allow_methods=["GET"], allow_headers=["*"], ) @@ -77,9 +68,9 @@ async def run_http_with_cors(): http_app = mcp.streamable_http_app() http_app.add_middleware( CORSMiddleware, - allow_origins=["*"], + allow_origins=["http://localhost:3000"], allow_credentials=True, - allow_methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"], + allow_methods=["GET"], allow_headers=["*"], ) diff --git a/cognee/cli/_cognee.py b/cognee/cli/_cognee.py index 7f2b06c89..b68e5c80f 100644 --- a/cognee/cli/_cognee.py +++ b/cognee/cli/_cognee.py @@ -220,7 +220,7 @@ def main() -> int: if server_process: fmt.success("UI server started successfully!") - fmt.echo("The interface is available at: http://localhost:3000") + fmt.echo(f"The interface is available at: http://localhost:{frontend_port}") if start_backend: fmt.echo(f"The API backend is available at: http://localhost:{backend_port}") if start_mcp: