O
oakenai/mcp-edit-file-lines
MCP Server to make line-based edits to a file
在 GitHub 查看 ↗链接已于 2026-11-12 核查 · HTTP 200 · 打开的是厂商自己的官网
我们没有从该仓库取到可核对的安装命令,也没有公开的远端端点。这两样都没有时,我们不出配置——编一条出来比不给更糟。 各客户端的接法 →
- 来源明细
- 收录自 abordage/awesome-mcp 榜单(我们从中收集的条目之一) · 条目类型:MCP 服务
- 收录与活跃
- 收录于 2026-11-05 · 最近见到 2026-11-14 · 共见到 10 次 · 被 10 个来源列出
- 评分构成
- 综合分 1,003 · 10 个来源 · mcp
常见问题(答案都来自我们的记录)
它适合谁 / 用来做什么?
我们把它归在这些标签下: MCP 服务。标签来自条目自身,不是我们强加的分类。
谁维护它、还在更新吗?
我们收录于 2026-11-05;最近见到 2026-11-14。这里没有"官方认证"或"质量评级"——我们只记录来源与时间。
# 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
收录徽章(可选)
想把收录标记放进 README 就复制这行,可选,不影响收录。
[](https://anclum.com/zh/s/oakenai-mcp-edit-file-lines/)
- 来源
- awesome · https://github.com/oakenai/mcp-edit-file-lines
- 按领域浏览
- MCP 服务
- 收录来源
- 10 个独立来源
- 收录于
- 今天
同类推荐
所属领域与标签
每个标签都能点进去看同类的全部条目。数字是当前库里的真实条数。