-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
The server uses process.cwd() to find the .quiet-shell/ configuration directory, which fails when launched from GUI applications:
- Claude Desktop on macOS: CWD =
/Applications - VS Code on macOS: CWD =
/Applications/Visual Studio Code.app/Contents/Resources/app
This makes it impossible for users to use project-specific .quiet-shell/ configuration.
Solution
A reusable directory-discovery utility has been implemented in prompts-mcp (commit 21c3830) that solves this problem.
Implementation Guide
See complete instructions: https://github.com/mrsimpson/prompts-mcp/blob/preconfigured-prompts/DIRECTORY_DISCOVERY_ISSUE.md
Quick Steps:
- Copy
packages/mcp-server/src/utils/directory-discovery.tsfrom prompts-mcp - Copy
packages/mcp-server/test/unit/directory-discovery.test.ts - Update code using
process.cwd()to use the discovery utility:
import { discoverDirectory } from "./utils/directory-discovery.js";
const configDiscovery = discoverDirectory({
subdirEnvPrefix: "QUIET_SHELL", // Creates QUIET_SHELL_SUBDIR env var
subdir: ".quiet-shell",
useHomeFallback: true
});
// Use configDiscovery.path for the directory
// Check configDiscovery.exists to see if it exists
// Check configDiscovery.source to see how it was foundNew Environment Variables
PROJECT_DIR- Override starting directory for upward searchQUIET_SHELL_SUBDIR- Directly specify .quiet-shell directory location
Search Strategy
- Check
QUIET_SHELL_SUBDIRenv var (direct override) - Search upward from
PROJECT_DIRorprocess.cwd() - Fallback to
~/.quiet-shell/(home directory)
Benefits
✅ Works with Claude Desktop and GUI apps
✅ Searches upward from nested directories
✅ Home directory fallback
✅ Flexible environment variable control
✅ Zero breaking changes
✅ Well-tested (18 new tests in prompts-mcp)
Reference Implementation
- Repo: https://github.com/mrsimpson/prompts-mcp
- Branch:
preconfigured-prompts - Commit:
21c3830 - Files: 17 changed (+929, -678 lines)
- Tests: 197 total, all passing
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request