From 52d38709691c6b4313ce30f36cfc3b237fa9a819 Mon Sep 17 00:00:00 2001 From: Daulet Amirkhanov Date: Thu, 25 Sep 2025 22:09:18 +0100 Subject: [PATCH 1/3] fix: update cognee-mcp script alias and Dockerfile entrypoint --- cognee-mcp/entrypoint.sh | 18 +++++++++--------- cognee-mcp/pyproject.toml | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cognee-mcp/entrypoint.sh b/cognee-mcp/entrypoint.sh index 53da83c11..e3ff849e0 100644 --- a/cognee-mcp/entrypoint.sh +++ b/cognee-mcp/entrypoint.sh @@ -48,27 +48,27 @@ if [ "$ENVIRONMENT" = "dev" ] || [ "$ENVIRONMENT" = "local" ]; then if [ "$DEBUG" = "true" ]; then echo "Waiting for the debugger to attach..." if [ "$TRANSPORT_MODE" = "sse" ]; then - exec python -m debugpy --wait-for-client --listen 0.0.0.0:$DEBUG_PORT -m cognee --transport sse --host 0.0.0.0 --port $HTTP_PORT --no-migration + exec python -m debugpy --wait-for-client --listen 0.0.0.0:$DEBUG_PORT -m cognee-mcp --transport sse --host 0.0.0.0 --port $HTTP_PORT --no-migration elif [ "$TRANSPORT_MODE" = "http" ]; then - exec python -m debugpy --wait-for-client --listen 0.0.0.0:$DEBUG_PORT -m cognee --transport http --host 0.0.0.0 --port $HTTP_PORT --no-migration + exec python -m debugpy --wait-for-client --listen 0.0.0.0:$DEBUG_PORT -m cognee-mcp --transport http --host 0.0.0.0 --port $HTTP_PORT --no-migration else - exec python -m debugpy --wait-for-client --listen 0.0.0.0:$DEBUG_PORT -m cognee --transport stdio --no-migration + exec python -m debugpy --wait-for-client --listen 0.0.0.0:$DEBUG_PORT -m cognee-mcp --transport stdio --no-migration fi else if [ "$TRANSPORT_MODE" = "sse" ]; then - exec cognee --transport sse --host 0.0.0.0 --port $HTTP_PORT --no-migration + exec cognee-mcp --transport sse --host 0.0.0.0 --port $HTTP_PORT --no-migration elif [ "$TRANSPORT_MODE" = "http" ]; then - exec cognee --transport http --host 0.0.0.0 --port $HTTP_PORT --no-migration + exec cognee-mcp --transport http --host 0.0.0.0 --port $HTTP_PORT --no-migration else - exec cognee --transport stdio --no-migration + exec cognee-mcp --transport stdio --no-migration fi fi else if [ "$TRANSPORT_MODE" = "sse" ]; then - exec cognee --transport sse --host 0.0.0.0 --port $HTTP_PORT --no-migration + exec cognee-mcp --transport sse --host 0.0.0.0 --port $HTTP_PORT --no-migration elif [ "$TRANSPORT_MODE" = "http" ]; then - exec cognee --transport http --host 0.0.0.0 --port $HTTP_PORT --no-migration + exec cognee-mcp --transport http --host 0.0.0.0 --port $HTTP_PORT --no-migration else - exec cognee --transport stdio --no-migration + exec cognee-mcp --transport stdio --no-migration fi fi diff --git a/cognee-mcp/pyproject.toml b/cognee-mcp/pyproject.toml index 8d9373bc9..e1a3a092c 100644 --- a/cognee-mcp/pyproject.toml +++ b/cognee-mcp/pyproject.toml @@ -36,4 +36,4 @@ dev = [ allow-direct-references = true [project.scripts] -cognee = "src:main" +cognee-mcp = "src:main" From aaa9a750d3ee8f1825f04764d74bc0b34ae6c31a Mon Sep 17 00:00:00 2001 From: Daulet Amirkhanov Date: Fri, 26 Sep 2025 15:13:41 +0100 Subject: [PATCH 2/3] refactor: keep "cognee" and "cognee-mcp", add deprecation warning for 'cognee' command --- cognee-mcp/pyproject.toml | 3 ++- cognee-mcp/src/__init__.py | 21 ++++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/cognee-mcp/pyproject.toml b/cognee-mcp/pyproject.toml index e1a3a092c..5c92deac8 100644 --- a/cognee-mcp/pyproject.toml +++ b/cognee-mcp/pyproject.toml @@ -36,4 +36,5 @@ dev = [ allow-direct-references = true [project.scripts] -cognee-mcp = "src:main" +cognee = "src:main" +cognee-mcp = "src:main_mcp" diff --git a/cognee-mcp/src/__init__.py b/cognee-mcp/src/__init__.py index 1939efe9f..32a291cfb 100644 --- a/cognee-mcp/src/__init__.py +++ b/cognee-mcp/src/__init__.py @@ -1,8 +1,27 @@ from .server import main as server_main +import warnings def main(): - """Main entry point for the package.""" + """Deprecated main entry point for the package.""" import asyncio + + # Show deprecation warning + warnings.warn( + "The 'cognee' command for cognee-mcp is deprecated and will be removed in a future version. " + "Please use 'cognee-mcp' instead to avoid conflicts with the main cognee library.", + DeprecationWarning, + stacklevel=2 + ) + + print("⚠️ DEPRECATION WARNING: Use 'cognee-mcp' command instead of 'cognee'") + print(" This avoids conflicts with the main cognee library.") + print() asyncio.run(server_main()) + + +def main_mcp(): + """Clean main entry point for cognee-mcp command.""" + import asyncio + asyncio.run(server_main()) From d50455a1e6fd3395f5a11309fd63d9c24684ac0d Mon Sep 17 00:00:00 2001 From: Daulet Amirkhanov Date: Fri, 26 Sep 2025 15:14:47 +0100 Subject: [PATCH 3/3] ruff format --- cognee-mcp/src/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cognee-mcp/src/__init__.py b/cognee-mcp/src/__init__.py index 32a291cfb..c71afdd1b 100644 --- a/cognee-mcp/src/__init__.py +++ b/cognee-mcp/src/__init__.py @@ -5,15 +5,15 @@ import warnings def main(): """Deprecated main entry point for the package.""" import asyncio - + # Show deprecation warning warnings.warn( "The 'cognee' command for cognee-mcp is deprecated and will be removed in a future version. " "Please use 'cognee-mcp' instead to avoid conflicts with the main cognee library.", DeprecationWarning, - stacklevel=2 + stacklevel=2, ) - + print("⚠️ DEPRECATION WARNING: Use 'cognee-mcp' command instead of 'cognee'") print(" This avoids conflicts with the main cognee library.") print() @@ -24,4 +24,5 @@ def main(): def main_mcp(): """Clean main entry point for cognee-mcp command.""" import asyncio + asyncio.run(server_main())