Filesys
Filesys is a file system MCP server built with Python, aimed at exposing file contents and metadata securely through defined endpoints. It integrates with Anthropic's Claude AI for natural language interaction, facilitating secure access to the resources.
Overview
filesys is a lightweight mcp server built with Python and the mcp library that securely exposes file contents and metadata from a preconfigured directory. The project leverages FastMCP to provide a set of endpoints that allow:
- Listing all files in a specified directory.
- Reading the contents and metadata of a specified file.
New: It now includes an integration with Anthropic's Claude AI, allowing users to interact with the file system through natural language conversation, using Claude Tools to securely access the defined MCP resources.
The project ensures safe file access by validating paths and preventing directory traversal attacks.
Installation
-
Clone the Repository:
-
Navigate to the Project Directory:
-
Create a Virtual Environment (Optional but Recommended):
-
Install Dependencies: Make sure you have Python installed. Then install the required libraries:
-
Configure API Key:
Configuration
The file server reads its configuration from config/config.json
. By default, the server operates on the directory specified below:
You can modify this file to point to a different directory if needed.
- Anthropic API Key: The Claude interaction script reads the
ANTHROPIC_API_KEY
from the.env.local
file.
Usage
-
Start the MCP Server: First, ensure the Filesys MCP server is running in a terminal:
-
Interact with Claude: In a separate terminal (while the server from step 1 is still running), run the Claude interaction script:
-
Direct MCP Requests (Optional): You can also interact with the server directly using any MCP-compatible client:
Testing
-
MCP Client Functions: You can test the functions that communicate with the MCP server by running:
-
Core Resources (if tests exist): If unit tests are created in the
tests/
directory.
Contributing
Contributions are welcome!