Skip to main content
Glama
text_file_read_and_refactor_mcp

text_file_read_and_refactor_mcp

GitHub-Tag (mit Filter) Statisches Abzeichen

Statisches Abzeichen Statisches Abzeichen

GitHub-Lizenz Statisches Abzeichen

text_file_read_and_refactor_mcp MCP server

Text File Read And Refactor MCP

Token-effizienter Python stdio MCP-Server, der sichere Textdatei-Such-, Lese- und Refactoring-Tools bereitstellt. Die Tools lösen automatisch die Datei-BOM und Codepage auf; Bearbeitungswerkzeuge speichern Dateien mit ihrer ursprünglichen Kodierung und BOM.

Glama.AI

text_file_read_and_refactor_mcp MCP server

Github repository

Das Github-Repository ist ein kuratierter öffentlicher Spiegel des Projekts. Die aktive Entwicklung (einschließlich experimentellem Code und privaten Forschungsnotizen) findet in einem privaten Repository statt; ausgewählte Schnappschüsse werden hier regelmäßig veröffentlicht.

Installation

  1. Installieren Sie uv: https://docs.astral.sh/uv/getting-started/installation/

  2. Konfigurieren Sie Ihren MCP-Client, um den Server über uvx auszuführen:

{
  "mcpServers": {
    "text-file-read-and-refactor": {
      "command": "uvx",
      "args": [
        "text-file-read-and-refactor-mcp"
      ]
    }
  }
}

Related MCP server: MCP File Context Server

Werkzeuge

Slice-Konzept: ein Analogon zu slice(start: integer, stop: integer) – speichert die Start- und Endindizes eines Bereichs.

Boundary-Konzept: ein Analogon zu Boundary(text: string, type: Enum[text, word, dev_word, regex])

Span-Konzept: ein Analogon zu Span(left_boundary: Boundary, right_boundary: Boundary). Es ermöglicht Such-/Ersetzungsoperationen wie give me the text between "my_config_param:" and ";" oder replace the text between "%my_regex_1%" and "%my_regex_2%" with "my_text".

Schreibgeschützte Werkzeuge:

  • text_file__list_allowed_directories - im Pseudocode: "text_file__list_allowed_directories() -> List[directory_path]"

  • text_file__file_content_length - im Pseudocode: "text_file__file_content_length() -> integer_characters_num"

  • text_file__read_slice - im Pseudocode: "text_file__read_slice(characters_slice) -> text"

  • text_file__file_lines_num - im Pseudocode: "text_file__file_lines_num() -> integer_lines_num"

  • text_file__read_content_by_line_range - im Pseudocode: "text_file__read_content_by_line_range(lines_slice) -> text"

  • text_file__find_text - im Pseudocode: "text_file__find_text(text, type: Enum[text, word, dev_word, regex]) -> {found, result?: {slice, lines, text}}"

  • text_file__find_all_text_occurrences - im Pseudocode: "text_file__find_all_text_occurrences(text, type: Enum[text, word, dev_word, regex], result_index_start, result_index_stop) -> List[{found, result: {slice, lines, text}}]"

  • text_file__expand_slice_to_lines - im Pseudocode: "text_file__expand_slice_to_lines(characters_slice) -> lines_slice"

  • text_file__find_span_boundaries - im Pseudocode: "text_file__find_span_boundaries(left_boundary, right_boundary) -> Tuple[left_boundary_characters_slice, right_boundary_characters_slice]"

  • text_file__find_span_between_boundaries - im Pseudocode: "text_file__find_span_between_boundaries(left_boundary, right_boundary) -> text". Beispiel: text_file__find_span_between_boundaries("my_config_param:", ";") gibt die Zeichenfolge " my_value" zurück.

  • text_file__find_span_with_boundaries - im Pseudocode: "text_file__find_span_with_boundaries(left_boundary, right_boundary) -> text". Beispiel: text_file__find_span_with_boundaries("my_config_param:", ";") gibt die Zeichenfolge "my_config_param: my_value;" zurück.

Bearbeitungswerkzeuge:

  • text_file__replace_content_by_line_range - im Pseudocode: "text_file__replace_content_by_line_range(text, lines_slice)"

  • text_file__replace_slice - im Pseudocode: "text_file__replace_slice(text, characters_slice)"

  • text_file__replace_text - im Pseudocode: "text_file__replace_slice(old_text, new_text)"

  • text_file__replace_span_between_boundaries - im Pseudocode: "text_file__replace_span_between_boundaries(text, left_boundary, right_boundary)".

  • text_file__replace_span_with_boundaries - im Pseudocode: "text_file__replace_span_with_boundaries(text, left_boundary, right_boundary)".

  • text_file__patch_spans_by_boundary_patterns - im Pseudocode: "text_file__patch_spans_by_boundary_patterns(List[Tuple[text, left_boundary, right_boundary]])".

Cengal

Basiert auf Cengal

Projekte, die Cengal verwenden

  • InterProcessPyObjects – Ein Hochleistungspaket, das eine blitzschnelle prozessübergreifende Kommunikation über gemeinsamen Speicher ermöglicht und Python-Objekte mit außergewöhnlicher Effizienz zwischen Prozessen teilt.

  • cengal_app_dir_path_finder – Ein Python-Modul, das eine einheitliche API zum einfachen Abrufen betriebssystemspezifischer Anwendungsverzeichnisse bietet und die Datenverwaltung unter Windows, Linux und macOS verbessert.

  • cengal_cpu_info – Erweiterte, zwischengespeicherte CPU-Informationen mit konsistentem Ausgabeformat.

  • cengal_memory_barriers – Schnelle plattformübergreifende Speicherbarrieren für Python.

  • flet_async – Ein Wrapper, der Flet asynchron macht und sowohl Cengal.coroutines als auch asyncio zu Flet (Flutter-basierte UI) bringt.

  • justpy_containers – Ein Wrapper um JustPy, um mehr Sicherheit und produktionsrelevante Funktionen zu JustPy (VueJS-basierte UI) hinzuzufügen.

  • Bensbach – Ein Dekompiler von Unreal Engine 3 Bytecode in ein Lisp-ähnliches Skript und ein Compiler zurück zu Unreal Engine 3 Bytecode. Entwickelt für Modding-Zwecke.

  • Realistic-Damage-Model-mod-for-Long-War – Ein Mod für das Originalspiel XCOM:EW und den Mod Long War. Erstellt mit Bensbach, das mit Cengal erstellt wurde.

  • SmartCATaloguer.com – Ein TagDB-basierter Katalog von Bildern (Tags), Musikalben (Genre-Tags) und Apps (Kategorien).

Lizenz

Copyright © 2026 ButenkoMS. Alle Rechte vorbehalten.

Lizenziert unter der Apache License, Version 2.0.

Available Tools

16 tools
text_file__expand_slice_to_linesA

Opens the text file, automatically resolving the BOM and codepage. Expands a character slice to cover complete lines and returns both the expanded character slice and selected line-number slice. Provide slices as JSON objects matching Python slice(start, stop, step); omit fields for None, and never use step 0. Token-efficient: targets specific file content or returns compact structured results to reduce unnecessary context.

Inputs: place (required), source_file_path (required).

text_file__file_content_lengthA

Opens the text file, automatically resolving the BOM and codepage. Returns the number of characters in the decoded file content. Token-efficient: targets specific file content or returns compact structured results to reduce unnecessary context.

Inputs: source_file_path (required).

text_file__file_lines_numA

Opens the text file, automatically resolving the BOM and codepage. Returns the number of lines in the decoded file content. Token-efficient: targets specific file content or returns compact structured results to reduce unnecessary context.

Inputs: source_file_path (required).

text_file__find_span_between_boundariesB

Opens the text file, automatically resolving the BOM and codepage. Finds content between matching boundary markers described by the boundary_span object and returns the inner slice, or null if not found. Token-efficient: targets specific file content or returns compact structured results to reduce unnecessary context.

Inputs: boundary_span (required), source_file_path (required), stop, start, +2 more.

text_file__find_span_boundariesA

Opens the text file, automatically resolving the BOM and codepage. Finds matching left and right boundary markers described by the boundary_span object and returns their slices. Token-efficient: targets specific file content or returns compact structured results to reduce unnecessary context.

Inputs: boundary_span (required), source_file_path (required), stop, start, +2 more.

text_file__find_span_with_boundariesB

Opens the text file, automatically resolving the BOM and codepage. Finds content plus its surrounding matching boundary markers and returns the full slice, or null if not found. Token-efficient: targets specific file content or returns compact structured results to reduce unnecessary context.

Inputs: boundary_span (required), source_file_path (required), stop, start, +2 more.

text_file__find_textA

Opens the text file, automatically resolving the BOM and codepage. Finds the first or last exact text, whole-word, or identifier-style word match within optional start/stop character offsets and returns its slice, or null if not found. Token-efficient: targets specific file content or returns compact structured results to reduce unnecessary context.

Inputs: text (required), source_file_path (required), stop, type, +7 more.

text_file__list_allowed_directoriesA

Returns the filesystem directories this server is allowed to access. File paths used by other tools must be inside one of these directories. Token-efficient: targets specific file content or returns compact structured results to reduce unnecessary context.

Inputs: no named parameters.

text_file__patch_spans_by_boundary_patternsB

Opens the text file, automatically resolving the BOM and codepage. Applies one boundary-span replacement or an ordered list of boundary-span replacements, then writes the modified content back. Token-efficient: targets specific file content or returns compact structured results to reduce unnecessary context. The file is saved with its original encoding and BOM.

Inputs: source_file_path (required), text, count, patch, +1 more.

text_file__read_content_by_line_rangeA

Opens the text file, automatically resolving the BOM and codepage. Reads complete lines selected by a Python-style line-number slice. Provide slices as JSON objects matching Python slice(start, stop, step); omit fields for None, and never use step 0. Token-efficient: targets specific file content or returns compact structured results to reduce unnecessary context.

Inputs: line_range (required), source_file_path (required).

text_file__read_sliceA

Opens the text file, automatically resolving the BOM and codepage. Allows you to read any section of the file content (or the entire content) using Python-style slicing. Provide slices as JSON objects matching Python slice(start, stop, step); omit fields for None, and never use step 0. Token-efficient: targets specific file content or returns compact structured results to reduce unnecessary context.

Inputs: slice (required), source_file_path (required).

text_file__replace_content_by_line_rangeA

Opens the text file, automatically resolving the BOM and codepage. Replaces complete lines selected by a Python-style line-number slice, then writes the modified content back. Provide slices as JSON objects matching Python slice(start, stop, step); omit fields for None, and never use step 0. Token-efficient: targets specific file content or returns compact structured results to reduce unnecessary context. The file is saved with its original encoding and BOM.

Inputs: text (required), line_range (required), source_file_path (required).

text_file__replace_sliceA

Opens the text file, automatically resolving the BOM and codepage. Replaces the content selected by a Python-style character slice, then writes the modified content back. Provide slices as JSON objects matching Python slice(start, stop, step); omit fields for None, and never use step 0. Token-efficient: targets specific file content or returns compact structured results to reduce unnecessary context. The file is saved with its original encoding and BOM.

Inputs: text (required), place (required), source_file_path (required).

text_file__replace_span_between_boundariesA

Opens the text file, automatically resolving the BOM and codepage. Replaces only the content between matching boundary markers, preserves the boundary markers, then writes the modified content back. Token-efficient: targets specific file content or returns compact structured results to reduce unnecessary context. The file is saved with its original encoding and BOM.

Inputs: text (required), boundary_span (required), source_file_path (required), count.

text_file__replace_span_with_boundariesB

Opens the text file, automatically resolving the BOM and codepage. Replaces matching boundary markers together with the content between them, then writes the modified content back. Token-efficient: targets specific file content or returns compact structured results to reduce unnecessary context. The file is saved with its original encoding and BOM.

Inputs: text (required), boundary_span (required), source_file_path (required), count.

text_file__replace_textA

Opens the text file, automatically resolving the BOM and codepage. Replaces exact substring, whole-word, or identifier-style word matches within optional start/stop character offsets, then writes the modified content back. Token-efficient: targets specific file content or returns compact structured results to reduce unnecessary context. The file is saved with its original encoding and BOM.

Inputs: new_text (required), old_text (required), source_file_path (required), stop, +8 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 16 tools

    Disambiguation4/5

    Most tools have distinct purposes, but some pairs like find_span_between_boundaries and find_span_with_boundaries could be confused. Descriptions help disambiguate.

    Naming Consistency5/5

    All tools follow a consistent `text_file__verb_phrase` pattern with snake_case, making the naming predictable and uniform.

    Tool Count5/5

    With 16 tools, the set is well-scoped for reading and refactoring text files, covering various operations without being overwhelming.

    Completeness4/5

    Core operations like reading, finding, and replacing are covered. However, missing tools for creating or deleting files limit full lifecycle management.

    Maintenance

    ActivityNo data
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      A line-oriented text file editor. Optimized for LLM tools with efficient partial file access to minimize token usage.
      6
      202
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables comprehensive file operations including reading, writing, searching, and editing files with advanced features like regex-based replacements, line-specific modifications, and directory-wide search capabilities. Provides 8 robust tools for safe file manipulation with content verification and detailed error handling.
      8
      10 npm
      2
      MIT