MCP File System Agent
MCP ファイルシステムエージェント
LangChain、Ollama、FastMCP、MCP を使用して構築されたローカル エージェント型ファイルシステムアシスタント。
このプロジェクトは、LLM が MCP サーバーによって公開されたツールを自律的に選択・使用し、ファイルの読み取り、一覧表示、書き込み、検索などの操作を実行する方法を示しています。
アーキテクチャ
User
│
▼
┌─────────────────┐
│ LangChain │
│ Agent │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Ollama LLM │
│ Qwen3 1.7B │
└────────┬────────┘
│
Tool selection
│
▼
┌──────────────────────┐
│ LangChain MCP Adapter│
└──────────┬───────────┘
│
MCP / HTTP
│
▼
┌──────────────────────┐
│ FastMCP Server │
│ localhost:8000/mcp │
└──────────┬───────────┘
│
┌─────────────┼─────────────┐
▼ ▼ ▼
read_file list_files write_file
│
▼
Local File SystemRelated MCP server: OmniMCP-Container
機能
MCP ベースのツールアーキテクチャ
HTTP トランスポートを使用したローカル FastMCP サーバー
ツール呼び出しを備えた LangChain エージェント
Ollama によるローカル LLM 推論
PDF ファイルの読み取り
DOCX ファイルの読み取りと書き込み
拡張子フィルタリングによるファイル一覧表示
PDF および DOCX ファイル内の検索
LangGraph チェックポイントによる会話状態管理
LLM によるツールの自動選択
技術スタック
Python
LangChain
LangGraph
Ollama
Qwen3 1.7B
FastMCP
Model Context Protocol (MCP)
langchain-mcp-adaptersPyPDF
python-docx
プロジェクト構造
MCP/
│
├── tests/
│ └── sample.docx
│
├── fs_mcp.py
├── main.py
├── requirements.txt
└── README.mdインストール
1. リポジトリのクローン
git clone https://github.com/jibixn/File-System-Tools-MCP
cd MCP2. Python 依存関係のインストール
pip install -r requirements.txt3. Ollama のインストール
公式サイトから Ollama をインストールし、ローカルで実行されていることを確認してください。
次にモデルをプルします:
ollama pull qwen3:1.7bモデルが利用可能かどうかは次のコマンドで確認できます:
ollama listプロジェクトの実行
このプロジェクトは、MCP サーバーが HTTP 経由でクライアントと通信するため、2 つのプロセスを使用します。
ターミナル 1 — MCP サーバーの起動
プロジェクトルートから次のコマンドを実行します:
python fs_mcp.pyサーバーは次の場所で利用可能になるはずです:
http://127.0.0.1:8000/mcpターミナル 2 — エージェントの起動
プロジェクトルートで別のターミナルを開きます:
python main.pyその後、次のようなリクエストを入力できます:
Read the file in tests folder named sample.docx and provide me the summary.または:
List all PDF files in the tests folder.または:
Write "Hello, World!" to tests/output.docx.エージェントフローの例
次のようなリクエストに対して:
Read the file in tests folder named sample.docx and provide me the summary.エージェントは次の手順を実行します:
User request
│
▼
LLM analyzes request
│
▼
LLM selects read_file
│
▼
LangChain MCP Adapter
│
▼
MCP HTTP request
│
▼
FastMCP read_file()
│
▼
python-docx reads file
│
▼
Tool result returned to agent
│
▼
LLM summarizes content
│
▼
Final response要件
Python 3.11 以上を推奨します。
Ollama がインストールされ、ローカルで実行されている必要があります。
Qwen モデルが利用可能である必要があります:
ollama pull qwen3:1.7b推論プロバイダーを通じてモデルを使用することもできます。
依存関係
このプロジェクトの直接の依存関係は次のとおりです:
fastmcp==3.4.7
langchain==1.3.14
langchain-mcp-adapters==0.3.2
langchain-ollama==1.1.0
langgraph-checkpoint==4.2.0
pypdf==6.14.2
python-docx==1.2.0今後の改善点
より多くのファイル形式のサポート追加
ファイル削除およびディレクトリ作成ツールの追加
より強力なパス検証とサンドボックス化
リモート MCP サーバー向けの認証追加
ストリーミング応答の追加
よりリッチなドキュメント解析の追加
永続的な会話状態の追加
データベース、GitHub、Web 検索向けの追加 MCP サーバー
より大きなローカルモデルによるツール選択の信頼性向上
学習目標
このプロジェクトは、以下の間の相互作用を示しています:
LLM
↓
LangChain Agent
↓
Tool Calling
↓
MCP Client
↓
MCP Protocol
↓
FastMCP Server
↓
Python Functionsこれは、Model Context Protocol (MCP) とローカルでホストされた LLM を使用した エージェント型アプリケーション を構築するための実践的な例として意図されています。
This server cannot be deployed
Maintenance
Related MCP Connectors
Persistent file storage for AI agents via MCP and curl. Upload, download, and version files.
- flockfsOAuthcom.flockfs
A real-time, multiplayer filesystem for agents and humans: shared files, live edits, history.
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
Fastio gives your team and AI agents a workspace for each project, bringing source files, comments and new work together. Connect a compatible MCP client to find files, answer questions from project material, and save results where the team can review and use them. \ Sign in through Fastio and choose the workspaces the connection can reach. Read Only connections expose read tools; Read & Write connections also allow changes. \ • **Files and folders:** browse, read, upload, and organize files, with version history and trash. • **Search:** find files by keyword; search file content and meaning when Deep Indexing is enabled and files have been processed. • **Metadata:** read, set, and search metadata fields, including extracted fields where available. • **Shares:** create and manage shares for sending or collecting files. • **Comments and members:** read and add comments, and manage workspace membership within your permissions. • **Activity:** search workspace events to see what changed. \ Hosted by Fastio, with no server installation required. \ • **Claude and most MCP clients:** https://mcp.fast.io/mcp/tools • **ChatGPT:** https://mcp.fast.io/mcp/operations • **ChatGPT and Codex:** Fastio plugin • **Claude Code, Cursor and similar coding agents:** https://mcp.fast.io/mcp/code • **Setup and client-specific capabilities:** https://mcp.fast.io/docs \ Paid plans. Monthly plans include a trial of up to 30 days. A card is required, and billing begins when the trial ends or trial credits run out, whichever comes first. No free plan.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAutomates file system operations through natural language commands using a combination of LLM (Ollama), MCP tools, and a Python bridge agent.-
- AlicenseNot gradedqualityDmaintenanceA containerized MCP bridge that lets local or cloud LLMs access your filesystem and perform web searches via Ollama and FastMCP.MIT
- AlicenseNot gradedqualityDmaintenanceExperimental MCP server for local LLM orchestration with filesystem tools (read, write, list, delete files) and a CLI agent that communicates via Ollama.3 npmISC
- FlicenseAqualityDmaintenanceAn MCP server that exposes filesystem operations — listing directories, reading, writing, and searching files — as tools an LLM can discover and invoke at runtime.4-