MCP File Server

by codyde

Integrations

  • Provides file system operations for the local environment, including creating files with specified content, reading file contents, and listing directory contents with detailed information.

  • Integrates with Sentry for error tracking and performance monitoring of file operations, configurable through the SENTRY_DSN environment variable.

  • Uses Zod for schema validation of file operation parameters, ensuring proper input formatting when creating files, reading files, or listing directory contents.

MCP File Server

A Model Context Protocol (MCP) server implementation providing file system operations through a standardized interface.

Overview

The MCP File Server enables AI models to perform file operations on the local file system through a standardized API. It's built using the Model Context Protocol SDK and provides tools for reading, creating, and listing files.

Features

  • Create Files: Create new files with specified content
  • Read Files: Read the contents of existing files
  • List Directory Contents: List files and directories with detailed information
  • Performance Monitoring: Built-in Sentry integration for error tracking and performance monitoring

Installation

npm install

Usage

Start the MCP File Server:

node src/index.js

The server communicates through stdin/stdout using the MCP protocol.

Available Tools

createfile

Creates a new file at the specified path with the provided content.

Parameters:

  • filePath: Path where the file should be created
  • content: Content to write to the file

Returns:

  • Success message with file path and size information

readfile

Reads the content of a file at the specified path.

Parameters:

  • filePath: Path to the file to read

Returns:

  • The content of the file

listfiles

Lists files and directories at the specified path.

Parameters:

  • path: Directory path to list contents from

Returns:

  • A markdown table containing file names, sizes, and types

Environment Variables

  • SENTRY_DSN: Sentry Data Source Name for error tracking (optional)

Dependencies

  • @modelcontextprotocol/sdk: The MCP SDK package
  • zod: Schema validation
  • @sentry/node: Error tracking and performance monitoring

Examples

Examples of how to call these tools through the MCP protocol:

{ "name": "createfile", "params": { "filePath": "example/test.txt", "content": "Hello, world!" } }
{ "name": "readfile", "params": { "filePath": "example/test.txt" } }
{ "name": "listfiles", "params": { "path": "example" } }

You must be authenticated.

A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

local-only server

The server can only run on the client's local machine because it depends on local resources.

Enables AI models to perform file system operations (reading, creating, and listing files) on a local file system through a standardized Model Context Protocol interface.

  1. Overview
    1. Features
      1. Installation
        1. Usage
          1. Available Tools
            1. createfile
            2. readfile
            3. listfiles
          2. Environment Variables
            1. Dependencies
              1. Examples

                Related MCP Servers

                • -
                  security
                  F
                  license
                  -
                  quality
                  A Model Context Protocol server that extends AI capabilities by providing file system access and management functionalities to Claude or other AI assistants.
                  Last updated -
                  3
                  TypeScript
                  • Apple
                • -
                  security
                  A
                  license
                  -
                  quality
                  A comprehensive MCP (Model Context Protocol) server for file system operations, providing Claude and other AI assistants with access to local files and directories.
                  Last updated -
                  Python
                  MIT License
                  • Apple
                  • Linux
                • -
                  security
                  A
                  license
                  -
                  quality
                  A secure Model Context Protocol server that provides controlled filesystem access within predefined directories, enabling AI models to perform file and directory operations with strict path validation.
                  Last updated -
                  29
                  7
                  TypeScript
                  MIT License
                  • Linux
                  • Apple
                • -
                  security
                  A
                  license
                  -
                  quality
                  Enables AI applications to interact with decentralized storage through a standardized Model Context Protocol interface, allowing file uploads, retrievals, and identity management.
                  Last updated -
                  7
                  TypeScript
                  Apache 2.0
                  • Linux
                  • Apple

                View all related MCP servers

                ID: lohec5qwnn