- Home
- MCP servers
- File System
File System
- python
0
GitHub Stars
python
Language
6 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"manju07-file-system-mcp-server": {
"command": "python3",
"args": [
"/absolute/path/to/file-system-mcp-server/server.py"
],
"env": {
"GOOGLE_API_KEY": "your_google_api_key_here"
}
}
}
}You can run a secure, sandboxed file system MCP server that exposes simple read and write tools to MCP clients, with a Gradio interface for interactive use. It keeps all file operations inside a sandbox directory, providing a safe way to read and write files through an MCP-enabled workflow.
How to use
You work with the server through an MCP client. Connect the client to the server, then invoke the available tools to read and write files inside the sandbox directory. All operations stay within sandbox/, and paths are resolved relative to that directory to prevent access to other parts of your system. You can ask the interface to read a file you have placed in the sandbox or to write content into a new or existing file inside sandbox/.
Common usage patterns include reading a file you’ve prepared earlier and writing new content to a file for later reference. You can also trigger a sequence of actions, such as creating directories automatically when needed and then performing a write operation, all within sandbox/.
How to install
Prerequisites: you need Python 3.8 or higher.
Step 1. Install Python and dependencies.
pip install -r requirements.txt
The main dependencies include the MCP SDK, OpenAI SDK, Gradio, and dotenv for environment management.
Step 2. Install the MCP Python SDK.
pip install git+https://github.com/modelcontextprotocol/python-sdk.git
If a packaged release is available, you can also install via PyPI.
pip install mcp
Step 3. Prepare environment variables. Create a .env file in the project root with your Google API key for Gemini integration.
GOOGLE_API_KEY=your_google_api_key_here
Step 4. Run the MCP server. Start the MCP server process that exposes the read and write tools.
python server.py
Step 5. Run the Gradio interface for interactive use with Gemini. This launches a web interface where you can issue prompts and perform file operations within the sandbox.
python app.py
Additional content
Configuration and security notes: all file operations are restricted to the sandbox/ directory. Paths are resolved relative to the sandbox to prevent access outside this directory. The sandbox directory is created automatically if it does not exist, and parent directories are created when writing files.
Environment and client setup: you store configuration like the Google API key in an environment file (GOOGLE_API_KEY) and supply an MCP client configuration to connect to the server. The client configuration demonstrates how to reference a local, stdio-based server process started via a Python command.
Usage tips: you can use the two built-in tools to interact with files inside sandbox/.
Example conceptual workflows include: reading a file named test.md located in the sandbox and writing a new file called notes.txt with content within the sandbox. All path references remain relative to sandbox/ to ensure security.
Available tools
read_file
Reads the contents of a file located inside the sandbox directory and returns the file content.
write_file
Writes content to a file inside the sandbox directory, creating any necessary parent directories automatically.