loading…
Search for a command to run...
loading…
Enables LLMs to write, append, and manage files in txt, md, csv, and xlsx formats with append, overwrite, and backup modes, restricted to a specified root direc
Enables LLMs to write, append, and manage files in txt, md, csv, and xlsx formats with append, overwrite, and backup modes, restricted to a specified root directory.
A Node.js implementation of the Model Context Protocol (MCP) designed for seamless file operations within LM Studio and other MCP-compatible environments. This server provides a robust interface for large language models to create, append, and manage files in multiple formats including Plain Text, Markdown, CSV, and Microsoft Excel (XLSX).
npm install
npm run build
To use this server in LM Studio, add it to your MCP settings with the following configuration:
{
"mcpServers": {
"file-writer": {
"command": "node",
"args": [
"C:/Users/szpon/file_writer_mcp/dist/index.js",
"--root",
"C:/your/default/directory"
]
}
}
}
--root <path>: (Required) The absolute path to the default directory for relative file operations.--overwrite: (Optional/Legacy) Provided for compatibility with older configs; ignored in favor of tool selection.--backup: (Optional/Legacy) Provided for compatibility with older configs; ignored in favor of tool selection.The server provides three distinct tools to give you clear control over file handling directly from the LM Studio sidebar:
write_file: Use this for standard operations. It appends data to existing files or creates them if they do not exist.write_file_overwrite: Use this to completely replace an existing file with new data.write_file_backup: Use this to save data while preserving the original. If the file exists, it creates a numbered backup (e.g., data.1.csv).path (string): The filename or full absolute path. If a relative path is provided, it resolves against the --root directory. If an absolute path is provided, the server writes directly to that location.format (string): The desired file extension (txt, md, csv, or xlsx).data (object):headers (string[]): Column names for table formats.rows (any[][]): The dataset to be written.content (string, optional): Plain text content for .txt files.The project uses Vitest for unit testing. To execute the test suite:
npm test
To compile the TypeScript source into the distribution directory:
npm run build
This project is provided as-is for integration with LM Studio and other MCP clients.
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"file-writer-mcp": {
"command": "npx",
"args": []
}
}
}