Filesystem -SSE
The SSE version of the MCP service is modified from the Filesystem MCP server
claude mcp add --transport stdio ysthink-filesystem-mcp-server-sse node dist/index.js
How to use
Filesystem MCP Server SSE provides a Node.js implementation of the Model Context Protocol (MCP) for interacting with the local filesystem via SSE. It exposes a set of file-system operations (read, write, create/list/delete directories, move, search, and get metadata) through MCP-style tools such as read_file, read_multiple_files, write_file, edit_file, create_directory, list_directory, move_file, search_files, get_file_info, and list_allowed_directories. The server enforces a safety boundary by only allowing operations within directories specified via the server's startup arguments. To use it, start the server and point your MCP client at the server’s SSE endpoint. The example usage in the repository shows a local run by passing a base directory as an argument (for example a project directory) and configuring the MCP client with the appropriate baseUrl. Tools like read_file and write_file accept standard inputs (paths, contents) and will return file contents, metadata, or operation results depending on the tool. There is built-in support for dry-run style previews in edit_file operations, as well as a comprehensive search capability with pattern matching and exclusion. The server is suitable for scripts or automation that need controlled filesystem access with precise capabilities.
How to install
Prerequisites:
- Node.js 14+ (or as required by the project)
- npm (comes with Node.js)
Local installation and setup:
- Clone the repository or download the server source.
- Install dependencies:
npm install
- Build if a build step is provided (e.g., TypeScript to JavaScript):
# if a build step exists, e.g., npm run build
npm run build
- Run the server locally by passing the allowed directory as an argument:
node dist/index.js /path/to/allowed/directory
- Verify the server starts and is listening on the configured port (e.g., http://127.0.0.1:3001/sse as shown in the examples).
Docker (optional):
- Build the Docker image (example tag shown in repository):
docker build -t mcp/filesystem -f Dockerfile .
- Run the container, mounting the allowed project directory into /projects (read-write as permitted):
docker run -i --mount type=bind,src=/path/to/allowed/dir,dst=/projects -p 3001:3001 mcp/filesystem /projects
- Access the SSE endpoint (e.g., http://localhost:3001/sse) and configure your MCP client accordingly.
Configuring MCP after install:
- Create a configuration snippet that points to the server’s base URL, for example:
{
"mcpServers": {
"file_system": {
"name": "file_system",
"baseUrl": "http://127.0.0.1:3001/sse"
}
}
}
Additional notes
Notes and tips:
- The server restricts all operations to directories provided at startup; never place sensitive paths outside the allowed scope.
- Use edit_file with dryRun: true to preview changes and ensure your edit operations will apply as intended before applying them.
- When using Docker, ensure all directories you want to access are mounted into /projects (or as configured) and respect read/write permissions.
- For large directory trees, use search_files with excludePatterns to improve performance by skipping irrelevant paths.
- Maintain proper error handling in your MCP client to gracefully handle operations that fail (e.g., move_file when destination exists).
- List allowed directories via list_allowed_directories to confirm what the server can access before executing operations.
Related MCP Servers
mcp-nodejs-debugger
🐞 MCP Node.js debugger
mcp -node
MCP Server implemented in JavaScript using Node.js that demonstrates how to build an MCP server with a custom prompt and custom tools, including one that loads an environment variable from a configuration file, to integrate seamlessly with AI-assisted environments like Cursor IDE.
mcp -weather-js
Simple Weather MCP Server Example
mcp-node-omnibus
A comprehensive Model Context Protocol (MCP) server that provides advanced Node.js development tooling and automation capabilities.
gas-fakes
This repository demonstrates how to dynamically add frequently used, AI-generated Google Apps Scripts to an MCP server as permanent tools. This approach enhances security, reduces costs, and improves efficiency for Google Workspace automation using the Gemini CLI and the gas-fakes library.
mcp-template
A comprehensive Model Context Protocol (MCP) server template for Node.js with TypeScript, supporting both stdio and SSE transports