ab_mcp
Click on "Deploy 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., "@ab_mcp show me all py files in the 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.
ab_mcp — give an AI a folder, not your whole disk
I kept wanting to let Claude help with a project folder — "what's in here?", "find every TODO", "read me that config" — without giving it the keys to my entire filesystem. So I wrote this.
It's a tiny Model Context Protocol server: it
hands an AI assistant a handful of file tools, all locked to one folder you
choose. Reading is on by default; writing is off until you say otherwise.
The whole thing is a single, readable server.py — so before you trust it, you
can actually read it.
Why you might want this: "AI can read my files" and "AI can rewrite my files" are very different levels of trust. This server lets you start with the first and opt into the second only when you mean to.
What it can do
Tool | What it does |
| List files/folders under the root |
| Read a text file (size-capped) |
| Read a line range — for files too big to read whole |
| Case-insensitive text search across files |
| Find files by name/glob, e.g. |
| Line/word/char counts, or directory size |
| Create/overwrite a file — disabled unless |
Every path is confined to the root directory — requests that try to escape it
(../../etc/passwd) are rejected.
Related MCP server: MCP File System Server
Setup
cd ab_mcp
python -m venv .venv
source .venv/Scripts/activate # Windows Git Bash
# .venv\Scripts\activate # Windows PowerShell/cmd
pip install -r requirements.txtTry it standalone (dev inspector)
mcp dev server.pyThis opens the MCP Inspector in your browser so you can click each tool and see output.
Run it directly
python server.pyThe server speaks stdio — it waits for an MCP client to connect. That's normal; it won't print anything on its own.
Configuration
Everything is controlled with environment variables — no code edits needed:
Variable | Default | Purpose |
|
| Server name advertised to MCP clients |
| this project folder | The single folder all tools are confined to |
|
| Max file size (bytes) that |
|
| Default number of search hits before stopping |
|
| Characters of each matching line shown in search results |
|
| Text encoding used to read files |
| (off) | Set to |
|
| Comma-separated folders to skip |
Example — point it at any folder, allow larger files, ignore a dist dir:
AB_MCP_ROOT="/path/to/your/folder" \
AB_MCP_MAX_BYTES=500000 \
AB_MCP_IGNORE=".git,dist,build" \
python server.pyConnect it to Claude Desktop
Edit claude_desktop_config.json
(%APPDATA%\Claude\claude_desktop_config.json on Windows) and add:
Replace the paths with the absolute path to your own clone:
{
"mcpServers": {
"ab_mcp": {
"command": "C:\\path\\to\\ab_mcp\\.venv\\Scripts\\python.exe",
"args": ["C:\\path\\to\\ab_mcp\\server.py"],
"env": {
"AB_MCP_ROOT": "C:\\path\\to\\the\\folder\\to\\expose"
}
}
}
}Restart Claude Desktop. You'll see the ab_mcp tools available in the chat.
Connect it to Claude Code
claude mcp add ab_mcp -- /path/to/ab_mcp/.venv/Scripts/python.exe /path/to/ab_mcp/server.pyLicense
MIT — see the LICENSE file. Add your name to the copyright line before publishing.
Available Tools
7 toolsfile_statsA
Report quick stats for a file (lines/words/chars) or a directory (file count and total size).
Args: path: File or directory relative to the root.
Inputs: path. Returns: result
find_filesA
Find files by name pattern (glob), e.g. ".py" or "test_".
Args: pattern: A glob pattern matched against file names. subdir: Limit the search to this subdirectory. Use "." for everything.
Inputs: pattern, subdir. Returns: result
list_filesA
List files and folders inside the sandbox root (or a subdirectory).
Args: subdir: Path relative to the root. Use "." for the root itself.
Inputs: subdir. Returns: result
read_fileB
Read the contents of a text file inside the sandbox root.
Args: path: File path relative to the root.
Inputs: path (required). Returns: result
read_linesA
Read a slice of lines from a text file — useful for files too large for read_file to return whole.
Args: path: File path relative to the root. start: First line to read (1-based). end: Last line to read (inclusive). 0 means "to end of file".
Inputs: path (required), start, end. Returns: result
search_filesA
Search for a plain-text string across text files (case-insensitive).
Returns matching lines with their file path and line number.
Args: query: The text to search for. subdir: Limit the search to this subdirectory. Use "." for everything. max_results: Stop after this many matching lines. 0 uses the server default.
Inputs: query (required), subdir, max_results. Returns: result
write_fileA
Create or overwrite a text file inside the sandbox root.
Disabled unless the server was started with AB_MCP_ALLOW_WRITE enabled.
Args: path: File path relative to the root. content: The full text to write.
Inputs: path (required), content (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool has a distinct purpose: file_stats reports statistics, find_files searches by glob, list_files lists directory contents, read_file reads entire file, read_lines reads specific lines, search_files searches for text, and write_file writes content. No two tools overlap in functionality.
All tool names follow a consistent verb_noun pattern using snake_case: file_stats, find_files, list_files, read_file, read_lines, search_files, write_file. The naming is predictable and uniform.
With 7 tools, the set is well-scoped for a sandbox file system utility. It provides essential operations (read, write, list, search, find, stats) without being overly numerous or sparse.
The tool set covers core file operations well, but lacks delete, rename, or move functionality. Given the sandbox context and conditional write, these omissions are minor and do not severely hinder typical workflows.
Related MCP Connectors
Browse and manage files in your Moxt AI workspace from any MCP client.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
Persistent file storage for AI agents. Save files over MCP, get a link a human can open.
Related MCP Servers
- AlicenseAqualityDmaintenanceA Model Context Protocol (MCP) server that enables AI assistants to perform comprehensive file operations including finding, reading, writing, editing, searching, moving, and copying files with security validations.71MIT
- FlicenseNot gradedqualityDmaintenanceA secure, sandboxed file system server that enables reading, writing, searching, and managing files through MCP-compatible AI clients with path traversal protection and size limits.-
- FlicenseAqualityDmaintenanceA read-only MCP server that enables AI assistants to search files, list directories, retrieve system info, and get file metadata on the local file system.4-
- AlicenseNot gradedqualityDmaintenanceA secure MCP server that exposes local filesystem operations to AI clients with sandboxed access and runtime directory changes.1MIT