Skip to content

Commit 5c9f688

Browse files
emsidsp-ant
andauthored
Add support for Linux configuration path in get_claude_config_path (#270)
* feat: add support for Linux configuration path in get_claude_config_path * On Linux use XDG_CONFIG_HOME environment variable and fall back to $HOME/.config * update Linux config path to include 'Claude' directory * fix: format --------- Co-authored-by: David Soria Parra <[email protected]>
1 parent 94d326d commit 5c9f688

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/mcp/cli/claude.py

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Claude app integration utilities."""
22

33
import json
4+
import os
45
import sys
56
from pathlib import Path
67

@@ -17,6 +18,10 @@ def get_claude_config_path() -> Path | None:
1718
path = Path(Path.home(), "AppData", "Roaming", "Claude")
1819
elif sys.platform == "darwin":
1920
path = Path(Path.home(), "Library", "Application Support", "Claude")
21+
elif sys.platform.startswith("linux"):
22+
path = Path(
23+
os.environ.get("XDG_CONFIG_HOME", Path.home() / ".config"), "Claude"
24+
)
2025
else:
2126
return None
2227

src/mcp/client/websocket.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515

1616

1717
@asynccontextmanager
18-
async def websocket_client(url: str) -> AsyncGenerator[
18+
async def websocket_client(
19+
url: str,
20+
) -> AsyncGenerator[
1921
tuple[
2022
MemoryObjectReceiveStream[types.JSONRPCMessage | Exception],
2123
MemoryObjectSendStream[types.JSONRPCMessage],
@@ -59,7 +61,7 @@ async def ws_reader():
5961

6062
async def ws_writer():
6163
"""
62-
Reads JSON-RPC messages from write_stream_reader and
64+
Reads JSON-RPC messages from write_stream_reader and
6365
sends them to the server.
6466
"""
6567
async with write_stream_reader:

0 commit comments

Comments
 (0)