Skip to main content
Glama

Filesystem MCP Server

Official
MIT License
116,828
62,980
  • Linux
  • Apple

edit_file

Perform line-based text file edits by replacing exact sequences with new content. Generate git-style diffs to track changes, with optional previews. Restricted to authorized directories for secure file modifications.

Instructions

Make line-based edits to a text file. Each edit replaces exact line sequences with new content. Returns a git-style diff showing the changes made. Only works within allowed directories.

Input Schema

NameRequiredDescriptionDefault
dryRunNoPreview changes using git-style diff format
editsYes
pathYes

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "dryRun": { "default": false, "description": "Preview changes using git-style diff format", "type": "boolean" }, "edits": { "items": { "additionalProperties": false, "properties": { "newText": { "description": "Text to replace with", "type": "string" }, "oldText": { "description": "Text to search for - must match exactly", "type": "string" } }, "required": [ "oldText", "newText" ], "type": "object" }, "type": "array" }, "path": { "type": "string" } }, "required": [ "path", "edits" ], "type": "object" }

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/modelcontextprotocol/filesystem'

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