docs: Add working directory documentation (#74)

This commit is contained in:
David Soria Parra 2024-12-18 12:02:56 +00:00
commit b07b6ebcbd
No known key found for this signature in database

View file

@ -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`.