File Rwle
A simple MCP server to read, write, edit, and list files inside a folder.
Ask AI about File Rwle
Powered by Claude Β· Grounded in docs
I know everything about File Rwle. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
ποΈ File_RWLE β MCP File Server
A simple Model Context Protocol (MCP) server built using Node.js that allows you to read, write, list, edit, and delete files inside a workspace folder.
π Features
- π List files inside a workspace
- π Read files with full content access
- βοΈ Write/Create files with custom content
- βοΈ Edit specific lines in existing files
- ποΈ Delete files when needed
- π§© Works seamlessly with MCP-compatible clients like Claude Desktop and Cursor
π§ How It Works
This MCP server uses the @modelcontextprotocol/sdk library to expose five powerful tools:
list_files- Lists all files in the workspaceread_file- Reads and returns file contentwrite_file- Creates or overwrites a fileedit_file- Edits specific lines in a filedelete_file- Deletes a file from the workspace
These tools can be accessed through any MCP-compatible client (like Cursor or Claude Desktop).
π¦ Quick Start (Using npm package)
The easiest way to use this MCP server is through npm:
Step 1: Add to your MCP configuration
Add this to your claude_desktop_config.json or MCP settings file:
{
"mcpServers": {
"file_rwle": {
"command": "npx",
"args": ["-y", "mcp-file-rwle"]
}
}
}
Step 2: Restart your MCP client
Restart Claude Desktop or Cursor and the server will be automatically downloaded and started!
Step 3: Use it!
Your AI assistant can now:
- Create files in your workspace
- Read and edit existing files
- List all files in the workspace
- Delete files when needed
π οΈ Local Development Setup
Want to modify or contribute? Follow these steps:
Step 1: Clone the repository
git clone https://github.com/suvidhay/File_RWLE.git
cd File_RWLE
Step 2: Install dependencies
npm install
Step 3: Test locally
npm start
The server will start and create a workspace folder in your current directory if it doesn't exist.
π§ͺ Manual Testing
You can test file operations directly in Node.js:
node
Then run these commands:
import fs from "fs";
import path from "path";
const ROOT_DIR = path.join(process.cwd(), "workspace");
// Create a test file
fs.writeFileSync(path.join(ROOT_DIR, "test.txt"), "Hello MCP!");
// List files
console.log(fs.readdirSync(ROOT_DIR)); // ['test.txt']
// Read the file
console.log(fs.readFileSync(path.join(ROOT_DIR, "test.txt"), "utf-8")); // Hello MCP!
π Publishing Your Own Version
Want to publish your modified version to npm?
Step 1: Update package.json
Change the package name to something unique:
{
"name": "your-mcp-file-server",
"version": "1.0.0",
...
}
Step 2: Login to npm
npm login
Step 3: Publish
npm publish --access public
Step 4: Use your package
{
"mcpServers": {
"my_file_server": {
"command": "npx",
"args": ["-y", "your-mcp-file-server"]
}
}
}
π Workspace Folder
- All file operations happen inside a
workspacefolder - The folder is automatically created in your current working directory
- Files are isolated to this folder for safety
π§ Configuration Locations
For Claude Desktop:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
Windows:
%APPDATA%\Claude\claude_desktop_config.json
Linux:
~/.config/Claude/claude_desktop_config.json
For Cursor:
Check Cursor's MCP settings in the application preferences.
π Troubleshooting
Server not connecting?
- Make sure you've restarted your MCP client after adding the configuration
- Check that Node.js is installed:
node --version - Verify the configuration JSON syntax is correct
Files not appearing?
- The
workspacefolder is created in the directory where the server runs - Check the working directory of your MCP client
Permission errors?
- Ensure you have write permissions in the directory
- On macOS/Linux, you might need to allow terminal access in System Preferences
π‘οΈ Available Tools
1. list_files
Lists all files in the workspace folder.
Input: None
Output: Array of filenames
2. read_file
Reads the content of a specific file.
Input:
filename(string): Name of the file to read
Output: File content as text
3. write_file
Creates a new file or overwrites an existing one.
Input:
filename(string): Name of the filecontent(string): Content to write
Output: Success confirmation
4. edit_file
Edits specific lines in an existing file.
Input:
filename(string): Name of the file to editedits(array): Array of{ line: number, newText: string }objects
Output: Success confirmation with number of lines edited
5. delete_file
Deletes a file from the workspace.
Input:
filename(string): Name of the file to delete
Output: Success confirmation
π Example Usage
Once configured, you can ask your AI assistant:
"Can you create a file called notes.txt with 'Hello World'?"
"List all files in my workspace"
"Read the contents of notes.txt"
"Edit line 1 of notes.txt to say 'Hello MCP!'"
"Delete the file notes.txt"
π€ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
π License
This project is licensed under the MIT License.
π§βπ» Author
Suvidha Yadav
- GitHub: @suvidhay
- Package: mcp-file-rwle
π Acknowledgments
- Built with @modelcontextprotocol/sdk
- Uses Zod for schema validation
