Content
# mcp-filesystem
> **Projet 02 — Suite ModelContextProtocol**
> Niveau : Fondation
Serveur MCP qui donne à Claude un accès **contrôlé et sandboxé** au filesystem.
Aucune opération ne peut sortir du répertoire racine configuré — path traversal impossible.
## Tools exposés
| Tool | Description |
|------|-------------|
| `read_file` | Lit le contenu d'un fichier texte ou binaire (base64) |
| `write_file` | Écrit/crée un fichier (requiert `ALLOW_WRITE=true`) |
| `list_directory` | Liste les entrées d'un répertoire avec métadonnées |
| `search_files` | Recherche par glob ou contenu avec regex |
| `get_file_info` | Métadonnées : taille, dates, permissions |
## Resources MCP
Les fichiers texte du sandbox sont automatiquement exposés comme **Resources** lisibles en streaming — Claude peut les lire sans appeler un tool.
## Stack
- **SDK** : `rmcp`
- **Async** : `tokio` + `tokio::fs`
- **Transport** : `stdio`
- **Config** : `.env` — `ROOT_DIR`, `ALLOW_WRITE`
## Structure
mcp-filesystem/
├── Cargo.toml
├── .env
└── src/
├── main.rs
├── server.rs
├── sandbox.rs ← validation de chaque chemin
└── tools/
## Démarrage rapide
# .env
ROOT_DIR=/home/user/workspace
ALLOW_WRITE=false
cargo run
---
*Suite ModelContextProtocol — [FCHEHIDI](https://github.com/FCHEHIDI)*
Connection Info
You Might Also Like
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
markitdown
Python tool for converting files and office documents to Markdown.
Filesystem
Node.js MCP Server for filesystem operations with dynamic access control.
TrendRadar
TrendRadar: Your hotspot assistant for real news in just 30 seconds.
mempalace
The highest-scoring AI memory system ever benchmarked. And it's free.
mempalace
The highest-scoring AI memory system ever benchmarked. And it's free.