Skip to main content
Glama
FI-Mihej

text_file_read_and_refactor_mcp

GitHub tag (with filter) Static Badge

Static Badge Static Badge

GitHub License Static Badge

text_file_read_and_refactor_mcp MCP 服务器

文本文件读取与重构 MCP

一个对 Token 高效的 Python stdio MCP 服务器,提供安全的文本文件搜索、读取和重构工具。工具会自动解析文件的 BOM 和代码页;编辑工具会以原始编码和 BOM 保存文件。

Glama.AI

text_file_read_and_refactor_mcp MCP 服务器

GitHub 仓库

GitHub 仓库是该项目经过筛选的公开镜像。活跃开发(包括实验性代码和私人研究笔记)在私有仓库中进行;此处定期发布选定的快照。

安装

  1. 安装 uvhttps://docs.astral.sh/uv/getting-started/installation/

  2. 配置你的 MCP 客户端,通过 uvx 运行服务器:

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

Related MCP server: MCP File Context Server

工具

Slice 概念:类似于 slice(start: integer, stop: integer)——存储一个范围的起始和结束索引。

Boundary 概念:类似于 Boundary(text: string, type: Enum[text, word, dev_word, regex])

Span 概念:类似于 Span(left_boundary: Boundary, right_boundary: Boundary)。它允许进行搜索/替换操作,例如“给我 my_config_param:; 之间的文本”或“将 %my_regex_1%%my_regex_2% 之间的文本替换为 my_text”。

只读工具:

  • text_file__list_allowed_directories - 伪代码:"text_file__list_allowed_directories() -> List[directory_path]"

  • text_file__file_content_length - 伪代码:"text_file__file_content_length() -> integer_characters_num"

  • text_file__read_slice - 伪代码:"text_file__read_slice(characters_slice) -> text"

  • text_file__file_lines_num - 伪代码:"text_file__file_lines_num() -> integer_lines_num"

  • text_file__read_content_by_line_range - 伪代码:"text_file__read_content_by_line_range(lines_slice) -> text"

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

  • text_file__find_all_text_occurrences - 伪代码:"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 - 伪代码:"text_file__expand_slice_to_lines(characters_slice) -> lines_slice"

  • text_file__find_span_boundaries - 伪代码:"text_file__find_span_boundaries(left_boundary, right_boundary) -> Tuple[left_boundary_characters_slice, right_boundary_characters_slice]"

  • text_file__find_span_between_boundaries - 伪代码:"text_file__find_span_between_boundaries(left_boundary, right_boundary) -> text"。示例:text_file__find_span_between_boundaries("my_config_param:", ";") 将返回字符串 " my_value"。

  • text_file__find_span_with_boundaries - 伪代码:"text_file__find_span_with_boundaries(left_boundary, right_boundary) -> text"。示例:text_file__find_span_with_boundaries("my_config_param:", ";") 将返回字符串 "my_config_param: my_value;"。

编辑工具:

  • text_file__replace_content_by_line_range - 伪代码:"text_file__replace_content_by_line_range(text, lines_slice)"

  • text_file__replace_slice - 伪代码:"text_file__replace_slice(text, characters_slice)"

  • text_file__replace_text - 伪代码:"text_file__replace_slice(old_text, new_text)"

  • text_file__replace_span_between_boundaries - 伪代码:"text_file__replace_span_between_boundaries(text, left_boundary, right_boundary)"。

  • text_file__replace_span_with_boundaries - 伪代码:"text_file__replace_span_with_boundaries(text, left_boundary, right_boundary)"。

  • text_file__patch_spans_by_boundary_patterns - 伪代码:"text_file__patch_spans_by_boundary_patterns(List[Tuple[text, left_boundary, right_boundary]])"。

Cengal

基于 Cengal

使用 Cengal 的项目

  • InterProcessPyObjects - 高性能包,通过共享内存实现极快的进程间通信,使 Python 对象能够在进程间以卓越的效率共享。

  • cengal_app_dir_path_finder - 一个 Python 模块,提供统一的 API,用于轻松获取操作系统特定的应用程序目录,增强在 Windows、Linux 和 macOS 上的数据管理。

  • cengal_cpu_info - 扩展的、缓存的 CPU 信息,输出格式一致。

  • cengal_memory_barriers - 适用于 Python 的快速跨平台内存屏障。

  • flet_async - 一个包装器,使 Flet 异步化,并将 Cengal.coroutines 和 asyncio 引入 Flet(基于 Flutter 的 UI)。

  • justpy_containers - 围绕 JustPy 的包装器,旨在为 JustPy(基于 VueJS 的 UI)带来更高的安全性和更多生产所需的功能。

  • Bensbach - 从虚幻引擎 3 字节码反编译为类似 Lisp 的脚本,并编译回虚幻引擎 3 字节码。用于游戏模组目的。

  • Realistic-Damage-Model-mod-for-Long-War - 为原版 XCOM:EW 和模组 Long War 制作的模组。使用 Bensbach 制作,而 Bensbach 又使用 Cengal 制作。

  • SmartCATaloguer.com - 基于 TagDB 的图片(标签)、音乐专辑(流派标签)和应用程序(类别)目录。

许可证

版权所有 © 2026 ButenkoMS。保留所有权利。

根据 Apache 许可证 2.0 版授权。

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
    198
    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
    16
    1
    MIT

View all related MCP servers

Related MCP Connectors

  • Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.

  • Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.

  • MCP Server for Slima - AI Writing IDE for Novel Authors with AI Beta Reader.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/FI-Mihej/text_file_read_and_refactor_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server