DE

danielpodrazka/editor-mcp

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

14 stars 5 forks 品質 66 トレンド 20MIT

ファイル操作のためのツールを提供するFastMCPで構築されたPythonベースのテキストエディタサーバー。 このサーバーでは、標準化された API でテキストファイルを読み、編集、管理することができます.

概要

ファイル操作のための強力なツールを提供するFastMCPで構築されたPythonベースのテキストエディタサーバー。 このサーバーは、LLMやAIアシスタントのコード編集精度と信頼性を大幅に向上させるユニークなマルチステップのアプローチで、標準化されたAPIを使用してテキストファイルを読み、編集、および管理することができます。 - : 絶対パスを使用して作業するためにファイルを設定します - : - スキームを使用して行番号でファイル全体を読みます - 読み込みの特定の行番号を使用してプレフィックスされた行番号で範囲を読みます - Find lineを使用してファイル内の特定のテキストを検索し、関数の定義を抽出します Python と JavaScript/JSX ファイルfind functionを使用して - : - diff プレビューで 2 段階の編集プロセス - テキストを ID 検証で選択および上書き - 選択 → オーバーライト → 確認/キャンセル パターン - Python (.py) と JavaScript/React (.js ) の Syntax をチェックするワークフローをクリーンに編集します.

概要(AI 翻訳)

ファイル操作のための強力なツールを提供するFastMCPで構築されたPythonベースのテキストエディタサーバー。 このサーバーは、LLMやAIアシスタントのコード編集精度と信頼性を大幅に向上させるユニークなマルチステップのアプローチで、標準化されたAPIを使用してテキストファイルを読み、編集、および管理することができます。

##特徴

-File Selection: 絶対パスを使用して作業するファイルを設定します

  • オペレーションを読む:
  • [skimを使用して行番号でファイル全体を読みます
  • [[read]を使用して、固定された行番号で特定の行範囲を読みます
  • [find_lineを使用してファイル内の特定のテキストを見つけます
  • Python と JavaScript/JSX ファイルの [[[T3] で関数の定義を見つけて抽出します。 -編集操作:
  • 差分プレビューで2ステップ編集プロセス
  • ID認証でテキストを選択し、上書きする
  • 選択→上書き→確認/キャセルパターンでワークフローをクリーン化
  • Python (.py) と JavaScript/React (.js, .jsx) ファイルの Syntax チェック
  • コンテンツで新しいファイルを作成する
  • ファイル管理:
  • 適切な初期化で新しいファイルを作成する
  • ファイルシステムからファイルを削除する
  • [listdirでディレクトリの内容を一覧表示する]
  • テスト サポート:

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

Editor MCP

A Python-based text editor server built with FastMCP that provides powerful tools for file operations. This server enables reading, editing, and managing text files through a standardized API with a unique multi-step approach that significantly improves code editing accuracy and reliability for LLMs and AI assistants.

Features

  • File Selection: Set a file to work with using absolute paths
  • Read Operations:
    • Read entire files with line numbers using skim
    • Read specific line ranges with prefixed line numbers using read
    • Find specific text within files using find_line
    • Find and extract function definitions in Python and JavaScript/JSX files using find_function
  • Edit Operations:
    • Two-step editing process with diff preview
    • Select and overwrite text with ID verification
    • Clean editing workflow with select → overwrite → confirm/cancel pattern
    • Syntax checking for Python (.py) and JavaScript/React (.js, .jsx) files
    • Create new files with content
  • File Management:
    • Create new files with proper initialization
    • Delete files from the filesystem
    • List directory contents with listdir
  • Testing Support:
    • Run Python tests with run_tests
    • Set Python paths for proper module resolution
  • Safety Features:
    • Content ID verification to prevent conflicts
    • Line count limits to prevent resource exhaustion
    • Syntax checking to maintain code integrity
    • Protected paths to restrict access to sensitive files

Security Risks

The editor-mcp includes powerful capabilities that come with certain security considerations:

  • Jailbreak Risk: The editor-mcp can potentially be jailbroken when reading a file that has harmful instructions embedded inside. Malicious content in files being edited could contain instructions that manipulate the AI assistant.
  • Arbitrary Code Execution: If running tests is enabled, there is a risk of arbitrary code execution through manipulated test files or malicious Python code.
  • Data Exposure: Access to file system operations could potentially expose sensitive information if proper path protections aren’t configured.

To mitigate these risks:

  1. Use the PROTECTED_PATHS environment variable to restrict access to sensitive files and directories.
  2. Disable test running capabilities in production environments unless absolutely necessary.
  3. Carefully review files before opening them, especially if they come from untrusted sources.
  4. Consider running the editor in a sandboxed environment with limited permissions.

Key Advantages For LLMs

This text editor’s unique design solves critical problems that typically affect LLM code editing:

GitHub で README 全文を見る

インストール

uvx install git+https://github.com/danielpodrazka/mcp-text-editor.git
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "text-editor": { "command": "editor-mcp", "env": { "MAX_SELECT_LINES": "100", "ENABLE_JS_SYNTAX_CHECK": "0", "FAIL_ON_PYTHON_SYNTAX_ERROR": "1", "FAIL_ON_JS_SYNTAX_ERROR": "0", "PROTECTED_PATHS": "*.env,.env*,config*.json,*secret*,/etc/passwd,/home/user/.ssh/id_rsa" } } } }