local-file-reader
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@local-file-readerlist files in the docs folder"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
local-file-reader
ローカルファイルを安全に読み取り、検索できるMCPサーバーです。
機能
list_files: ベースディレクトリ配下のファイル/フォルダ一覧を取得
read_file: テキストファイルの内容を読み取る
search_text: キーワードでテキストを検索
Related MCP server: MCP File Browser Server
セットアップ
1. 依存関係をインストール
pip install -r requirements.txt2. ベースディレクトリを準備
デフォルトでは D:\MCP_Server をベースディレクトリとして使用します。必要に応じて、このディレクトリを作成し、読み取りたいファイルを配置してください。
mkdir D:\MCP_Server3. サーバーを起動
python file_reader_mcp.py使用例
Claude に以下のようにリクエストできます:
list_files で D:\MCP_Server のファイル一覧を表示してくださいread_file で sample.txt の内容を読み取ってくださいsearch_text で "error" キーワードを検索してください設定
file_reader_mcp.py の以下の場所でベースディレクトリを変更できます:
BASE_DIR = Path(r"D:\MCP_Server").resolve()許可されるファイル拡張子
.txt.md.log.json.yaml,.yml.ini.csv
新しい拡張子を追加する場合は、ALLOWED_EXTENSIONS を編集してください:
ALLOWED_EXTENSIONS = {
".txt", ".md", ".log", ".json", ".yaml", ".yml", ".ini", ".csv", ".yourext"
}セキュリティ機能
BASE_DIR外へのアクセス禁止
ファイルサイズ上限:1MB(MAX_FILE_SIZE で変更可能)
許可された拡張子のみ読み取り可能
検索結果は最大100件まで
ツール仕様
list_files
list_files(relative_dir: str = "", pattern: str = "*") -> list[str]パラメータ:
relative_dir: ベースディレクトリからの相対パス(デフォルト: ルート)pattern: ファイル名パターン(fnmatchで評価)
例:
list_files("docs", "*.md") # docs フォルダの .md ファイル一覧read_file
read_file(relative_path: str) -> strパラメータ:
relative_path: ベースディレクトリからの相対パス
例:
read_file("config.json") # ルートの config.json を読み取る
read_file("docs/readme.md") # docs/readme.md を読み取るsearch_text
search_text(keyword: str, relative_dir: str = "") -> list[dict]パラメータ:
keyword: 検索キーワードrelative_dir: 検索対象ディレクトリ(デフォルト: ルート全体)
戻り値:
[
{
"path": "folder/file.txt",
"line": 42,
"text": "マッチした行の内容(最初の300文字)"
}
]例:
search_text("error", "logs") # logs フォルダで "error" を検索トラブルシューティング
BaseDir が見つからない
BASE_DIR に指定したディレクトリが存在することを確認してください。
ファイルが読み取り不可
ファイルの拡張子が ALLOWED_EXTENSIONS に含まれているか確認してください
ファイルサイズが 1MB を超えていないか確認してください
ファイルが UTF-8 でエンコードされていることを確認してください(そうでない場合は自動的に置換エラーで処理されます)
ACCESS_DENIED エラー
relative_path が BASE_DIR 外のファイルを指していないか確認してください。
Claude Code で local-file-reader が認識されない
.mcp.jsonがプロジェクトルートまたは~/.claude/に配置されているか確認.mcp.jsonの JSON 構文が正しいか確認(オンラインJSONバリデータで検証)argsのパスが正しく設定されているか確認:"args": ["d:/VSCode/mcpserver-sample/file_reader_mcp.py"]Claude Code(VSCode拡張)を再起動、またはウィンドウをリロード(Ctrl+Shift+P → "Reload Window")
CLI の場合は
claude mcp listで登録状況を確認
local-file-reader に接続テスト
サーバーが正しく起動しているか確認:
# テストスクリプトを実行
python test_server.pyよくある問題
Claude Code で local-file-reader が認識されない
.mcp.jsonのargsのパスが正しいか確認してくださいcommandに指定したpythonが PATH に通っているか確認してください
Claude から接続できない
.mcp.jsonの JSON 構文が正しいか確認してくださいClaude Code(VSCode拡張)を再起動、またはウィンドウをリロードしてください
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables secure filesystem operations with directory sandboxing and optional read-only mode. Supports file reading/writing, directory management, file searching, and text operations while restricting access to specified directories.Last updated12
- Flicense-qualityDmaintenanceEnables Large Language Models to safely browse and interact with local file systems through secure directory listing, file reading, and content search capabilities. Built with comprehensive security controls and high-performance handling of large directories and files.Last updated
- Flicense-qualityDmaintenanceProvides sandboxed access to local filesystem operations including directory and file management, content search with glob and regex patterns, and binary file support with configurable safety limits.Last updated
- Flicense-qualityDmaintenanceEnables 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.Last updated6
Related MCP Connectors
Search, browse, and read your Dropbox files. Find documents by name or content, list folders, and…
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
File uploads for AI agents. Upload, list, and manage files. No signup required.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/niaproject/mcpserver-sample'
If you have feedback or need assistance with the MCP directory API, please join our Discord server