Skip to main content
Glama
StrawHatAI

Claude Desktop Commander MCP

by StrawHatAI

list_allowed_directories

Retrieve the list of directories accessible by the server, enabling controlled file system operations and terminal command execution with Claude Desktop Commander MCP.

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 returns the predefined list of allowed directories.
    export function listAllowedDirectories(): string[] { return allowedDirectories; }
  • src/server.ts:188-197 (registration)
    Tool registration in the ListTools response, 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: [], }, },
  • The dispatch handler in the CallToolRequest switch statement that invokes the core function and formats the response.
    case "list_allowed_directories": { const directories = listAllowedDirectories(); return { content: [{ type: "text", text: `Allowed directories:\n${directories.join('\n')}` }], }; }
  • The constant array defining the allowed directories used by the handler.
    // Store allowed directories 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/StrawHatAI/claude-dev-tools'

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