Text MCP Server

Token-efficient Python stdio MCP server for safe text-file search, reading, and refactoring with automatic BOM/codepage handling.

Local serverstdioPython

What is the Text MCP server?

If you already use Text, the text mcp server is the piece that lets your assistant work with it directly. Token-efficient Python stdio MCP server for safe text-file search, reading, and refactoring with automatic BOM/codepage handling.

What the server does

Token-efficient Python stdio MCP server exposing safe text-file search, reading, and refactoring tools. Tools automatically resolve the file BOM and codepage; edit tools save files with their original encoding and BOM.

Available tools

The toolset is worth reading before you wire it up, because it tells you what the integration is really for:

  • text_file__list_allowed_directories — in pseudocode: "text_file__list_allowed_directories() -> List[directory_path]"
  • text_file__file_content_length — in pseudocode: "text_file__file_content_length() -> integer_characters_num"
  • text_file__read_slice — in pseudocode: "text_file__read_slice(characters_slice) -> text"
  • text_file__file_lines_num — in pseudocode: "text_file__file_lines_num() -> integer_lines_num"
  • text_file__read_content_by_line_range — in pseudocode: "text_file__read_content_by_line_range(lines_slice) -> text"
  • text_file__find_text — in pseudocode: "text_file__find_text(text, type: Enum[text, word, dev_word]) -> characters_slice"
  • text_file__expand_slice_to_lines — in pseudocode: "text_file__expand_slice_to_lines(characters_slice) -> lines_slice"
  • text_file__find_span_boundaries — in pseudocode: "text_file__find_span_boundaries(left_boundary, right_boundary) -> Tuple[left_boundary_characters_slice
  • text_file__find_span_between_boundaries — in pseudocode: "text_file__find_span_between_boundaries(left_boundary, right_boundary) -> text". Example
  • text_file__find_span_with_boundaries — in pseudocode: "text_file__find_span_with_boundaries(left_boundary, right_boundary) -> text". Example
  • text_file__replace_content_by_line_range — in pseudocode: "text_file__replace_content_by_line_range(text, lines_slice)"
  • text_file__replace_slice — in pseudocode: "text_file__replace_slice(text, characters_slice)"

Installation

Setup follows the usual MCP pattern — install or clone the server, register it in your client's configuration file, restart the client. The configuration blocks on this page cover the common clients.

Where it fits

Plenty of developer tooling servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. Text's toolset — text_file__list_allowed_directories, text_file__file_content_length, text_file__read_slice and 11 more — is a fair guide to whether it matches your workflow.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Worth knowing first

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 14 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Text.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
text_file__list_allowed_directoriesin pseudocode: "text_file__list_allowed_directories() -> List[directory_path]"
text_file__file_content_lengthin pseudocode: "text_file__file_content_length() -> integer_characters_num"
text_file__read_slicein pseudocode: "text_file__read_slice(characters_slice) -> text"
text_file__file_lines_numin pseudocode: "text_file__file_lines_num() -> integer_lines_num"
text_file__read_content_by_line_rangein pseudocode: "text_file__read_content_by_line_range(lines_slice) -> text"
text_file__find_textin pseudocode: "text_file__find_text(text, type: Enum[text, word, dev_word]) -> characters_slice"
text_file__expand_slice_to_linesin pseudocode: "text_file__expand_slice_to_lines(characters_slice) -> lines_slice"
text_file__find_span_boundariesin pseudocode: "text_file__find_span_boundaries(left_boundary, right_boundary) -> Tuple[left_boundary_characters_slice, right_boundary_characters_slice]"
text_file__find_span_between_boundariesin pseudocode: "text_file__find_span_between_boundaries(left_boundary, right_boundary) -> text". Example: text_file__find_span_between_boundaries("my_config_param:", ";") will return string " my_value".
text_file__find_span_with_boundariesin pseudocode: "text_file__find_span_with_boundaries(left_boundary, right_boundary) -> text". Example: text_file__find_span_with_boundaries("my_config_param:", ";") will return string "my_config_param: my_value;".
text_file__replace_content_by_line_rangein pseudocode: "text_file__replace_content_by_line_range(text, lines_slice)"
text_file__replace_slicein pseudocode: "text_file__replace_slice(text, characters_slice)"
text_file__replace_textin pseudocode: "text_file__replace_slice(old_text, new_text)"
text_file__replace_span_between_boundariesin pseudocode: "text_file__replace_span_between_boundaries(text, left_boundary, right_boundary)".

How to install the Text MCP server

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

Configuration as documented by the project. Restart the client after saving.

Example prompts to try

  • Use Text to text file list allowed directories.
  • Use Text to text file file content length.
  • Use Text to text file read slice.

Frequently asked questions

It connects Text to MCP-compatible AI assistants such as Claude and Cursor, exposing 14 tools (text_file__list_allowed_directories, text_file__file_content_length, text_file__read_slice, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Text directly.