Downloads · 30 days
0
bradlives/surgical-fs-mcp
surgical-fs-mcp is a machine learning model from bradlives. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
A C MCP server providing whitespace-tolerant file editing tools.
Downloads · 30 days
0
Access
Public
Updated Dec 22, 2025
Repo size
696 KB
Likes
0
Public
Click a slice to open those files.
.dll579 KB · 76%
From the Hugging Face model README
A C# MCP server providing whitespace-tolerant file editing tools.
Direct port of ClipMicro's battle-tested code, including:
UpdateFindReplaceWithResultBackupManagerSame code. Same behavior. No translation bugs.
Download from the release/ folder:
surgical-fs-mcp.exe - Standalone executablesurgical-fs-mcp.dll - For use with dotnetModelContextProtocol.dll - Required dependencyNo build required - just configure Claude Desktop (see below).
Directly ported from ClipMicro's UpdateFindReplaceWithResult:
| Strategy | What it handles |
|---|---|
| 1. Exact match | Perfect input |
| 2. Line ending normalization | CRLF vs LF vs CR |
| 3. Trim whitespace | Leading/trailing whitespace |
| 4. Tab normalization | Tabs → 4 spaces |
| 5. Fuzzy whitespace | Collapse \s+ → single space, line-by-line |
| 6. Partial line match | Single-line substring matching |
Directly ported from ClipMicro's BackupManager:
.surgicalfs_backup_YYYYMMDD_HHMMSS/| Tool | Description |
|---|---|
SurgicalEdit | Find/replace with 6-strategy matching + ACID |
EditLines | Replace lines by number + ACID |
InsertLines | Insert at line without replacing + ACID |
DeleteLines | Remove line range + ACID |
PreviewEdit | Show diff without applying (read-only) |
ReadFileLines | Read file with line numbers (read-only) |
BatchEdit | Multiple edits as single ACID transaction |
cd C:\Users\bradc\Documents\ClaudeWorkspace\Projects\surgical-fs-mcp
dotnet restore
dotnet build --configuration Release
Edit SurgicalFsMcp.cs and modify AllowedDirectories in the PathValidator class:
private static readonly List<string> AllowedDirectories = new()
{
Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Projects"),
@"C:\Your\Custom\Path",
};
Rebuild after changing.
Edit %APPDATA%\Claude\claude_desktop_config.json:
Option 1: Using dotnet run (easier for development)
{
"mcpServers": {
"surgical_fs": {
"command": "dotnet",
"args": ["run", "--project", "C:\\Users\\bradc\\Documents\\ClaudeWorkspace\\Projects\\surgical-fs-mcp\\SurgicalFsMcp.csproj"]
}
}
}
Option 2: Using compiled exe (faster startup)
{
"mcpServers": {
"surgical_fs": {
"command": "C:\\Users\\bradc\\Documents\\ClaudeWorkspace\\Projects\\surgical-fs-mcp\\bin\\Release\\net8.0\\surgical-fs-mcp.exe"
}
}
}
Restart Claude Desktop after configuring.
SurgicalEdit(
path: "config.json",
find: '"debug": false',
replace: '"debug": true'
)
Returns: ✅ Success: Edit applied using 'exact_match' matching
PreviewEdit(
path: "config.json",
find: '"debug": false',
replace: '"debug": true'
)
Returns a diff showing what would change.
BatchEdit(edits_json: '[
{"path": "file1.cs", "find": "oldMethod", "replace": "newMethod"},
{"path": "file2.cs", "find": "oldMethod", "replace": "newMethod"},
{"path": "file3.cs", "find": "oldMethod", "replace": "newMethod"}
]')
If ANY edit fails, ALL changes roll back automatically.
ReadFileLines(path: "code.cs", start_line: 50, end_line: 60)
EditLines(path: "code.cs", start_line: 52, end_line: 55, new_content: "// new code here")
..) blockedUpdateFindReplaceWithResultBackupManager