Local Filesystem MCP Server
Enables Perplexity to explore, search, and analyze local source code and project structure.
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 Filesystem MCP Serverlist files in /home/user/project"
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 Filesystem MCP Server
A production-ready Model Context Protocol (MCP) server that allows AI assistants such as ChatGPT, Claude, Cursor, Perplexity, VS Code, and other MCP-compatible clients to securely browse, search, inspect, and understand local projects.
๐ Overview
Large Language Models perform significantly better when they have structured access to a project's source code instead of relying on manually copied snippets.
This project exposes your local filesystem through the Model Context Protocol (MCP) using FastMCP and Streamable HTTP, enabling AI assistants to:
Browse project directories
Read source code
Search files
Search text across projects
Build project context
Generate project statistics
Locate definitions
Find references
Read multiple files simultaneously
Produce project outlines
Instead of uploading your project manually, the AI can explore it through dedicated MCP tools.
โจ Features
โ List directories
โ Read files
โ Read multiple files
โ Read selected line ranges
โ Read entire projects
โ Build project context
โ Generate project tree
โ Search filenames
โ Search text inside files
โ Generate project statistics
โ Extract code outline
โ Locate symbol definitions
โ Find symbol references
โ Fast recursive traversal
โ Ignore build folders automatically
โ UTF-8 safe reading
โ Streamable HTTP transport
โ Works with public tunnels (ngrok / Cloudflare)
๐ Architecture
+----------------------+
| AI Client |
| ChatGPT |
| Claude |
| Cursor |
| VS Code |
| Perplexity |
+----------+-----------+
|
| MCP
|
v
+----------------------+
| FastMCP Server |
| server.py |
+----------+-----------+
|
|
+------------------------------+
| |
v v
Filesystem Tool Layer Security Layer
|
v
+----------------------+
| Local File System |
+----------------------+
The AI client communicates with the MCP server using Streamable HTTP, and each tool performs a specific filesystem operation.
๐ Project Structure
MCP_PROJECT/
โโโ logs/
โ
โโโ tools/
โ โโโ code_outline.py
โ โโโ file_tree.py
โ โโโ find_references.py
โ โโโ list_directory.py
โ โโโ locate_definition.py
โ โโโ metadata.py
โ โโโ project_context.py
โ โโโ project_statistics.py
โ โโโ read_directory.py
โ โโโ read_files.py
โ โโโ read_lines.py
โ โโโ read_multiple_files.py
โ โโโ search_files.py
โ
โโโ config.py
โโโ filesystem.py
โโโ security.py
โโโ server.py
โโโ requirements.txt
โโโ README.md
๐ Installation
Clone the repository
git clone https://github.com/<your-username>/local-filesystem-mcp.git
cd local-filesystem-mcpCreate a virtual environment
python -m venv .venvActivate it
Windows
.venv\Scripts\activateLinux / macOS
source .venv/bin/activateInstall dependencies
pip install -r requirements.txtโถ Running the Server
Simply run
python server.pyThe default server starts on
http://localhost:8000/mcpusing the Streamable HTTP transport.
๐งช Testing with MCP Inspector
Launch the inspector
mcp dev server.pyOpen
http://localhost:6274Use
Transport
Streamable HTTPURL
http://localhost:8000/mcpPress Connect.
If successful, all registered tools will appear automatically.
๐ Exposing the Server Publicly
Although the server runs locally, it can be securely exposed over the internet using tunneling services.
Supported options include:
ngrok
Cloudflare Tunnel
Tailscale Funnel
Reverse Proxy (Nginx/Caddy)
Using ngrok
Start your MCP server
python server.pyExpose port 8000
ngrok http 8000Example output
Forwarding
https://abcd-1234.ngrok-free.app
โ
http://localhost:8000Your public MCP endpoint becomes
https://abcd-1234.ngrok-free.app/mcpThis endpoint can now be added to any MCP-compatible client.
๐ง Available Tools
The server exposes multiple MCP tools for filesystem exploration and project understanding.
Related MCP server: folder-mcp
๐ list_directory
Lists files and folders inside a directory.
Parameters
Name | Type | Description |
path | string | Directory path |
Example
{
"path":"D:/Projects"
}Returns
folders
files
relative paths
๐ read_file_tool
Reads an entire text file.
Parameters
Name | Type |
path | string |
Returns
Complete file contents๐ read_multiple_files
Reads multiple files in one request.
Example
{
"paths":[
"server.py",
"filesystem.py",
"README.md"
]
}Useful for reducing multiple MCP calls.
๐ read_lines_tool
Reads only selected lines.
Example
{
"path":"server.py",
"start":100,
"end":140
}Ideal for debugging specific code sections.
๐ read_directory
Recursively scans an entire directory and returns supported source files.
Automatically ignores
node_modules
build
dist
venv
pycache
.git
Supported languages include
Python
JavaScript
TypeScript
Java
C/C++
C#
Go
Rust
HTML
CSS
SQL
JSON
YAML
XML
Markdown
๐ณ file_tree
Generates a visual directory tree.
Example
project/
โโโ server.py
โโโ requirements.txt
โโโ tools
โ โโโ read_file.py
โ โโโ metadata.py
โ โโโ project_context.py
โโโ frontendUseful before exploring a large repository.
๐ search_files
Searches filenames recursively.
Example
invoiceReturns
invoice.py
invoice_parser.py
invoice_service.py๐ search_text
Searches text inside source code.
Example
FastMCPReturns
server.py : line 18
filesystem.py : line 62
config.py : line 11๐ง project_context
Builds an optimized context for Large Language Models.
Priority files
README.md
package.json
requirements.txt
pyproject.toml
Dockerfile
.gitignore
are loaded first.
Then the remaining source code is loaded.
This dramatically improves repository understanding.
๐ project_statistics
Returns project metrics.
Includes
total files
source files
folders
languages
lines of code
largest files
Useful for repository analysis.
๐ code_outline
Extracts
classes
functions
methods
without returning the full file.
Ideal for navigating large source files.
๐ฏ locate_definition
Locates where a function or class is defined.
Example
search
โ
search_text()Returns
filesystem.py
Line 281๐ find_references
Finds every reference to a symbol.
Example
project_contextReturns
server.py
tools/project_context.py
README.mdExcellent for code navigation.
๐ก Typical AI Workflow
Rather than immediately reading every source file, an AI assistant should follow this workflow.
file_tree()
โ
project_statistics()
โ
project_context()
โ
search_files()
โ
read_file()
โ
read_lines()
โ
find_references()
โ
locate_definition()This minimizes unnecessary data transfer while maximizing repository understanding.
๐ Security
The server is designed to expose only the directories you explicitly request.
Additional safeguards include
UTF-8 safe reading
ignored system folders
ignored virtual environments
ignored build artifacts
configurable transport security
optional DNS rebinding protection
Streamable HTTP transport
For production deployments, enable DNS rebinding protection and configure allowed hosts appropriately.
โ Configuration
Default configuration
Setting | Value |
Host | 0.0.0.0 |
Port | 8000 |
Endpoint | /mcp |
Transport | Streamable HTTP |
These values can be customized in server.py.
๐ฃ Roadmap
Planned improvements include
Git integration
Symbol indexing
AST-based code navigation
Dependency graph generation
Call graph visualization
Semantic code search
Repository summarization
Incremental indexing
Embedding support
Vector search
Workspace caching
๐ค Contributing
Contributions are welcome.
You can contribute by
Reporting bugs
Suggesting features
Improving documentation
Optimizing filesystem traversal
Adding new MCP tools
Improving cross-platform compatibility
Please read CONTRIBUTING.md before submitting pull requests.
๐ License
This project is licensed under the MIT License.
See the LICENSE file for details.
โญ Support
If you find this project useful, consider giving it a โญ on GitHub.
It helps others discover the project and motivates future development.
๐จโ๐ป Author
Developed as part of an internship project to provide secure, extensible, and AI-friendly access to local filesystems through the Model Context Protocol (MCP).
Happy Coding! ๐
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- 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/saravanarjun/local-folder-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server