OM

oakenai/mcp-edit-file-lines

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

34 stars 7 forks 품질 66 트렌드 12MIT

사이트맵 Server는 파일을 편집합니다.

개요

TypeScript 기반 MCP 서버는 허용된 디렉토리 내의 텍스트 파일에 정확한 라인 기반 편집을 위한 도구를 제공합니다. 문자열 또는 regex 패턴 일치를 사용하여 파일에 줄 기반 편집을 만듭니다. 각 편집은 할 수 있습니다 : - 전체 라인을 대체 - 선 형식을 보존하면서 특정 텍스트 일치를 대체 - 복잡한 일치를위한 regex 패턴을 사용하여 여러 줄과 여러 편집을 처리 - 건조 실행 모드로 미리보기 변경 국가 ID: fcbf740a 이 ID를 approve edit로 사용하여 변경 사항을 적용하십시오. 2. 보존된 구조를 가진 다 선 내용 국가 ID: f2ce973f 이 ID를 approve edit로 사용하여 변경 사항을 적용하십시오. 산출: 국가 ID: f1f1d27b 이 ID를 approve edit로 사용하여 변경 사항을 적용하십시오. 4. Whitespace Preservation를 가진 윤곽 갱신 국가 ID: 20e93c34 이 ID를 approve edit로 사용하여 변경 사항을 적용하십시오.

개요(AI 번역)

TypeScript 기반 MCP 서버는 허용된 디렉토리 내의 텍스트 파일에 정확한 라인 기반 편집을 위한 도구를 제공합니다.

특징

주요 편집 도구

edit_file_lines

문자열 또는 regex 패턴 일치를 사용하여 파일에 줄 기반 편집을 만듭니다. 각 편집은 할 수 있습니다:

  • 전체 라인을 대체
  • 선 형식을 보존하는 동안 특정 텍스트 일치를 대체
  • 복잡한 일치를 위한 regex 본 사용
  • 다수 선 및 다수 편집을 취급하십시오
  • 건조 실행 모드로 미리보기 변경

예제 파일 (src/components/App.tsx):

예제 사용 사례

  1. 간단한 끈 보충

산출:

국가 ID: fcbf740a 이 ID를 approve edit로 사용하여 변경 사항을 적용하십시오.

  1. 보존된 구조를 가진 다 선 내용

산출:

국가 ID: f2ce973f 이 ID를 approve edit로 사용하여 변경 사항을 적용하십시오.

  1. 복잡한 JSX 구조 수정

산출:

국가 ID: f1f1d27b 이 ID를 approve edit로 사용하여 변경 사항을 적용하십시오.

  1. Whitespace Preservation를 가진 윤곽 갱신

산출:

국가 ID: 20e93c34 이 ID를 approve edit로 사용하여 변경 사항을 적용하십시오.

  1. 가동 가능한 Whitespace 일치

산출:

추가 도구

approve_edit

edit_file_lines]의 이전 건조 실행에서 변경을 적용합니다.

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

README

원문 README의 일부입니다. 원문 보기.

Edit File Lines MCP Server

A TypeScript-based MCP server that provides tools for making precise line-based edits to text files within allowed directories.

Features

Main Editing Tool

edit_file_lines

Make line-based edits to a file using string or regex pattern matching. Each edit can:

  • Replace entire lines
  • Replace specific text matches while preserving line formatting
  • Use regex patterns for complex matches
  • Handle multiple lines and multiple edits
  • Preview changes with dry run mode

Example file (src/components/App.tsx):

// Basic component with props
const Button = ({ color = "blue", size = "md" }) => {
  return Click me;
};

// Component with multiple props and nested structure
export const Card = ({
  title,
  subtitle = "Default subtitle",
  theme = "light",
  size = "lg",
}) => {
  const cardClass = `card-${theme} size-${size}`;
  
  return (
    
  );
};

// Constants and configurations
const THEME = {
  light: { bg: "#ffffff", text: "#000000" },
  dark: { bg: "#000000", text: "#ffffff" },
};

const CONFIG = {
  apiUrl: "https://api.example.com",
  timeout: 5000,
  retries: 3,
};

Example Use Cases

  1. Simple String Replacement
{
  "p": "src/components/App.tsx",
  "e": [{
    "startLine": 2,
    "endLine": 2,
    "content": "primary",
    "strMatch": "blue"
  }],
  "dryRun": true
}

Output:

Index: src/components/App.tsx
===================================================================
--- src/components/App.tsx        original
+++ src/components/App.tsx        modified
@@ -1,6 +1,6 @@
 // Basic component with props
-const Button = ({ color = "blue", size = "md" }) => {
+const Button = ({ color = "primary", size = "md" }) => {
   return Click me;
 };
 
 // Component with multiple props and nested structure

State ID: fcbf740a Use this ID with approve_edit to apply the changes.

  1. Multi-line Content with Preserved Structure
{
  "p": "src/components/App.tsx",
  "e": [{
    "startLine": 16,
    "endLine": 19,
    "content": "    ",
    "regexMatch": ""
  }],
  "dryRun": true
}

Output:

Index: src/components/App.tsx
===================================================================
--- src/components/App.tsx        original
+++ src/components/App.tsx        modified
@@ -13,10 +13,10 @@
   const cardClass = `card-${theme} size-${size}`;
   
   return (
     
   );
 };

State ID: f2ce973f Use this ID with approve_edit to apply the changes.

  1. Complex JSX Structure Modification
GitHub에서 전체 README 보기

설치

This server does not publish a one-line install command.

Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

{ "mcpServers": { "edit-file-lines": { "command": "node", "args": [ "/path/to/edit-file-lines/build/index.js", "<allowed-directory>" ], "env": { "MCP_EDIT_STATE_TTL": "300000" // Optional: Set custom TTL (in milliseconds) } } } }