Skip to main content
Glama
MCP File Server
by codyde

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.

Related MCP server: filesystem-mcp-server

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"
  }
}

Available Tools

3 tools
createfileD

Inputs: content (required), filePath (required).

listfilesD

Inputs: path (required).

readfileD

Inputs: filePath (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    D1.8/5.0

    Scored across 3 tools

    Disambiguation5/5

    The three tools have clearly distinct purposes: createfile for creating files, listfiles for listing files, and readfile for reading files. There is no overlap or ambiguity between these operations, making it easy for an agent to select the right tool for each task.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern (createfile, listfiles, readfile) with no deviations. The naming is uniform and predictable, using lowercase letters and clear action-object combinations throughout.

    Tool Count3/5

    With only three tools, the server feels thin for a file management domain, as it lacks essential operations like update, delete, or write to files. While the count is minimal, it covers basic CRUD aspects but leaves notable gaps in functionality.

    Completeness2/5

    The tool set is significantly incomplete for file management, missing critical operations such as updatefile, deletefile, and writefile. This creates dead ends for agents trying to perform common file workflows, leading to potential failures in tasks requiring modification or deletion.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol (MCP) server that allows AI models to safely access and interact with local file systems, enabling reading file contents, listing directories, and retrieving file metadata.
      8 npm
      10
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables LLMs to securely read, search, and analyze local file systems through the Model Context Protocol. Provides tools for listing files, pattern-based searching, and reading file contents with built-in security validation.
      6
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables AI models to securely read, write, and query metadata of local files through a controlled file system interface, with support for local and Azure deployment.
      -