@trelis/mcp-filesystem
v0.3.1
Published
MCP server for filesystem access
Readme
@trelis/mcp-filesystem
Enhanced MCP server for filesystem access with line range support. This is a fork of the original filesystem MCP server that adds the ability to read specific line ranges from files.
Features
- All original filesystem MCP features (read/write files, create/list/delete directories, etc.)
- Enhanced
read_filetool with line range support - Line numbers use 1-based indexing and are inclusive
- Note: File reading operations only work with text files (not binary files like PDFs or DOCx)
Installation
npm install @trelis/mcp-filesystemUsage with Claude Desktop (or Cursor or Windsurf)
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@trelis/mcp-filesystem",
"/path/to/allowed/directory"
]
}
}
}Example Usage
Read Entire File
{
"name": "read_file",
"arguments": {
"path": "/path/to/file.txt"
}
}Read Specific Lines
{
"name": "read_file",
"arguments": {
"path": "/path/to/file.txt",
"startLine": 10,
"endLine": 20
}
}Read From Start to Line
{
"name": "read_file",
"arguments": {
"path": "/path/to/file.txt",
"endLine": 50
}
}Read From Line to End
{
"name": "read_file",
"arguments": {
"path": "/path/to/file.txt",
"startLine": 100
}
}Security
The server maintains all the security features of the original filesystem MCP:
- Only allows access to specified directories
- Validates all paths
- Handles symlinks securely
- Prevents directory traversal attacks
