Local File Reader MCP server

Provides a lightweight server for reading local text files, enabling AI tools to access file content from the filesystem without leaving the conversation interface.
Back to servers
Setup instructions
Provider
sworddut
Release date
Mar 19, 2025
Language
TypeScript
Stats
7 stars

This MCP Local File Reader server enables AI models to safely access your local file system through the Model Context Protocol (MCP). It provides functionality to read files, list directory contents, and retrieve file metadata, making it easier for AI assistants to work with your local files.

Installation

You can install the MCP Local File Reader using npm:

npm install mcp-local-file-reader

Basic Usage

Running as a Command Line Tool

After installation, you can run the server directly from the command line:

npx mcp-local-file-reader

This will start an MCP node server that listens for LLM conversations and responds to file system requests.

Integration with AI Tools

Using with Windsurf

Windsurf can automatically start the MCP Local File Reader when properly configured:

  1. Add the following configuration to your Windsurf mcp_config.json file:

For Local Deployment

{
  "servers": {
    "file-tools": {
      "command": "cmd",
      "args": [
        "/c",
        "node",
        "path/to/mcp-local-file-reader/build/index.js"
      ],
      "env": {
        "FILE_TOOLS_API_KEY": ""
      }
    }
  }
}

Using NPM Deployment

{
  "servers": {
    "file-tools": {
      "command": "cmd",
      "args": [
        "/c",
        "npx",
        "mcp-local-file-reader"
      ],
      "env": {
        "FILE_TOOLS_API_KEY": ""
      }
    }
  }
}
  1. After configuring, click the hammer icon in the Windsurf dialog and select "refresh" to update the servers.

For official configuration documentation, visit: https://docs.codeium.com/windsurf/mcp

Features

Available Resources

  • List and access files in your local file system
  • Support for various file types (text and binary)
  • Automatic MIME type detection for proper content handling

Available Tools

  • read_file: Reads the content of a specified file

    • Returns full content for text files
    • Returns a summary for binary files
  • list_files: Lists all files in a specified directory

    • Returns an array of filenames
  • get_file_info: Retrieves detailed information about a file

    • Returns metadata like size, type, and creation time

Security Considerations

When using this server, please be aware that it grants AI models access to your local file system. For safety:

  • Only allow access to necessary directories
  • Avoid exposing sensitive files or directories
  • Consider adding extra security restrictions before using in production environments

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "file-tools" '{"command":"npx","args":["mcp-local-file-reader"],"env":{"FILE_TOOLS_API_KEY":""}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "file-tools": {
            "command": "npx",
            "args": [
                "mcp-local-file-reader"
            ],
            "env": {
                "FILE_TOOLS_API_KEY": ""
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "file-tools": {
            "command": "npx",
            "args": [
                "mcp-local-file-reader"
            ],
            "env": {
                "FILE_TOOLS_API_KEY": ""
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later