Metadata-Version: 2.4
Name: filesystem-edit-mcp
Version: 1.2.0
Summary: MCP server for filesystem operations with encoding support and umlaut fixing
Author: Jonathan Harder
License-Expression: MIT
Keywords: encoding,filesystem,mcp,umlaut
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.13
Requires-Dist: fastmcp>=3.1.0
Requires-Dist: pydantic>=2.12.5
Requires-Dist: tree-sitter
Requires-Dist: tree-sitter-cpp>=0.23.4
Description-Content-Type: text/markdown

# 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](docs/overview.png)

### Encoding & Temp File Flow

![Encoding Flow](docs/encoding-flow.png)

## 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

No extra dependencies. Pure Python — works out of the box.

```bash
uvx filesystem-edit-mcp
```

## Configuration

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

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

Multiple directories:

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

### Environment Variables

| Variable | Description |
|----------|-------------|
| `ALLOWED_DIRS` | Colon-separated allowed directories — CLI args take precedence |
| `SERVER_CONFIG` | Path to the server config file (default: `server_config.json`) |

### Server Config

```json
{
  "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](docs/security.png)

Path validation prevents access to files outside configured directories.

## License

MIT
