Edit File LinesSAFE
MCP Server to make line-based edits to a file.
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
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 (
{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
- 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 structureState ID: fcbf740a Use this ID with appr
f1afd5b5c386OBSERVED · 2026-10-08Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control.
claude mcp add edit-file-lines -- npx -y [email protected]
{
"mcpServers": {
"edit-file-lines": {
"command": "npx",
"args": [
"-y",
"[email protected]"
]
}
}
}Exposed tools (2)
1 read · 1 write · 0 destructive.
| Tool | Risk | Description |
|---|---|---|
approve_edit | write | Approve and apply a previously validated edit from a dry run with edit_file_lines call using its stateId. |
get_file_lines | read | Get information about specific line numbers in a file, including their content |
Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- none-observed
- Shell
- none-observed
- Dependencies
- not all pinned
- Secrets in source
- none-found
Findings (2)
.prettierignore
diff, glob, zod-to-json-schema, @ianvs/prettier-plugin-sort-imports, @jest/globals, @jest/types, @types/diff, @types/jest
Gates applied: no_behavioural_pass.
f1afd5b5c386full audit observations/trust-audit/mcp-server/oakenai__edit-file-lines.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-08 | f1afd5b5c386 | SAFE | B | 89 | first audit |
Questions
What is the Edit File Lines MCP server?
MCP Server to make line-based edits to a file.
What tools does Edit File Lines expose?
2 in total: 1 read-only, 1 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.
Is Edit File Lines safe to connect to an agent?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean server reads B.
What credentials does Edit File Lines need?
No credential environment variables were found in its source, so it appears to need none.
How does Edit File Lines run?
It speaks stdio, so it runs as a local process your client starts. It is published on npm as edit-file-lines at 0.1.0.
How current is this page?
The grade is for one exact copy of the source (f1afd5b5c386), read on 2026-10-08. The repository is watched and re-audited when it changes.