Skip to main content
Glama

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" } }
Deploy Server
A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

Related MCP Servers

  • -
    security
    A
    license
    -
    quality
    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.
    Last updated -
    10
    10
    MIT License
    • Linux
  • -
    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 -
    12
    Apache 2.0
    • Linux
    • Apple
  • A
    security
    A
    license
    A
    quality
    A Model Context Protocol server that provides AI agents with secure access to local filesystem operations, enabling reading, writing, and managing files through a standardized interface.
    Last updated -
    10
    34
    22
    Apache 2.0
  • -
    security
    -
    license
    -
    quality
    A simple Model Context Protocol server that enables AI assistants to interact with local file systems, allowing them to read, write, update, and delete files within a specified project directory.

View all related MCP servers

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/codyde/mcp-file-tool'

If you have feedback or need assistance with the MCP directory API, please join our Discord server