folder_stats
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., "@folder_statscount files and folders in /home/user/project recursively"
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 MCP: Folder/File Counter
This is a simple Model Context Protocol (MCP) server written in Python using the official mcp SDK (specifically FastMCP). It provides a single tool called get_folder_stats that allows LLMs to retrieve the number of files and folders within a given directory, both recursively and non-recursively.
Features
Non-recursive count (default): Lists and counts files and subdirectories directly inside the target path.
Recursive count (optional): Counts all files and folders in nested subdirectories when
recursive=true.Error handling: Returns clear JSON error messages for invalid paths, missing directories, or permission issues.
Related MCP server: File Operations MCP Server
Setup Instructions
Install dependencies: Make sure you have Python installed, then install the required
mcppackage:pip install -r requirements.txtTest the server (optional): You can run the server directly to make sure it executes without errors. It will wait for MCP JSON-RPC messages via standard input/output.
python server.py(Press
Ctrl+Cto exit)
Registering with Claude Desktop
To use this tool locally with Claude, you need to add it to your Claude Desktop configuration.
Open your Claude Desktop config file:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.json
Add the following entry to your
mcpServersobject. ReplaceYOUR_ABSOLUTE_PATHwith the full path to where you saved this project.
{
"mcpServers": {
"folder_stats": {
"command": "python",
"args": [
"YOUR_ABSOLUTE_PATH/server.py"
]
}
}
}Note: You may need to use the absolute path to your Python executable instead of just "python" if Claude has trouble finding it.
Example Tool Usage
Input arguments from Claude:
{
"path": "./sample_folder",
"recursive": true
}Output returned to Claude (JSON string):
{
"path": "C:\\path\\to\\sample_folder",
"total_files": 2,
"total_folders": 1,
"files": [
"data.txt",
"image.png"
],
"folders": [
"subfolder"
],
"recursive_total_files": 5,
"recursive_total_folders": 3
}This server cannot be installed
Maintenance
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/dakshhgondaliyaa/mcp-folder-stats'
If you have feedback or need assistance with the MCP directory API, please join our Discord server