Skip to content

Commit 9650fb4

Browse files
jqnatividadclaude
andcommitted
refactor(mcpb): use directory type for filesystem config to clarify restricted access
Changed user_config fields to use 'directory' type to: 1. Provide directory picker UI instead of text fields 2. Signal to Claude Desktop that filesystem access is limited 3. Make restrictions explicit in field descriptions Changes to manifest.json: - working_dir: Changed type from 'string' to 'directory' * Required field (users must select a working directory) * Description now explicitly states access is restricted * Default changed to ${DOWNLOADS} variable - allowed_dirs: Changed type from 'string' to 'directory' * Added 'multiple: true' to allow selecting multiple directories * Description clarifies extension access is restricted to these dirs * No default (users explicitly choose additional access) Changes to config.ts: - Updated allowedDirs parsing to handle both: * JSON array format (from directory type with multiple: true) * Delimited string format (legacy MCP mode) - Maintains backward compatibility with colon/semicolon separated paths This improves transparency about the restricted filesystem access scope, though the "grant access to everything" warning may still appear as it's controlled by Claude Desktop, not the manifest. Regenerated qsv-mcp-server.mcpb. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 3177cfe commit 9650fb4

File tree

3 files changed

+28
-9
lines changed

3 files changed

+28
-9
lines changed

.claude/skills/manifest.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,18 @@
6161
"default": "qsv"
6262
},
6363
"working_dir": {
64-
"type": "string",
64+
"type": "directory",
6565
"title": "Default Working Directory",
66-
"description": "Directory where qsv commands run by default",
67-
"required": false,
68-
"default": "${HOME}/Downloads"
66+
"description": "Directory where qsv commands run by default. Extension only accesses files within this directory and allowed directories below.",
67+
"required": true,
68+
"default": "${DOWNLOADS}"
6969
},
7070
"allowed_dirs": {
71-
"type": "string",
71+
"type": "directory",
7272
"title": "Allowed Directories",
73-
"description": "Colon-separated (Linux/Mac) or semicolon-separated (Windows) paths where qsv can access files. Leave empty to allow all directories.",
73+
"description": "Additional directories where qsv can access files. Extension access is restricted to working directory and these directories only.",
7474
"required": false,
75-
"default": "${HOME}/Downloads:${HOME}/Documents"
75+
"multiple": true
7676
},
7777
"timeout_ms": {
7878
"type": "number",

.claude/skills/qsv-mcp-server.mcpb

349 Bytes
Binary file not shown.

.claude/skills/src/config.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,29 @@ export const config = {
165165
workingDir: getStringEnv('QSV_MCP_WORKING_DIR', process.cwd()),
166166

167167
/**
168-
* Allowed directories for file access (colon-separated on Unix, semicolon on Windows)
168+
* Allowed directories for file access
169+
* Can be either:
170+
* - Colon/semicolon-separated paths (legacy MCP)
171+
* - JSON array (Desktop extension with directory type)
169172
* Default: Empty array (only working directory allowed)
170173
*/
171-
allowedDirs: getStringArrayEnv('QSV_MCP_ALLOWED_DIRS', [], getPathDelimiter()),
174+
allowedDirs: (() => {
175+
const envValue = process.env['QSV_MCP_ALLOWED_DIRS'];
176+
if (!envValue) return [];
177+
178+
// Try parsing as JSON array first (Desktop extension mode)
179+
try {
180+
const parsed = JSON.parse(envValue);
181+
if (Array.isArray(parsed)) {
182+
return parsed.map(p => expandTemplateVars(p));
183+
}
184+
} catch {
185+
// Not JSON, treat as delimited string
186+
}
187+
188+
// Fall back to delimited string (legacy MCP mode)
189+
return getStringArrayEnv('QSV_MCP_ALLOWED_DIRS', [], getPathDelimiter());
190+
})(),
172191

173192
/**
174193
* Maximum size for converted file cache in GB

0 commit comments

Comments
 (0)