Skip to main content
Glama

list_allowed_directories

Check which directories the Desktop Commander MCP server can access to verify permissions for file operations and command execution.

Instructions

Returns the list of directories that this server is allowed to access.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function that executes the tool logic, simply returning the predefined list of allowed directories.
    export function listAllowedDirectories(): string[] { return allowedDirectories; }
  • src/server.ts:188-197 (registration)
    Tool registration in the ListToolsRequestSchema handler, including name, description, and empty input schema (no parameters required).
    { name: "list_allowed_directories", description: "Returns the list of directories that this server is allowed to access.", inputSchema: { type: "object", properties: {}, required: [], }, },
  • Dispatcher case in CallToolRequestSchema handler that invokes the listAllowedDirectories function and formats the response.
    case "list_allowed_directories": { const directories = listAllowedDirectories(); return { content: [{ type: "text", text: `Allowed directories:\n${directories.join('\n')}` }], }; }
  • Helper constant defining the actual list of allowed directories used by the tool.
    const allowedDirectories: string[] = [ process.cwd(), // Current working directory os.homedir() // User's home directory ];
  • src/server.ts:38-39 (registration)
    Import of the handler function from filesystem module.
    listAllowedDirectories, } from './tools/filesystem.js';

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/MrGNSS/ClaudeDesktopCommander'

If you have feedback or need assistance with the MCP directory API, please join our Discord server