From 646b6477b3e0705b6c77e3158f628ad03df898f6 Mon Sep 17 00:00:00 2001 From: Mariusz Woloszyn Date: Wed, 12 Mar 2025 15:14:24 +0100 Subject: [PATCH 1/4] feat: add support for Linux configuration path in get_claude_config_path --- src/mcp/cli/claude.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mcp/cli/claude.py b/src/mcp/cli/claude.py index 1df71c1aea..2c5e16083a 100644 --- a/src/mcp/cli/claude.py +++ b/src/mcp/cli/claude.py @@ -17,6 +17,8 @@ def get_claude_config_path() -> Path | None: path = Path(Path.home(), "AppData", "Roaming", "Claude") elif sys.platform == "darwin": path = Path(Path.home(), "Library", "Application Support", "Claude") + elif sys.platform.startswith("linux"): + path = Path(Path.home(), ".config", "Claude") else: return None From b2372b03290817c66e5762ba936dde1a0051e612 Mon Sep 17 00:00:00 2001 From: Mariusz Woloszyn Date: Wed, 12 Mar 2025 17:02:33 +0100 Subject: [PATCH 2/4] On Linux use XDG_CONFIG_HOME environment variable and fall back to $HOME/.config --- src/mcp/cli/claude.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mcp/cli/claude.py b/src/mcp/cli/claude.py index 2c5e16083a..358190a70f 100644 --- a/src/mcp/cli/claude.py +++ b/src/mcp/cli/claude.py @@ -1,6 +1,7 @@ """Claude app integration utilities.""" import json +import os import sys from pathlib import Path @@ -18,7 +19,7 @@ def get_claude_config_path() -> Path | None: elif sys.platform == "darwin": path = Path(Path.home(), "Library", "Application Support", "Claude") elif sys.platform.startswith("linux"): - path = Path(Path.home(), ".config", "Claude") + path = Path(os.environ.get("XDG_CONFIG_HOME", Path.home() / ".config")) else: return None From d73cf9b8e8fe053397c86c8180634810a389fc21 Mon Sep 17 00:00:00 2001 From: Mariusz Woloszyn Date: Wed, 12 Mar 2025 17:05:00 +0100 Subject: [PATCH 3/4] update Linux config path to include 'Claude' directory --- src/mcp/cli/claude.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mcp/cli/claude.py b/src/mcp/cli/claude.py index 358190a70f..b42ba6046f 100644 --- a/src/mcp/cli/claude.py +++ b/src/mcp/cli/claude.py @@ -19,7 +19,7 @@ def get_claude_config_path() -> Path | None: elif sys.platform == "darwin": path = Path(Path.home(), "Library", "Application Support", "Claude") elif sys.platform.startswith("linux"): - path = Path(os.environ.get("XDG_CONFIG_HOME", Path.home() / ".config")) + path = Path(os.environ.get("XDG_CONFIG_HOME", Path.home() / ".config"), "Claude") else: return None From 9ec30122ef0444e9c8af57b575a23e4c0075ef8b Mon Sep 17 00:00:00 2001 From: David Soria Parra Date: Thu, 13 Mar 2025 11:43:14 +0000 Subject: [PATCH 4/4] fix: format --- src/mcp/cli/claude.py | 4 +++- src/mcp/client/websocket.py | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/mcp/cli/claude.py b/src/mcp/cli/claude.py index b42ba6046f..fe3f3380a4 100644 --- a/src/mcp/cli/claude.py +++ b/src/mcp/cli/claude.py @@ -19,7 +19,9 @@ def get_claude_config_path() -> Path | None: elif sys.platform == "darwin": path = Path(Path.home(), "Library", "Application Support", "Claude") elif sys.platform.startswith("linux"): - path = Path(os.environ.get("XDG_CONFIG_HOME", Path.home() / ".config"), "Claude") + path = Path( + os.environ.get("XDG_CONFIG_HOME", Path.home() / ".config"), "Claude" + ) else: return None diff --git a/src/mcp/client/websocket.py b/src/mcp/client/websocket.py index b807370a54..3e73b02048 100644 --- a/src/mcp/client/websocket.py +++ b/src/mcp/client/websocket.py @@ -15,7 +15,9 @@ @asynccontextmanager -async def websocket_client(url: str) -> AsyncGenerator[ +async def websocket_client( + url: str, +) -> AsyncGenerator[ tuple[ MemoryObjectReceiveStream[types.JSONRPCMessage | Exception], MemoryObjectSendStream[types.JSONRPCMessage], @@ -59,7 +61,7 @@ async def ws_reader(): async def ws_writer(): """ - Reads JSON-RPC messages from write_stream_reader and + Reads JSON-RPC messages from write_stream_reader and sends them to the server. """ async with write_stream_reader: