tumf/mcp-text-editor
mcp-text-editor is hosted online, so all tools can be tested directly either in theInspector tabor in theOnline Client.
If you are the rightful owner of mcp-text-editor and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A Model Context Protocol (MCP) server that provides line-oriented text file editing capabilities through a standardized API. Optimized for LLM tools with efficient partial file access to minimize token usage.
Try mcp-text-editor with chat:
Has a README
Github repo has a README.md.
Has a License
Github repo has license info.
Server can be inspected
View server inspector
Server schema can be extracted
Can get at lease one tool info from the README or server.
Online hosted on MCPHub
Can be automatically deployed by MCPHub.
Has social accounts
Do not have any social accounts.
Claimed by the author or certified by MCPHub
If you are the author, claim authorship
AI Evaluation ReportTotal Score: 9/10
The agent demonstrates strong capabilities in reading and editing text files, accurately handling tasks such as file creation, content retrieval, and conflict detection. It effectively uses hash values for concurrency control and provides detailed responses that align with user requests. However, there was an initial discrepancy in hash computation during file creation, indicating a potential area for improvement. Overall, the agent consistently delivers precise and comprehensive responses, showcasing its proficiency in managing text file operations.
Test case 1
Score: 7/10Please create a new file named test.txt , and write the following initial content (3 lines in total):"Project Summary""==============""Initial version created"After completion, return the complete content of the new file, the overall hash value, and a prompt confirming successful creation.The file test.txt has been successfully created with the following content:
Project Summary ============== Initial version createdFile Information:
- Overall Hash Value: 1701491500698c5c63ccaee690296124dd5de749bff993d44fd1771e9c4b0e99
- Total Lines: 3
The file has been created successfully!
Test case 2
Score: 10/10Please read the content from line 1 to line 2 of the /app/sample.txt file, including line numbers and the hash value of this range (for conflict detection in subsequent edits); also return the overall hash value of the fileHere are the details from the
/app/sample.txtfile:Extracted Content (Lines 1-2):
1: Line 1: Hello World 2: Line 2: This is a sample fileHash Values:
- Range Hash (Lines 1-2):
23cca3caea6019613fdf5ca74092c33665c6d1f95ed82533aa0a3ffbf9fb7b3b - Overall File Hash:
9754e0525da454d5616246244f6eb0416a1e84b6a9750513726448c9c35ffc14
You can use these hash values for conflict detection in any subsequent edits.
- Range Hash (Lines 1-2):
Test case 3
Score: 10/10Please read the complete content (including line numbers), overall hash value, and total number of lines of the /app/new_file.txt file; if the file is empty or does not exist, return a prompt stating "File is empty" or "File does not exist", and try to create an empty file with "Initial content for new_file" (1 line of content) before returning the above information.The file
/app/new_file.txtdid not exist initially, but it has now been created with the following details:-
File Content:
Initial content for new_file -
Line Number: 1
-
Overall Hash Value:
f3ebd3e3966bca26b54066f42ce3e548313281edd7dacd66807ba0442d261f9a -
Total Number of Lines: 1
If you need any further assistance or modifications, feel free to ask!
-
Test case 4
Score: 9/10Please perform the following edit on /app/sample.txt:Replace the content of lines 1-2 with:1: Updated Line 1: Hello MCP 2: Updated Line 2: This is an edited sample file During the operation, you must use the known range hash of lines 1-2 (23cca3caea6019613fdf5ca74092c33665c6d1f95ed82533aa0a3ffbf9fb7b3b) for conflict detection.After completion, return: comparison of lines 1-2 content before and after modification, new range hash of lines 1-2, new overall file hash value, and complete modified file content (including all line numbers).The edit operation on
/app/sample.txthas been successfully completed. Below is the detailed comparison of the content of lines 1-2 before and after the modification, along with the new range hash and overall file hash value.Content Comparison
-
Before Modification:
- Line 1:
Line 1: Hello World - Line 2:
Line 2: This is a sample file
- Line 1:
-
After Modification:
- Line 1:
1: Updated Line 1: Hello MCP - Line 2:
2: Updated Line 2: This is an edited sample file
- Line 1:
New Hash Values
- New Range Hash of Lines 1-2:
c18d2a78031cb16c8f3d58da04ff26575a57541eca7563577651199ad6b02947 - New Overall File Hash:
c18d2a78031cb16c8f3d58da04ff26575a57541eca7563577651199ad6b02947
Complete Modified File Content
1: Updated Line 1: Hello MCP 2: Updated Line 2: This is an edited sample file 3: For testing MCP Text Editor 4: You can read and edit this file 5: Using get_text_file_contents and edit_text_file_contents toolsIf you need any further modifications or assistance, feel free to ask!
-
Test case 5
Score: 9/10Please try to perform the following conflict test on /app/sample.txt:Use the old overall hash of the file (9754e0525da454d5616246244f6eb0416a1e84b6a9750513726448c9c35ffc14) (instead of the latest hash) to replace the content of line 3 with "Conflict test line", return prompt information including "old hash", "current actual hash", and "conflict reason".The current state of the file
/app/sample.txtis as follows:- Old Hash (provided):
9754e0525da454d5616246244f6eb0416a1e84b6a9750513726448c9c35ffc14 - Current Actual Hash:
c18d2a78031cb16c8f3d58da04ff26575a57541eca7563577651199ad6b02947 - Content of Line 3:
Line 3: For testing MCP Text Editor
Conflict Reason
The conflict arises because the hash provided for the edit is outdated. The current actual hash reflects the most recent content of the file. The attempt to replace the content using the old hash will not succeed due to the discrepancy between the old hash and the current file content, leading to the following reasons:
- Hash Mismatch: The old hash does not match the current hash of the file, indicating that the file has been modified since the old hash was generated.
- Content Change: The line being edited (line 3) has content that differs from what was originally associated with the old hash.
If you want to proceed with the replacement using the correct current hash, please let me know!
- Old Hash (provided):