@@ -40,6 +40,22 @@ function getCcwEnabledToolsCodex() {
4040 return CCW_MCP_TOOLS . filter ( t => t . core ) . map ( t => t . name ) ;
4141}
4242
43+ // Get current CCW_PROJECT_ROOT from config
44+ function getCcwProjectRoot ( ) {
45+ const currentPath = projectPath ;
46+ const projectData = mcpAllProjects [ currentPath ] || { } ;
47+ const ccwConfig = projectData . mcpServers ?. [ 'ccw-tools' ] ;
48+ return ccwConfig ?. env ?. CCW_PROJECT_ROOT || '' ;
49+ }
50+
51+ // Get current CCW_ALLOWED_DIRS from config
52+ function getCcwAllowedDirs ( ) {
53+ const currentPath = projectPath ;
54+ const projectData = mcpAllProjects [ currentPath ] || { } ;
55+ const ccwConfig = projectData . mcpServers ?. [ 'ccw-tools' ] ;
56+ return ccwConfig ?. env ?. CCW_ALLOWED_DIRS || '' ;
57+ }
58+
4359async function renderMcpManager ( ) {
4460 const container = document . getElementById ( 'mainContent' ) ;
4561 if ( ! container ) return ;
@@ -232,6 +248,34 @@ async function renderMcpManager() {
232248 <button class="text-primary hover:underline" onclick="selectCcwToolsCodex('all')">All</button>
233249 <button class="text-muted-foreground hover:underline" onclick="selectCcwToolsCodex('none')">None</button>
234250 </div>
251+ <!-- Path Settings -->
252+ <div class="ccw-path-settings mt-3 pt-3 border-t border-border/50">
253+ <div class="flex items-center gap-2 mb-2">
254+ <i data-lucide="folder-root" class="w-4 h-4 text-muted-foreground"></i>
255+ <span class="text-xs font-medium text-muted-foreground">${ t ( 'mcp.pathSettings' ) } </span>
256+ </div>
257+ <div class="grid grid-cols-1 gap-2">
258+ <div class="flex items-center gap-2">
259+ <label class="text-xs text-muted-foreground w-28 shrink-0">CCW_PROJECT_ROOT</label>
260+ <input type="text"
261+ class="ccw-project-root-input flex-1 px-2 py-1 text-xs bg-background border border-border rounded focus:outline-none focus:ring-1 focus:ring-primary"
262+ placeholder="${ projectPath || t ( 'mcp.useCurrentDir' ) } "
263+ value="${ getCcwProjectRoot ( ) } ">
264+ <button class="p-1 text-muted-foreground hover:text-foreground"
265+ onclick="setCcwProjectRootToCurrent()"
266+ title="${ t ( 'mcp.useCurrentProject' ) } ">
267+ <i data-lucide="locate-fixed" class="w-4 h-4"></i>
268+ </button>
269+ </div>
270+ <div class="flex items-center gap-2">
271+ <label class="text-xs text-muted-foreground w-28 shrink-0">CCW_ALLOWED_DIRS</label>
272+ <input type="text"
273+ class="ccw-allowed-dirs-input flex-1 px-2 py-1 text-xs bg-background border border-border rounded focus:outline-none focus:ring-1 focus:ring-primary"
274+ placeholder="${ t ( 'mcp.allowedDirsPlaceholder' ) } "
275+ value="${ getCcwAllowedDirs ( ) } ">
276+ </div>
277+ </div>
278+ </div>
235279 </div>
236280 </div>
237281 <div class="shrink-0">
@@ -418,6 +462,34 @@ async function renderMcpManager() {
418462 <button class="text-primary hover:underline" onclick="selectCcwTools('all')">All</button>
419463 <button class="text-muted-foreground hover:underline" onclick="selectCcwTools('none')">None</button>
420464 </div>
465+ <!-- Path Settings -->
466+ <div class="ccw-path-settings mt-3 pt-3 border-t border-border/50">
467+ <div class="flex items-center gap-2 mb-2">
468+ <i data-lucide="folder-root" class="w-4 h-4 text-muted-foreground"></i>
469+ <span class="text-xs font-medium text-muted-foreground">${ t ( 'mcp.pathSettings' ) } </span>
470+ </div>
471+ <div class="grid grid-cols-1 gap-2">
472+ <div class="flex items-center gap-2">
473+ <label class="text-xs text-muted-foreground w-28 shrink-0">CCW_PROJECT_ROOT</label>
474+ <input type="text"
475+ class="ccw-project-root-input flex-1 px-2 py-1 text-xs bg-background border border-border rounded focus:outline-none focus:ring-1 focus:ring-primary"
476+ placeholder="${ projectPath || t ( 'mcp.useCurrentDir' ) } "
477+ value="${ getCcwProjectRoot ( ) } ">
478+ <button class="p-1 text-muted-foreground hover:text-foreground"
479+ onclick="setCcwProjectRootToCurrent()"
480+ title="${ t ( 'mcp.useCurrentProject' ) } ">
481+ <i data-lucide="locate-fixed" class="w-4 h-4"></i>
482+ </button>
483+ </div>
484+ <div class="flex items-center gap-2">
485+ <label class="text-xs text-muted-foreground w-28 shrink-0">CCW_ALLOWED_DIRS</label>
486+ <input type="text"
487+ class="ccw-allowed-dirs-input flex-1 px-2 py-1 text-xs bg-background border border-border rounded focus:outline-none focus:ring-1 focus:ring-primary"
488+ placeholder="${ t ( 'mcp.allowedDirsPlaceholder' ) } "
489+ value="${ getCcwAllowedDirs ( ) } ">
490+ </div>
491+ </div>
492+ </div>
421493 </div>
422494 </div>
423495 <div class="shrink-0 flex gap-2">
0 commit comments