mirror of
https://github.com/aljazceru/mcp-python-sdk.git
synced 2025-12-19 14:54:24 +01:00
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 <davidsp@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
"""Claude app integration utilities."""
|
"""Claude app integration utilities."""
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
@@ -17,6 +18,10 @@ def get_claude_config_path() -> Path | None:
|
|||||||
path = Path(Path.home(), "AppData", "Roaming", "Claude")
|
path = Path(Path.home(), "AppData", "Roaming", "Claude")
|
||||||
elif sys.platform == "darwin":
|
elif sys.platform == "darwin":
|
||||||
path = Path(Path.home(), "Library", "Application Support", "Claude")
|
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:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,9 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
@asynccontextmanager
|
@asynccontextmanager
|
||||||
async def websocket_client(url: str) -> AsyncGenerator[
|
async def websocket_client(
|
||||||
|
url: str,
|
||||||
|
) -> AsyncGenerator[
|
||||||
tuple[
|
tuple[
|
||||||
MemoryObjectReceiveStream[types.JSONRPCMessage | Exception],
|
MemoryObjectReceiveStream[types.JSONRPCMessage | Exception],
|
||||||
MemoryObjectSendStream[types.JSONRPCMessage],
|
MemoryObjectSendStream[types.JSONRPCMessage],
|
||||||
|
|||||||
Reference in New Issue
Block a user