Skip to main content
Glama
lofcz

MCP Smart Filesystem Server

by lofcz

list_allowed_directories

Display directories accessible within the MCP Smart Filesystem Server's security boundaries to identify permitted file system areas for safe exploration.

Instructions

Show which directories this server can access (security boundaries). No parameters required.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'list_allowed_directories' tool. It serializes and returns the list of allowed directories (via getAllowedDirectories helper), including count and security note.
    case 'list_allowed_directories': { return { content: [{ type: 'text', text: JSON.stringify({ allowedDirectories: getAllowedDirectories(), count: getAllowedDirectories().length, note: 'This server can only access files within these directories for security' }, null, 2) }] }; }
  • index.ts:249-256 (registration)
    Tool registration in the tools array returned by ListToolsRequestSchema handler. Defines name, description, and empty input schema (no parameters).
    { name: 'list_allowed_directories', description: 'Show which directories this server can access (security boundaries). No parameters required.', inputSchema: { type: 'object', properties: {} } }
  • Input schema definition for the tool (empty object, no required parameters).
    inputSchema: { type: 'object', properties: {} }
  • lib.ts:6-17 (helper)
    Global state management and helper functions for allowed directories. getAllowedDirectories() is called by the tool handler to retrieve the list.
    // Global allowed directories - set by the main module let allowedDirectories: string[] = []; // Function to set allowed directories from the main module export function setAllowedDirectories(directories: string[]): void { allowedDirectories = [...directories]; } // Function to get current allowed directories export function getAllowedDirectories(): string[] { return [...allowedDirectories]; }

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/lofcz/mcp-filesystem-smart'

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