MCP Filesystem Server
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., "@MCP Filesystem Serverread all resumes in examples/ and summarize the skills"
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.
🤖 MCP Filesystem Server + LangGraph Agent
A Model Context Protocol (MCP) filesystem server + LangGraph agent for agentic resume matching.
📋 Overview
This project converts a traditional filesystem toolbox into a standardized MCP server that any MCP-compatible client (VSCode, Claude Desktop, Cursor) can connect to. It then demonstrates a real-world use case: a LangGraph resume matching agent that uses only MCP resources for filesystem access.
Key Features
🔌 Full MCP Server — JSON-RPC 2.0 compliant, stdio transport
🛠️ 6 Filesystem Tools — read, list, write, search, watch, batch
📊 Metrics Tracking — request counts, latencies, error codes
🧪 30+ Tests — unit + integration scenarios
🤖 LangGraph Agent — no direct filesystem access, all via MCP
📈 Resource Discovery —
tools/list,resources/list🔐 Security — allowed roots, size limits, format allowlist
Related MCP server: fsext-mcp-server-python
🏗️ Architecture
See docs/state_machine.md for the full state machine diagram.
┌────────────────┐ stdio ┌───────────────────┐
│ LangGraph │◄──────────►│ MCP Server │
│ Agent │ JSON-RPC │ (filesystem) │
│ + MCP Client │ 2.0 │ 6 tools │
└────────────────┘ └────────┬──────────┘
│
▼
┌─────────────────┐
│ Filesystem │
│ (allowed roots)│
└─────────────────┘🚀 Quick Start
1. Install
git clone https://github.com/PatrickSekey/mcp-filesystem-server.git
cd mcp-filesystem-server
python -m venv venv
venv\Scripts\activate # Windows
pip install -e .2. Configure
copy .env.example .env
# Edit .env and set OPENROUTER_API_KEY3. Run the MCP server standalone
python -m mcp_filesystem_server4. Run the LangGraph agent
python test_agent.py5. Run the test suite
pytest tests/ -v🔌 Connecting VSCode / Claude Desktop / Cursor
See docs/vscode_setup.md for full instructions.
Quick config:
{
"mcpServers": {
"filesystem": {
"command": "C:\\mcp-filesystem-server\\venv\\Scripts\\python.exe",
"args": ["-m", "mcp_filesystem_server"],
"cwd": "C:\\mcp-filesystem-server",
"env": { "PYTHONPATH": "C:\\mcp-filesystem-server\\src" }
}
}
}🛠️ Tools Reference
Tool | Description |
read_file | Read PDF/TXT/DOCX/MD/JSON with metadata |
list_files | List directory with extension filter |
write_file | Write with auto-create + overwrite control |
search_in_file | Case-sensitive/insensitive search with context |
watch_directory ⭐ | Bounded directory watcher |
batch_process ⭐ | Efficient multi-file processing |
🧪 Test Scenarios
8 scenarios in tests/test_scenarios.py:
Handshake and tool discovery
Read all resumes via MCP
Search for a skill inside a resume
Batch summary of resumes
Write + read round-trip
Bounded directory watch
Error handling (-32001 for missing file)
Full agent workflow via MCP
📊 Error Codes
Code | Meaning |
-32700 | PARSE_ERROR |
-32600 | INVALID_REQUEST |
-32601 | METHOD_NOT_FOUND |
-32602 | INVALID_PARAMS |
-32603 | INTERNAL_ERROR |
-32001 | FILE_NOT_FOUND |
-32002 | FILE_ACCESS_DENIED |
-32003 | UNSUPPORTED_FORMAT |
-32004 | FILE_TOO_LARGE |
-32005 | READ_ERROR |
-32006 | WRITE_ERROR |
-32007 | WATCH_ERROR |
-32008 | BATCH_ERROR |
📁 Project Structure
mcp-filesystem-server/
├── src/mcp_filesystem_server/
│ ├── server.py # Main MCP server
│ ├── json_rpc.py # JSON-RPC 2.0 handler
│ ├── resources.py # Tool discovery
│ ├── errors.py # Error codes
│ ├── metrics.py # Performance tracking
│ ├── tools/ # 6 filesystem tools
│ ├── mcp_client/ # Client wrapper
│ └── agent/ # LangGraph agent
├── tests/ # 30+ tests
├── examples/ # Sample resumes
├── docs/ # Diagrams + VSCode guide
└── README.md🎓 Assignment Deliverables
Requirement | Status |
| ✅ |
JSON-RPC 2.0 compliant | ✅ |
Resource discovery endpoints | ✅ |
| ✅ |
| ✅ |
Refactored agent using MCP | ✅ |
State machine diagram | ✅ |
Test scenarios | ✅ |
Configuration management | ✅ |
📝 License
Educational — MCP Integration assignment.
🙏 Acknowledgments
Anthropic MCP for the protocol
LangGraph for the agent framework
Available Tools
6 toolsbatch_processC
Process multiple files in a single call (read/stat/summary)
| Name | Required | Description | Default |
|---|---|---|---|
| directory | Yes | Directory containing files | |
| max_files | No | Maximum files to process | |
| operation | No | Operation to perform | summary |
| recursive | No | Recurse into subdirectories | |
| extensions | No | Filter by extensions |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full behavioral burden. It never states that all three operations are read-only (which the enum implies but is not asserted), nor what happens when max_files truncates the set, how errors on individual files are reported, or whether recursion depth is bounded. Significant gaps for a batch tool touching a whole directory.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
One short, front-loaded sentence with no padding. It is efficient, though the terseness contributes to the missing behavioral and usage detail rather than reflecting genuine completeness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a five-parameter batch tool with no annotations and no output schema, the description says almost nothing about how batching behaves, what the return shape is, or how truncation and per-file failures are surfaced. The schema covers parameter mechanics but the description leaves the operational picture incomplete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so every parameter is already documented in the schema, and the description adds only the operation list that the enum already provides. Baseline 3 is appropriate – no extra semantics such as extension filter syntax or max_files interaction are supplied.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a clear verb-plus-resource ('Process multiple files') and the parenthetical enumerates the three operations, which distinguishes it from the single-file siblings read_file and list_files. 'Process' itself is somewhat generic, but the batching scope is unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no explicit when-to-use guidance and no mention of the alternatives (read_file for one file, list_files for enumeration). The batch framing implies the use case, but the agent must infer it rather than being routed to this tool over its siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_filesC
List files in a directory with optional extension filtering
| Name | Required | Description | Default |
|---|---|---|---|
| directory | No | Directory to list | . |
| recursive | No | Recurse into subdirectories | |
| extensions | No | Filter by extensions e.g. ['.pdf', '.txt'] | |
| max_results | No | Maximum results to return |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden of behavioral disclosure and falls short: it doesn't say what happens on a nonexistent directory, whether hidden files are included, what ordering is used, or whether results are truncated at max_results. Neither the default directory ('.') nor the recursive traversal caveat is surfaced in the description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single front-loaded sentence with no filler. It is efficient, though the brevity is partly the source of the specification gaps noted elsewhere.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 4-parameter tool with no annotations and no output schema, the description omits the return shape (paths vs. objects), behavior when max_results truncates, and error/edge-case handling. An agent could invoke it, but not predict its output or limits.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so directory, recursive, extensions, and max_results are already documented in the schema, including the extension-format example. The description adds no semantics beyond what the schema provides, so the baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and resource ('List files in a directory') and adds the scoping qualifier 'with optional extension filtering'. It is clear on its own, but does not distinguish itself from siblings such as search_in_file or watch_directory, so an agent must infer the boundary.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no guidance on when to use this tool versus search_in_file (content search), read_file, or watch_directory. No prerequisites, exclusions, or conditions are stated; usage is only implied by the name.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read_fileC
Read PDF, TXT, DOCX, MD, JSON files with rich metadata
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Path to the file to read |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden, yet it only hints at 'rich metadata' without describing the return shape. It says nothing about encoding, file-size limits, binary handling, error behavior for unsupported formats, or permission requirements.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single, front-loaded sentence with no wasted words; the verb and supported formats appear immediately. It is efficient, though the trailing 'with rich metadata' phrase is somewhat vague rather than informative.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple one-parameter read tool with no output schema and low complexity, this is roughly adequate. Missing behavioral detail (error handling, size limits, metadata contents) is somewhat excused by the tool's simplicity but leaves gaps an agent would benefit from.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% for the single file_path parameter, so the schema already documents it. The description adds no path format or relative/absolute semantics beyond what the schema provides, making the baseline 3 appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb ('Read') and resource ('files') and enumerates supported formats (PDF, TXT, DOCX, MD, JSON). It implicitly distinguishes itself from write_file, list_files, and search_in_file by being the content-retrieval tool, though it never names those siblings explicitly.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no guidance on when to use this versus search_in_file (reading to search vs reading to view) or how it relates to batch_process. No exclusions, no prerequisites, no context for choosing this over alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_in_fileA
Search for a query inside a file, returning matches with context
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query | |
| file_path | Yes | File to search | |
| max_results | No | Maximum matches to return | |
| context_lines | No | Lines of context around each match | |
| case_sensitive | No | Case-sensitive search |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses that matches are returned with context, which is behavioral value, but says nothing about read-only nature, behavior on no matches, large/binary file handling, or whether the query is literal versus a regex/pattern.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single front-loaded sentence with no filler: verb, resource, and output shape. Every clause earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no annotations and no output schema, the description covers the essentials but leaves gaps an agent would want: matching semantics (literal vs regex), what happens when nothing matches, and how very large files are handled. Adequate, not complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% and all five parameters (query, file_path, max_results, context_lines, case_sensitive) carry their own descriptions with defaults. The description adds no syntax, matching-mode, or default information beyond the schema, so the baseline of 3 is correct.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb (search), resource (a file), and the key input (a query), plus the shape of the result. An agent can tell it apart from read_file and list_files by the search semantics, though no sibling is named explicitly.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is implied by the name and description — find text within one file — but there is no explicit when-to-use guidance, no mention of when read_file (fetch the whole file) or batch_process (multi-file scanning) would be preferable, and no preconditions such as the file needing to exist.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
watch_directoryC
Watch a directory for changes over a fixed duration (MCP-bound watcher)
| Name | Required | Description | Default |
|---|---|---|---|
| directory | Yes | Directory to watch | |
| extensions | No | Filter by extensions e.g. ['.pdf'] | |
| poll_interval | No | Polling interval in seconds | |
| duration_seconds | No | How long to watch |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full behavioral burden and largely fails: it does not say whether the call blocks for the whole duration, what it returns (no output schema exists), how it behaves on timeout, or whether it reports a change count or event list. The parenthetical '(MCP-bound watcher)' is jargon that adds little operational meaning.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single sentence with the key constraint (fixed duration) front-loaded and no wasted clauses. The trailing '(MCP-bound watcher)' parenthetical is the one element that does not clearly earn its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a blocking, no-annotations, no-output-schema tool, the description is too thin: an agent cannot tell what it receives back, whether the call hangs for the duration, or how changes are surfaced. The schema covers inputs, but the behavioral contract of a watcher is left unspecified.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so directory, extensions, poll_interval, and duration_seconds are all documented in the schema itself. The description adds no syntax, units, or default details beyond what the schema already provides, making the baseline 3 appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb ('Watch') and resource ('directory') and adds scope ('over a fixed duration'), so an agent can distinguish it from read_file/list_files/write_file. It does not explicitly name a sibling or contrast itself with them, but the watcher semantics are unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No when-to-use guidance, no prerequisites, and no alternatives are named among the five siblings. The phrase 'over a fixed duration' implies the tool is bounded rather than long-lived, but the agent must infer when polling a directory is preferable to list_files or search_in_file.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
write_fileC
Write content to a file with automatic directory creation
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | Content to write | |
| file_path | Yes | Target file path | |
| overwrite | No | Allow overwriting existing files | |
| create_dirs | No | Auto-create parent directories |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are supplied, so the description carries the full behavioral burden. It states automatic directory creation (which the schema's create_dirs default already implies) but says nothing about what happens when the target file already exists, whether writes are atomic/truncating, or what errors to expect.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single front-loaded sentence with no filler. It is terse to the point of under-specification, but nothing is wasted.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 4-parameter write tool with no annotations and no output schema, the description omits critical context: the overwrite/error behavior, return value, and any destructive implications of overwriting existing content. An agent cannot tell from the description alone how to write safely.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so all four parameters are already documented, including the defaults for overwrite and create_dirs. The description adds no parameter-level meaning beyond the schema, so the baseline of 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description gives a specific verb+resource ('Write content to a file') and adds a scope note about directory creation. It does not distinguish itself from siblings like batch_process, though the read-oriented siblings make the write role fairly evident.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use write_file versus alternatives such as batch_process or when not to use it. There is no mention of prerequisites, permissions, or the fact that an existing file will fail unless overwrite is set.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
6 tool updates
v0.1.0- First observed
batch_process - First observed
list_files - First observed
read_file - First observed
search_in_file - First observed
watch_directory - First observed
write_file
TDQS
Scored across 6 tools
Most tools target distinct actions (read, list, write, search, watch), but batch_process overlaps with read_file and list_files by performing multi-file reads and summaries, creating minor ambiguity about when to use it versus the single-file tools.
All names use snake_case and mostly follow a verb_noun pattern (read_file, list_files, write_file, search_in_file, watch_directory). batch_process deviates slightly from verb_noun order, but the convention remains readable.
Six tools is well-scoped for a filesystem server, with each tool covering a distinct operation (read, list, write, search, watch, batch) and no redundant endpoints.
Core read/write/search/list/watch workflows are present, but the filesystem surface lacks common operations like delete, move/rename, and copy. These are notable gaps for a general filesystem server.
Maintenance
Related MCP Connectors
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Persistent file storage for AI agents via MCP and curl. Upload, download, and version files.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA lightweight, stdio-based MCP server enabling AI assistants to perform local file system operations like reading, writing, searching, and executing commands.2,994 npmMIT
- AlicenseCqualityBmaintenanceA full-featured secure MCP server for local file system operations, with built-in image processing, OCR and media tools. Fully compliant with the official Model Context Protocol specification, offering standardized request/response schemas, large-file streaming I/O, multi-transport remote deployment, and comprehensive text search & replace functionality for LLM agent integration.22Apache 2.0
- FlicenseAqualityCmaintenanceAn MCP server that exposes filesystem operations — listing directories, reading, writing, and searching files — as tools an LLM can discover and invoke at runtime.4-
- AlicenseNot gradedqualityAmaintenanceThe fastest, most capable filesystem MCP server built in Rust, giving AI agents superpowers to read, search, edit, and manage files and directories.11Apache 2.0