Skip to main content

MCP server for filesystem operations with encoding support and umlaut fixing

Project description

filesystem-edit-mcp

An MCP (Model Context Protocol) server for filesystem operations with encoding support and umlaut fixing for C++ code.

Architecture

High-Level Overview

Encoding & Temp File Flow

Encoding Flow

Features

  • read_text_file: Read files with configurable encoding per file extension
  • edit_file: Edit files with pattern matching and automatic umlaut fixing
  • Path validation: Security boundary enforcement via ALLOWED_DIRS
  • Encoding support: Configure encodings per file pattern (e.g., latin-1 for .cpp)
  • Umlaut fixing: Transform German umlauts in C++ string literals, comments, and character constants

Installation

Requires:

  • Python ≥ 3.13
  • Node.js + npx on PATH (the server spawns @modelcontextprotocol/server-filesystem as a subprocess)

Python deps (mcp, pydantic, tree-sitter, tree-sitter-cpp) are pulled in automatically by uvx:

uvx filesystem-edit-mcp /path/to/your/codebase

Configuration

Add to your MCP client config (Windsurf / Cursor / any MCP-compatible client):

{
  "mcpServers": {
    "filesystem-edit-mcp": {
      "command": "uvx",
      "args": ["filesystem-edit-mcp", "/path/to/your/codebase"]
    }
  }
}

Multiple directories:

{
  "mcpServers": {
    "filesystem-edit-mcp": {
      "command": "uvx",
      "args": ["filesystem-edit-mcp", "/path/to/dir1", "/path/to/dir2"]
    }
  }
}

Environment Variables

Variable Description
ALLOWED_DIRS Allowed directories (supports :, ,, ; delimiters) — CLI args take precedence
SERVER_CONFIG Path to the server config file (default: server_config.json)

Notes:

  • Windows 8.3 short paths (e.g., C:\Users\FOO~1) are automatically expanded to long form
  • System temp directories (%TEMP%, %TMP%) are automatically allow-listed
  • Error messages show resolved paths for easier debugging

Server Config

{
  "umlaut_config": {
    "string_mapping": { "Ä": "CAE_UMLT", "ä": "AE_UMLT" },
    "comment_mapping": { "Ä": "Ae", "ä": "ae" },
    "char_mapping": { "Ä": "CAE_UMLT_CHAR" }
  },
  "encoding_config": {
    "default": "utf-8",
    "mapping": { "*.cpp": "latin-1", "*.h": "latin-1" }
  }
}

Security

Security Diagram

Path validation prevents access to files outside configured directories.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

filesystem_edit_mcp-1.3.1.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

filesystem_edit_mcp-1.3.1-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file filesystem_edit_mcp-1.3.1.tar.gz.

File metadata

  • Download URL: filesystem_edit_mcp-1.3.1.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for filesystem_edit_mcp-1.3.1.tar.gz
Algorithm Hash digest
SHA256 74a5e1fa8e4b9ec435f0aed410243c74beb93a4beb91ce998a1b79ee09f43e79
MD5 436c1ebd7d5eea58e13b03e287eb3c2b
BLAKE2b-256 a9bda4c504e99e4823aebbed74d5603a2a54f668a89634d1f509e35548e6d27e

See more details on using hashes here.

File details

Details for the file filesystem_edit_mcp-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: filesystem_edit_mcp-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for filesystem_edit_mcp-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7afe33f87505bd08f53429c6629972a5a96e5cb94d013684b81ccef82a4619f5
MD5 fee4e9efae0e75ad3288639a0e2fd802
BLAKE2b-256 010edcc09787cbb66da830ce13d8003e398014ea7fbb92b60fd1eed60ca3a3e8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page