From 2de32fe1e64c391fbcfc731b2085165b65ef6670 Mon Sep 17 00:00:00 2001 From: Gregory Gauthier Date: Fri, 17 Apr 2026 14:25:42 +0100 Subject: [PATCH] refactor(paths): use relative paths in configs and launch scripts - Update README.md to reflect relative path usage. - Change MCP server commands in claude_desktop_config.json to relative paths. - Modify launch scripts to use `cd "$(dirname "$0")"` and relative paths, removing OS-specific absolute prefixes. --- README.md | 2 +- config/claude_desktop_config.json | 10 +++++----- mcps/dicom_mcp/run_dicom_mcp_server.sh | 12 +----------- mcps/filesystem_mcp/launch_filesystem_mcp.sh | 2 +- mcps/open_meteo_mcp/run_open_meteo_mcp_server.sh | 12 +----------- mcps/playwright_mcp/launch_playwright_mcp.sh | 12 +----------- mcps/selenium_mcp/launch_selenium_mcp_server.sh | 12 +----------- 7 files changed, 11 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index b0a465d..5cfa330 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ The root `.mcp.json` registers all MCP servers for clients that support it (e.g. - **For Grok CLI Agent mode**: Many MCPs are available as pre-registered tools (prefixed `mcp_dicom-mcp__*`, `mcp_filesystem-mcp__*`, `mcp_playwright-mcp__*`, `mcp_selenium-mcp__*`, `mcp_us-weather-mcp__*`, etc.). The servers are now located at `~/Projects/local/mcp_servers/`. Use the `mcp_*` tools directly via function calls, or leverage `task` (for sub-agents like `general`, `explore`, `verify`, `computer`), `delegate`, and built-in tools like `computer_*` for desktop interaction. No extra registration needed in most cases. - **General**: See individual MCP READMEs for Poetry setup, launch commands (stdio vs HTTP), and platform-specific config examples. Most support the official MCP spec (https://modelcontextprotocol.info/docs/). -**Note on paths**: The `config/claude_desktop_config.json` has hardcoded absolute paths from a previous location (`/Users/.../pd/claude-tools`). Update these to match your current directory (`/Users/gregory.gauthier/Projects/local/llm-tools`) or generalize with environment variables/`~`. +**Note on paths**: All path references in configs and launch scripts are now relative to the repository root (`$PWD`). ### Skills diff --git a/config/claude_desktop_config.json b/config/claude_desktop_config.json index 338ef6a..1eb0b88 100644 --- a/config/claude_desktop_config.json +++ b/config/claude_desktop_config.json @@ -1,24 +1,24 @@ { "mcpServers": { "dicom-mcp": { - "command": "/Users/gregory.gauthier/Projects/local/mcp_servers/dicom_mcp/run_dicom_mcp_server.sh" + "command": "./mcps/dicom_mcp/run_dicom_mcp_server.sh" }, "filesystem": { "command": "zsh", - "args": ["/Users/gregory.gauthier/Projects/local/mcp_servers/filesystem_mcp/launch_filesystem_mcp.sh"], + "args": ["./mcps/filesystem_mcp/launch_filesystem_mcp.sh"], "env": { "MCP_LOG_LEVEL": "debug", "MCP_TRANSPORT_TYPE": "stdio" } }, "open-meteo-mcp": { - "command": "/Users/gregory.gauthier/Projects/local/mcp_servers/open_meteo_mcp/run_open_meteo_mcp_server.sh" + "command": "./mcps/open_meteo_mcp/run_open_meteo_mcp_server.sh" }, "playwright-mcp": { - "command": "/Users/gregory.gauthier/Projects/local/mcp_servers/playwright_mcp/launch_playwright_mcp.sh" + "command": "./mcps/playwright_mcp/launch_playwright_mcp.sh" }, "selenium-mcp": { - "command": "/Users/gregory.gauthier/Projects/local/mcp_servers/selenium_mcp/launch_selenium_mcp_server.sh" + "command": "./mcps/selenium_mcp/launch_selenium_mcp_server.sh" } }, "preferences": { diff --git a/mcps/dicom_mcp/run_dicom_mcp_server.sh b/mcps/dicom_mcp/run_dicom_mcp_server.sh index c3a8d78..98b568e 100755 --- a/mcps/dicom_mcp/run_dicom_mcp_server.sh +++ b/mcps/dicom_mcp/run_dicom_mcp_server.sh @@ -1,15 +1,5 @@ #!/usr/bin/env zsh # -if [[ "$(uname)" == "Linux" ]]; then - PATH_PREFIX="/data/Projects" -elif [[ "$(uname)" == "Darwin" ]]; then - PATH_PREFIX="/Users/gregory.gauthier/Projects" -else - # Always fallback to the linux default - PATH_PREFIX="/data/Projects" -fi - -# shellcheck disable=SC2164 -cd "${PATH_PREFIX}/local/mcp_servers/dicom_mcp" +cd "$(dirname "$0")" poetry run python ./dicom_mcp diff --git a/mcps/filesystem_mcp/launch_filesystem_mcp.sh b/mcps/filesystem_mcp/launch_filesystem_mcp.sh index 3332658..17e7a29 100755 --- a/mcps/filesystem_mcp/launch_filesystem_mcp.sh +++ b/mcps/filesystem_mcp/launch_filesystem_mcp.sh @@ -11,7 +11,7 @@ if command -v node >/dev/null 2>&1; then MCP_LOG_LEVEL=debug \ MCP_TRANSPORT_TYPE=stdio \ - node "~/Projects/local/mcp_servers/filesystem_mcp/dist/index.js" \ + node "./dist/index.js" \ 2> filesystem_mcp.log else echo "Error: Node.js not found!" >&2 diff --git a/mcps/open_meteo_mcp/run_open_meteo_mcp_server.sh b/mcps/open_meteo_mcp/run_open_meteo_mcp_server.sh index 5e9125c..fa853d4 100755 --- a/mcps/open_meteo_mcp/run_open_meteo_mcp_server.sh +++ b/mcps/open_meteo_mcp/run_open_meteo_mcp_server.sh @@ -1,14 +1,4 @@ #!/usr/bin/env zsh # -if [[ "$(uname)" == "Linux" ]]; then - PATH_PREFIX="/data/Projects" -elif [[ "$(uname)" == "Darwin" ]]; then - PATH_PREFIX="/Users/gregory.gauthier/Projects" -else - # Default fallback is Linux - PATH_PREFIX="/data/Projects" -fi - -# shellcheck disable=SC2164 -cd "${PATH_PREFIX}/local/mcp_servers/open_meteo_mcp" +cd "$(dirname "$0")" poetry run open-meteo-mcp-stdio diff --git a/mcps/playwright_mcp/launch_playwright_mcp.sh b/mcps/playwright_mcp/launch_playwright_mcp.sh index 135ed6a..540f79f 100755 --- a/mcps/playwright_mcp/launch_playwright_mcp.sh +++ b/mcps/playwright_mcp/launch_playwright_mcp.sh @@ -1,16 +1,6 @@ #!/usr/bin/env zsh -if [[ "$(uname)" == "Linux" ]]; then - PATH_PREFIX="/data/Projects" -elif [[ "$(uname)" == "Darwin" ]]; then - PATH_PREFIX="/Users/gregory.gauthier/Projects" -else - # Default fallback - PATH_PREFIX="/data/Projects" -fi - -# shellcheck disable=SC2164 -cd "${PATH_PREFIX}/local/mcp_servers/playwright_mcp" +cd "$(dirname "$0")" # Install dependencies if not present if [[ ! -d "node_modules" ]]; then diff --git a/mcps/selenium_mcp/launch_selenium_mcp_server.sh b/mcps/selenium_mcp/launch_selenium_mcp_server.sh index fde3d9c..b3ca67e 100755 --- a/mcps/selenium_mcp/launch_selenium_mcp_server.sh +++ b/mcps/selenium_mcp/launch_selenium_mcp_server.sh @@ -1,14 +1,4 @@ #!/usr/bin/env zsh -if [[ "$(uname)" == "Linux" ]]; then - PATH_PREFIX="/data/Projects" -elif [[ "$(uname)" == "Darwin" ]]; then - PATH_PREFIX="/Users/gregory.gauthier/Projects" -else - # Default fallback is Linux - PATH_PREFIX="/data/Projects" -fi - -# shellcheck disable=SC2164 -cd "${PATH_PREFIX}/local/mcp_servers/selenium_mcp" +cd "$(dirname "$0")" poetry run selenium-mcp-stdio