From b07b6ebcbd5abd56b40f037c132a79d9edf993e0 Mon Sep 17 00:00:00 2001 From: David Soria Parra Date: Wed, 18 Dec 2024 12:02:56 +0000 Subject: [PATCH] docs: Add working directory documentation (#74) --- docs/tools/debugging.mdx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/tools/debugging.mdx b/docs/tools/debugging.mdx index c4b47b2..18ca18e 100644 --- a/docs/tools/debugging.mdx +++ b/docs/tools/debugging.mdx @@ -80,6 +80,23 @@ Use the Network panel to inspect: ## Common issues +### Working directory + +When using MCP servers with Claude Desktop: + +- The working directory for servers launched via `claude_desktop_config.json` may be undefined (like `/` on macOS) since Claude Desktop could be started from anywhere +- Always use absolute paths in your configuration and `.env` files to ensure reliable operation +- For testing servers directly via command line, the working directory will be where you run the command + +For example in `claude_desktop_config.json`, use: +```json +{ + "command": "npx", + "args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/username/data"] +} +``` +Instead of relative paths like `./data` + ### Environment variables MCP servers inherit only a subset of environment variables automatically, like `USER`, `HOME`, and `PATH`.