diff --git a/src/mcp/cli/claude.py b/src/mcp/cli/claude.py index 1df71c1ae..fe3f3380a 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 @@ -17,6 +18,10 @@ 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( + 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 b807370a5..3e73b0204 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: