Skip to main content
Glama

Filesystem MCP Server

file-operations.ts2.48 kB
import { Type, Static } from "@sinclair/typebox"; // Schema definitions moved from index.ts export const ReadFileArgsSchema = Type.Object({ path: Type.String(), maxBytes: Type.Integer({ minimum: 1, description: 'Maximum bytes to read from the file. Must be a positive integer. Handler default: 10KB.' }) }); export type ReadFileArgs = Static<typeof ReadFileArgsSchema>; export const ReadMultipleFilesArgsSchema = Type.Object({ paths: Type.Array(Type.String()), maxBytesPerFile: Type.Integer({ minimum: 1, description: 'Maximum bytes to read per file. Must be a positive integer. Handler default: 10KB.' }) }); export type ReadMultipleFilesArgs = Static<typeof ReadMultipleFilesArgsSchema>; // Note: WriteFileArgsSchema is used by both create_file and modify_file export const WriteFileArgsSchema = Type.Object({ path: Type.String(), content: Type.String(), // No maxBytes here as it's about writing, not reading limit }); export type WriteFileArgs = Static<typeof WriteFileArgsSchema>; export const EditOperation = Type.Object({ oldText: Type.String({ description: 'Text to search for - must match exactly' }), newText: Type.String({ description: 'Text to replace with' }) }); export type EditOperationType = Static<typeof EditOperation>; export const EditFileArgsSchema = Type.Object({ path: Type.String(), edits: Type.Array(EditOperation), dryRun: Type.Boolean({ default: false, description: 'Preview changes using git-style diff format' }), maxBytes: Type.Integer({ minimum: 1, description: 'Maximum bytes to read from the file before editing. Must be a positive integer. Handler default: 10KB.' }) }); export type EditFileArgs = Static<typeof EditFileArgsSchema>; export const GetFileInfoArgsSchema = Type.Object({ path: Type.String(), }); export type GetFileInfoArgs = Static<typeof GetFileInfoArgsSchema>; export const MoveFileArgsSchema = Type.Object({ source: Type.String(), destination: Type.String(), }); export type MoveFileArgs = Static<typeof MoveFileArgsSchema>; export const DeleteFileArgsSchema = Type.Object({ path: Type.String(), }); export type DeleteFileArgs = Static<typeof DeleteFileArgsSchema>; export const RenameFileArgsSchema = Type.Object({ path: Type.String({ description: 'Path to the file to be renamed' }), newName: Type.String({ description: 'New name for the file (without path)' }) }); export type RenameFileArgs = Static<typeof RenameFileArgsSchema>;

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

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