diff --git a/docs/howto/mcp-setup.md b/docs/howto/mcp-setup.md index 24927c8..d1440bc 100644 --- a/docs/howto/mcp-setup.md +++ b/docs/howto/mcp-setup.md @@ -12,7 +12,14 @@ Once configured, Claude Desktop and the `claude` CLI can perform CRUD operations ## Claude Desktop configuration -Add the following to `claude_desktop_config.json`: +`claude_desktop_config.json` is located at: + +| OS | Path | +|---|---| +| macOS | `~/Library/Application Support/Claude/claude_desktop_config.json` | +| Windows | `%APPDATA%\Claude\claude_desktop_config.json` | + +### macOS / Linux (native) ```json { @@ -38,6 +45,48 @@ Add the following to `claude_desktop_config.json`: Replace `/path/to/nene2-python` with the absolute path to this repository. +### Windows + WSL2 + +Claude Desktop runs on Windows but the project lives inside WSL2. +Use `wsl` as the command to bridge them: + +```json +{ + "mcpServers": { + "nene2-example": { + "command": "wsl", + "args": [ + "-e", "bash", "-c", + "cd /home//nene2-python && PYTHONPATH=src uv run python -m example.mcp" + ], + "env": { + "DB_ADAPTER": "sqlite", + "DB_NAME": "/home//nene2-python/data/nene2.db" + } + } + } +} +``` + +> All paths must be **WSL Linux paths** (e.g. `/home/user/...`), not Windows paths. +> The `DB_NAME` must also be a Linux path so SQLite creates the file inside WSL. + +For a project installed via `uv add git+...` (not the nene2-python repo itself): + +```json +{ + "mcpServers": { + "myapp": { + "command": "wsl", + "args": [ + "-e", "bash", "-c", + "cd /home//my-project && PYTHONPATH=src uv run python -m mcp_server" + ] + } + } +} +``` + ## Available tools | Tool | Description | diff --git a/docs/ja/howto/mcp-setup.md b/docs/ja/howto/mcp-setup.md index bfa8797..a77875c 100644 --- a/docs/ja/howto/mcp-setup.md +++ b/docs/ja/howto/mcp-setup.md @@ -12,7 +12,14 @@ Claude Desktop や `claude` CLI から直接 CRUD 操作が可能になります ## Claude Desktop への設定 -`claude_desktop_config.json` に以下を追加します: +`claude_desktop_config.json` のパス: + +| OS | パス | +|---|---| +| macOS | `~/Library/Application Support/Claude/claude_desktop_config.json` | +| Windows | `%APPDATA%\Claude\claude_desktop_config.json` | + +### macOS / Linux(ネイティブ) ```json { @@ -38,6 +45,48 @@ Claude Desktop や `claude` CLI から直接 CRUD 操作が可能になります `/path/to/nene2-python` をリポジトリの絶対パスに変更してください。 +### Windows + WSL2 + +Claude Desktop は Windows で動作しますが、プロジェクトは WSL2 内にあります。 +`wsl` コマンドでブリッジします: + +```json +{ + "mcpServers": { + "nene2-example": { + "command": "wsl", + "args": [ + "-e", "bash", "-c", + "cd /home//nene2-python && PYTHONPATH=src uv run python -m example.mcp" + ], + "env": { + "DB_ADAPTER": "sqlite", + "DB_NAME": "/home//nene2-python/data/nene2.db" + } + } + } +} +``` + +> パスはすべて **WSL の Linux パス**(例: `/home/user/...`)で指定します。 +> `DB_NAME` も Linux パスにすることで、SQLite ファイルが WSL 内に作成されます。 + +`uv add git+...` でインストールした外部プロジェクトの場合: + +```json +{ + "mcpServers": { + "myapp": { + "command": "wsl", + "args": [ + "-e", "bash", "-c", + "cd /home//my-project && PYTHONPATH=src uv run python -m mcp_server" + ] + } + } +} +``` + ## 利用可能なツール | ツール | 説明 |