Skip to main content
Glama
ai-yliu

Filesystem MCP Server

by ai-yliu

list_allowed_directories

Retrieve a list of all directories accessible by the Filesystem MCP Server, enabling users to identify permitted paths for file operations.

Instructions

List all directories the server is allowed to access

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler for the 'list_allowed_directories' tool. It returns a JSON string of the resolved allowed directories.
    case 'list_allowed_directories': { return { content: [ { type: 'text', text: JSON.stringify(resolvedAllowedDirectories, null, 2), }, ], }; }
  • src/index.ts:222-230 (registration)
    Registration of the 'list_allowed_directories' tool in the ListTools response, including its name, description, and input schema.
    { name: 'list_allowed_directories', description: 'List all directories the server is allowed to access', inputSchema: { type: 'object', properties: {}, required: [], }, },
  • Helper code that parses command-line arguments to set up the list of allowed directories, which is used by the tool handler.
    const allowedDirectories = process.argv.slice(2); if (allowedDirectories.length === 0) { console.error('Error: No allowed directories specified.'); console.error('Usage: node build/index.js /path/to/allowed/dir1 /path/to/allowed/dir2 ...'); process.exit(1); } // Resolve all allowed directories to absolute paths const resolvedAllowedDirectories = allowedDirectories.map(dir => path.resolve(dir));

Other Tools

Related Tools

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/ai-yliu/filesystem-mcp-server'

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