MCP ExplorerExplorer

Mcp Filesystem

@isaacphion 10 months ago
2 MIT
FreeCommunity
AI Systems
Model Context Protocol (MCP) server with a resource for each file in a workspace

Overview

What is Mcp Filesystem

The mcp-filesystem is a Model Context Protocol (MCP) server that provides resources for each file in a workspace and sends notifications about changes to those files.

Use cases

Use cases for mcp-filesystem include real-time file monitoring in collaborative projects, integration with development tools that require file access, and automated workflows that depend on file changes.

How to use

To use mcp-filesystem, install Go, fetch the server using ‘go install’, and configure your client to reference the server with the appropriate workspace path in the client configuration file.

Key features

Key features include resource creation for each file, support for .gitignore rules, change notifications for file modifications, and MIME type detection and encoding handling.

Where to use

mcp-filesystem can be used in software development environments where file management and change tracking are essential, particularly in projects that utilize version control systems like Git.

Content

MCP Filesystem

A Model Context Protocol (MCP) server that exposes resources for each file in a working directory and sends change notifications.

Status

⚠️ Pre-beta Quality ⚠️

“It works on my machine”. Issues are welcome ❤️

Features

  • Resources: Creates one MCP resource for each file in your workspace
  • Gitignore Support: Respects .gitignore rules
  • Change Notification: Detects file changes, additions, and deletions
  • MIME Type Detection and Encoding Handling: Identifies file types and handles various text encodings

Setup

Install Go: Follow instructions at https://golang.org/doc/install

Fetch or update this server:

go install github.com/isaacphi/mcp-filesystem@latest

Add the following to your client configuration (located at ~/Library/Application Support/Claude/claude_desktop_config.json for Claude Desktop):

{
  "mcpServers": {
    "filesystem": {
      "command": "mcp-filesystem",
      "args": [
        "--workspace",
        "/path/to/your/repository"
      ]
    }
  }
}

Replace /path/to/your/repository with the absolute path to your project directory.

Usage

Your client will be able to access and reference all non-ignored files in your repository as MCP resources. Each file is registered as a separate resource with appropriate MIME type detection.

Client Requirements

Your client needs to support the following MCP features:

  • Resource Listing: The ability to list and access resources exposed by the server
  • Change Notifications: Support for receiving notifications/resources/list_changed events
  • Resource Content Access: Ability to request and render resource content with appropriate MIME types

About

This project uses:

Development

Clone the repository:

git clone https://github.com/isaacphi/mcp-filesystem.git
cd mcp-filesystem

Install dependencies:

go mod download

Build:

go build

Configure you client to use your local build:

{
  "mcpServers": {
    "filesystem": {
      "command": "/full/path/to/your/mcp-filesystem/mcp-filesystem",
      "args": [
        "--workspace",
        "/path/to/repository"
      ],
      "env": {
        "DEBUG": "1"
      }
    }
  }
}

Feedback

Please submit issues with as many details as you can.

Set the DEBUG environment variable to enable verbose logging:

Features on my radar

  • [x] Resources for each file in workspace
  • [x] .gitignore support
  • [x] Change notifications
  • [ ] Standardize MCP protocol use to work with more clients (Claude Desktop)
  • [ ] Configurable support for line numbers
  • [ ] Resource update subscriptions
  • [ ] Additional ignore patterns (beyond .gitignore)
  • [ ] Debounced notifications for high-volume file changes
  • [ ] info, create, edit, and delete tools

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers