Skip to main content
Glama

list_allowed_directories

Retrieve a list of directories accessible by the Desktop Commander MCP server, ensuring secure and authorized file operations and terminal command execution.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler for the 'list_allowed_directories' tool. It calls listAllowedDirectories() from filesystem and returns the formatted list of allowed directories as tool response.
    case "list_allowed_directories": { const directories = listAllowedDirectories(); return { content: [{ type: "text", text: `Allowed directories:\n${directories.join('\n')}` }], }; }
  • src/server.ts:188-197 (registration)
    Registration of the 'list_allowed_directories' tool in the ListToolsRequest handler, including name, description, and empty input schema.
    { name: "list_allowed_directories", description: "Returns the list of directories that this server is allowed to access.", inputSchema: { type: "object", properties: {}, required: [], }, },
  • Helper function that returns the list of allowed directories defined in the module.
    export function listAllowedDirectories(): string[] { return allowedDirectories; }
  • Definition of the allowedDirectories array used by the listAllowedDirectories tool.
    const allowedDirectories: string[] = [ process.cwd(), // Current working directory os.homedir() // User's home directory ];

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