MCP File Server

local-only server

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

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 ファイルサーバー

標準化されたインターフェースを通じてファイル システム操作を提供するモデル コンテキスト プロトコル (MCP) サーバー実装。

概要

MCPファイルサーバーは、AIモデルが標準化されたAPIを介してローカルファイルシステム上でファイル操作を実行できるようにします。モデルコンテキストプロトコルSDKを使用して構築されており、ファイルの読み取り、作成、一覧表示のためのツールを提供します。

特徴

  • ファイルの作成: 指定した内容で新しいファイルを作成します
  • ファイルの読み取り: 既存のファイルの内容を読み取る
  • ディレクトリの内容の一覧表示: 詳細情報を含むファイルとディレクトリの一覧表示
  • パフォーマンス監視: エラー追跡とパフォーマンス監視のための組み込み Sentry 統合

インストール

npm install

使用法

MCP ファイル サーバーを起動します。

node src/index.js

サーバーは、MCP プロトコルを使用して stdin/stdout を介して通信します。

利用可能なツール

ファイルを作成する

指定されたパスに指定されたコンテンツを含む新しいファイルを作成します。

パラメータ:

  • filePath : ファイルを作成するパス
  • content : ファイルに書き込むコンテンツ

戻り値:

  • ファイルパスとサイズ情報を含む成功メッセージ

ファイルの読み取り

指定されたパスにあるファイルの内容を読み取ります。

パラメータ:

  • filePath : 読み取るファイルへのパス

戻り値:

  • ファイルの内容

リストファイル

指定されたパスにあるファイルとディレクトリを一覧表示します。

パラメータ:

  • path : 内容をリストするディレクトリパス

戻り値:

  • ファイル名、サイズ、タイプを含むマークダウンテーブル

環境変数

  • SENTRY_DSN : エラー追跡用の Sentry データ ソース名 (オプション)

依存関係

  • @modelcontextprotocol/sdk : MCP SDK パッケージ
  • zod : スキーマ検証
  • @sentry/node : エラー追跡とパフォーマンス監視

MCP プロトコルを通じてこれらのツールを呼び出す方法の例:

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

標準化されたモデル コンテキスト プロトコル インターフェースを介して、AI モデルがローカル ファイル システムでファイル システム操作 (ファイルの読み取り、作成、一覧表示) を実行できるようにします。

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