Atomic Writer MCP Server
๐ Atomic Writer MCP Server: A secure file operation service that prevents data loss through atomic transactions. Built for AI integrations, collaborative editing, and critical data management.
vanzan01
README
Atomic Writer MCP Server
A secure and atomic file operation service implemented as an MCP (Model Context Protocol) server. This server provides safe, transactional file operations through the MCP protocol.
Motivation
Have you ever experienced an LLM (Large Language Model) accidentally deleting your content while trying to help? It's a common and frustrating experience - the AI confidently makes changes to your files, only to realize afterwards that it just deleted important content.
I built this system after a particularly painful experience with my Obsidian notes. While working on an integration that allowed AI to help manage my notes, I discovered that sometimes it would inadvertently wipe out half of a note's content without realizing the impact of its actions.
This led me to develop the Atomic Writer - a safety-first file operation system that prevents destructive operations by design:
- New content can only be appended, never overwritten
- Files can only be created if they don't exist and are empty
- All operations are tracked and can be rolled back
- File integrity is constantly monitored and verified
While originally built to protect against unintended AI modifications, the Atomic Writer can be used in any scenario where file safety is paramount. It's perfect for:
- AI integrations that need to modify files
- Collaborative editing systems
- Critical data management
- Any application where preventing accidental data loss is essential
Features
Core File Operations
- Create and write files with content verification
- Read files with integrity checks
- Move files to new locations atomically
- Safe file deletion with trash directory
- Append and prepend content to files
Text Manipulation
- Replace first or all occurrences of text
- Insert content at specific line numbers
- Delete specific lines
- Read specific lines or context around search terms
Safety Features
- All operations are atomic and journaled
- File integrity verification
- Automatic backup before modifications
- Trash directory for deleted files
- Lock management to prevent conflicts
- Operation rollback capability
- Automatic external file integration:
- Detects files created outside the system
- Initializes integrity tracking on first access
- Seamless integration with existing operations
System Operations
- System status monitoring
- File operation history
- Lock management
- File recovery from journal
- Integrity verification with external file support
- Automatic tracking initialization for untracked files
Installation
- Clone the repository
- Install dependencies:
npm install
- Build the project:
npm run build
- Configure the server in your MCP host's configuration
MCP Server Configuration
Add to your claude_desktop_config.json
:
{
"mcpServers": {
"atomic-writer": {
"command": "node",
"args": [
"/absolute/path/to/atomic-writer/build/index.js",
"/absolute/path/to/base/directory"
]
}
}
}
Important: The second argument ("/absolute/path/to/base/directory"
) is required and specifies where the Atomic Writer will store and manage files. This directory will contain the .atomic-writer
subdirectory with all the system files (journal, locks, etc.).
Alternatively, you can set the BASE_DIR
environment variable instead of providing the second argument.
Location of config file:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
Available Tools
The server provides these MCP tools:
File Operations
write-file
: Create new file or write to empty fileread-file
: Read file with integrity verificationdelete-file
: Move file to trash directorymove-file
: Atomically move/rename fileappend-content
: Append content to fileprepend-content
: Prepend content to file
Text Operations
replace-content
: Replace first occurrence of textreplace-all-content
: Replace all occurrences of textinsert-content-at-line
: Insert content at line numberdelete-line
: Delete specific lineread-lines
: Read specific line numbersread-around
: Read lines around search term
System Tools
verify-integrity
: Check file integrity and initialize tracking for external filesget-status
: Get system statusrecover-file
: Recover from journalget-file-history
: View operation historyget-lock-status
: Check file locksforce-release-lock
: Release stuck locksrollback-operation
: Rollback changes
Error Codes
Operations return standardized error codes:
- FILE_NOT_FOUND: File does not exist
- INVALID_PATH: Path is invalid
- EMPTY_CONTENT: Content is empty
- LINE_OUT_OF_BOUNDS: Invalid line number
- FILE_LOCKED: File is locked
- INTEGRITY_ERROR: Checksum verification failed
Directory Structure
base/
โโโ files/ # Managed files
โโโ journal/ # Operation journal
โโโ locks/ # File locks
โโโ trash/ # Deleted files
โโโ temp/ # Temporary files
Development
npm run build
: Build the TypeScript codenpm run test
: Run the test suitenpm run lint
: Run the linter
Security
- All operations are atomic and journaled
- Files are protected with locks during operations
- Content integrity is verified with checksums
- Deleted files are moved to trash instead of permanent deletion
- Operations can be rolled back if needed
- External files automatically brought under integrity protection
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
MCP Package Docs Server
Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.
Claude Code MCP
An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.
@kazuph/mcp-taskmanager
Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.
Linear MCP Server
Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.
mermaid-mcp-server
A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.
Jira-Context-MCP
MCP server to provide Jira Tickets information to AI coding agents like Cursor

Linear MCP Server
A Model Context Protocol server that integrates with Linear's issue tracking system, allowing LLMs to create, update, search, and comment on Linear issues through natural language interactions.

Sequential Thinking MCP Server
This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.