This commit is contained in:
2026-03-06 23:21:23 -05:00
parent 4921a6715c
commit f25e6e0b34
3 changed files with 65 additions and 99 deletions

12
docs/MCP_BUGFIX.md Normal file
View File

@@ -0,0 +1,12 @@
# MCP Tools Bug Fix - newline parameter
## Issue
The MCP edit_file tool in `src/mcp_client.py` was using `newline=""` in `read_text()` and `write_text()` calls. This parameter is NOT supported by Python's `pathlib.Path` methods before Python 3.10.
## Fix Applied
Removed all `newline=""` parameters from:
- `p.read_text(encoding="utf-8", newline="")``p.read_text(encoding="utf-8")`
- `p.write_text(content, encoding="utf-8", newline="")``p.write_text(content, encoding="utf-8")`
## Prevention
When editing Python files via MCP tools, always use the standard `encoding="utf-8"` without the `newline` parameter, as Python's pathlib doesn't support it until 3.10+.