O
oakenai/mcp-edit-file-lines
MCP Server to make line-based edits to a file
View on GitHub ↗Link checked 2026-11-12 · HTTP 200 · opens the vendor's own site
We have neither an install command nor a public remote endpoint from this repository, so we do not print a config. A made-up one is worse than none. How each client wires MCP up →
- Source
- collected from the abordage/awesome-mcp list · type: MCP server
- Harvest history
- first seen 2026-11-05 · last seen 2026-11-14 · seen 10× · listed by 10 sources
- Score
- score 1,003 · 10 sources · mcp
FAQ (answers come from our records)
Who is it for?
We filed it under these tags: MCP 服务. The tags come from the entry itself, not a taxonomy we imposed.
Who maintains it?
first catalogued 2026-11-05;last seen 2026-11-14。There is no official certification or quality rating here — we record sources and dates only.
# Edit File Lines MCP Server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
A TypeScript-based MCP server that provides tools for making precise line-based edits to text files within allowed directories.
## Features
### Main Editing Tool
#### editfilelines
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):
typescript
// 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 (
{title}
{subtitle}
);
};
// 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
json
"p": "src/components/App.tsx",
"e": [{
"startLine": 2,
"endLine": 2,
"content": "primary",
"strMatch": "blue"
}],
"dryRun": true
Output:
diff
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 approveedit to apply the changes.
2. Multi-line Content with Preserved Structure
json
"p": "src/components/App.tsx",
"e": [{
"startLine": 16,
"endLine": 19,
"content": " \n {title} \n {subtitle} \n ",
"regexMatch": " ]>[\\s\\S]? "
}],
"dryRun": true
Output:
diff
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 (
{title}
{subtitle}
{title}
{subtitle}
);
};
State ID: f2ce973f
Use this ID with approveedit to apply the changes.
3. Complex JSX Structure Modification
json
"p": "src/components/App.tsx",
"e": [{
"startLine": 7,
"endLine": 12,
"content": "export const Card = ({\n title,\n subtitle = \"New default\",\n theme = \"modern\",\n size = \"responsive\"\n}) => {",
"regexMatch": "export const Card[\\s\\S]?\\) => \\{"
}],
"dryRun": true
Output:
diff
Index: src/components/App.tsx
===================================================================
--- src/components/App.tsx original
+++ src/components/App.tsx modified
@@ -5,11 +5,11 @@
// Component with multiple props and nested structure
export const Card = ({
title,
subtitle = "Default subtitle",
theme = "light",
size = "lg",
subtitle = "New default",
theme = "modern",
size = "responsive"
}) => {
const cardClass = card-${theme} size-${size};
return (
State ID: f1f1d27b
Use this ID with approveedit to apply the changes.
4. Configuration Update with Whitespace Preservation
json
## Features
### Main Editing Tool
#### editfilelines
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):
typescript
// 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 (
{title}
{subtitle}
);
};
// 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
json
"p": "src/components/App.tsx",
"e": [{
"startLine": 2,
"endLine": 2,
"content": "primary",
"strMatch": "blue"
}],
"dryRun": true
Output:
diff
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 approveedit to apply the changes.
2. Multi-line Content with Preserved Structure
json
"p": "src/components/App.tsx",
"e": [{
"startLine": 16,
"endLine": 19,
"content": " \n {title} \n {subtitle} \n ",
"regexMatch": " ]>[\\s\\S]? "
}],
"dryRun": true
Output:
diff
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 (
{title}
{subtitle}
{title}
{subtitle}
);
};
State ID: f2ce973f
Use this ID with approveedit to apply the changes.
3. Complex JSX Structure Modification
json
"p": "src/components/App.tsx",
"e": [{
"startLine": 7,
"endLine": 12,
"content": "export const Card = ({\n title,\n subtitle = \"New default\",\n theme = \"modern\",\n size = \"responsive\"\n}) => {",
"regexMatch": "export const Card[\\s\\S]?\\) => \\{"
}],
"dryRun": true
Output:
diff
Index: src/components/App.tsx
===================================================================
--- src/components/App.tsx original
+++ src/components/App.tsx modified
@@ -5,11 +5,11 @@
// Component with multiple props and nested structure
export const Card = ({
title,
subtitle = "Default subtitle",
theme = "light",
size = "lg",
subtitle = "New default",
theme = "modern",
size = "responsive"
}) => {
const cardClass = card-${theme} size-${size};
return (
State ID: f1f1d27b
Use this ID with approveedit to apply the changes.
4. Configuration Update with Whitespace Preservation
json
Listed badge (optional)
Copy this line into the README if you want the listing mark. Optional, and it does not affect being listed.
[](https://anclum.com/en/s/oakenai-mcp-edit-file-lines/)
- Source
- awesome · https://github.com/oakenai/mcp-edit-file-lines
- Browse by field
- MCP servers
- Listed by
- 10 independent sources
- added
- today
More like this
Filed under
Every tag opens the full list for that filter. Counts are the live catalogue figures.