Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Linux configuration path in get_claude_config_path #270

Merged
merged 7 commits into from
Mar 13, 2025
5 changes: 5 additions & 0 deletions src/mcp/cli/claude.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Claude app integration utilities."""

import json
import os
import sys
from pathlib import Path

Expand All @@ -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

Expand Down
6 changes: 4 additions & 2 deletions src/mcp/client/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down Expand Up @@ -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:
Expand Down