Filesystem Watcher MCP
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., "@Filesystem Watcher MCPWatch /home/user/projects for modified .py files"
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.
Filesystem Watcher MCP
filesystemwatcher-mcp lets your AI coding agent (Gemini, Claude, Cursor, Copilot, etc.)
watch directories for live file-system changes. It acts as a
Model Context Protocol (MCP) server, giving your
agent event-driven access to file creations, modifications, deletions, and moves —
without busy-polling.
Key features
Event-driven file watching: Uses Watchdog for cross-platform native OS events (
inotify,FSEvents,ReadDirectoryChangesW).Safe by design: Blocks watching system-critical paths on Windows, macOS, and Linux. Strict path guardrails are enforced server-side.
Flexible filtering: Filter events by file extension, glob pattern, or event type (
created,modified,deleted,moved).Debounced events: Rapid successive events on the same file are coalesced over a 500 ms window — no duplicate noise.
Consume-once semantics:
poll_eventsdrains the queue, making it easy to integrate into agent loops.Explicit error surfacing: All failure modes (permission denied, OS backend crash, watch limit) return structured
{"success": false, "error": "..."}responses rather than crashing silently.
Related MCP server: File Operations MCP Server
Requirements
Getting started
Add the following config to your MCP client:
{
"mcpServers": {
"filesystemwatcher": {
"command": "uv",
"args": ["run", "python", "src/server.py"]
}
}
}Make sure you have cloned the repository and installed dependencies (uv sync) before pointing your MCP client at the server.
MCP Client configuration
To use the Filesystem Watcher MCP server, follow the instructions from Antigravity's docs to install a custom MCP server. Add the following config to the MCP servers config:
{
"mcpServers": {
"filesystemwatcher": {
"command": "uv",
"args": ["run", "python", "src/server.py"]
}
}
}Use the Claude Code CLI to add the server (guide):
claude mcp add filesystemwatcher --scope user uv run python src/server.pyFollow the MCP install guide and use the standard config from above.
Go to Cursor Settings -> MCP -> New MCP Server. Use the config provided above.
gemini mcp add filesystemwatcher uv run python src/server.pyAlternatively, follow the MCP guide and use the standard config from above.
Your first prompt
Enter the following prompt in your MCP client to check if everything is working:
Watch my home directory for any new file creations and tell me when something appears.Your agent should call watch_directory and then periodically call poll_events to report changes.
Tools
File system watching (4 tools)
watch_directory
Start watching a directory for file system events. Returns a watch_id used to identify this watch session.
Argument | Type | Default | Description |
|
| required | Absolute path to the directory to watch |
|
|
| Also watch all subdirectories |
|
|
| Filter by extension, e.g. |
|
|
| Glob pattern matched against file name, e.g. |
|
|
| Glob patterns to exclude, e.g. |
|
|
| Subset of |
Error responses — on failure success is false and error explains why:
Condition | Example error |
Path blocked by safety guardrails |
|
Process lacks read permission |
|
OS watcher backend failed to start |
|
Concurrent watch limit reached |
|
poll_events
Drain and return queued file system events (consume-once semantics).
Argument | Type | Default | Description |
|
|
| Filter events by watch ID; if omitted, all watches are drained |
|
|
| Maximum events to return (1–500) |
If watch_id is provided but does not match any active watch, the response includes a warning field to prevent agents from silently spinning on a stale ID:
{
"count": 0,
"events": [],
"warning": "No active watch found with id 'abc-123'. Use list_active_watches to see current watch IDs."
}list_active_watches
Return a summary of all currently active watches.
unwatch
Stop and remove a watch by watch_id.
Configuration
The server currently has no command-line flags; all configuration is done via the tool arguments at runtime.
You can inspect available tools interactively with the MCP Inspector:
npx @modelcontextprotocol/inspector mcp dev src/server.pySafety guardrails
The server blocks watching dangerous system paths:
Platform | Blocked (exact) | Blocked (subtree) |
Windows |
|
|
Linux |
|
|
macOS |
|
|
Watching C:\Users or /home directly is also blocked; individual user home directories are allowed.
Concurrent watch limit: A maximum of 50 active watches are allowed at any time to prevent exhausting the OS inotify quota. Call unwatch to free a slot before creating a new one.
The MCP server exposes file-system event data to MCP clients. Avoid watching directories that contain sensitive or personal data you would not want shared with your AI agent.
Debouncing
Events are coalesced over a 500 ms window per (event_type, path) key. Rapid
successive events on the same file (e.g. multiple writes during a save) are
reported as a single event.
Development
# Clone and install dependencies
git clone https://github.com/your-org/filesystemwatcher-mcp
cd filesystemwatcher-mcp
uv sync
# Run the server directly
uv run python src/server.py
# Run with MCP Inspector
npx @modelcontextprotocol/inspector mcp dev src/server.py
# Run tests
uv run pytest
# Security audit
uv run pip-auditKnown limitations
Only local file systems are supported; network mounts may not deliver native OS events reliably.
The server must be restarted to pick up changes to ignored/blocked path configuration.
Available Tools
4 toolslist_active_watchesA
Return a list of all currently active directory watches.
Each entry includes the watch_id, path, recursive flag,
and created_at Unix timestamp.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It describes the output fields but does not disclose read-only nature, authentication needs, or any side effects. The tool name implies read-only behavior, but this is not explicit.
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?
The description is two sentences, front-loaded with the purpose, then listing output fields. No wasted words.
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 list tool with no parameters and an output schema, the description covers the essential return fields. It lacks mention of how this relates to sibling tools like watch_directory, but overall is complete for its complexity.
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?
There are no parameters, so the schema coverage is trivially 100%. Baseline for zero parameters is 4, and the description does not need to add parameter information.
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 clearly states the tool returns a list of active directory watches and specifies the fields included in each entry. It distinguishes from sibling tools like poll_events, unwatch, and watch_directory by focusing on listing active watches.
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 is provided on when to use this tool versus alternatives. The description does not mention prerequisites, exclusions, or context for selecting this tool over siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
poll_eventsA
Drain and return queued file system events.
Events are removed from the queue once returned (consume-once semantics). Call repeatedly to receive all pending events.
| Name | Required | Description | Default |
|---|---|---|---|
| watch_id | No | Optional watch_id to filter results. If omitted, events from all active watches are returned. | |
| max_events | No | Maximum number of events to return in a single call (1–500, default 50). |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description must disclose behavioral traits. It covers consume-once semantics and the need to call repeatedly, but omits details like blocking/non-blocking, rate limits, or error conditions. This is adequate but not comprehensive.
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?
The description is two concise sentences that front-load the core purpose and add necessary usage guidance with no redundancy.
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?
The description covers core behavior (consume-once, repeated calls, optional filters). The presence of an output schema (not shown) reduces the need to describe return values. Slightly lacking in edge-case details, but sufficient for a polling tool.
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 coverage is 100%, so the description adds no new meaning beyond the parameter descriptions in the input schema. Baseline score of 3 applies as the schema already documents parameters fully.
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 explicitly states the action ('Drain and return') and the resource ('queued file system events'), and clearly differentiates from sibling tools that manage watches (list_active_watches, unwatch, watch_directory).
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?
The description advises calling repeatedly to receive all events, which implies polling behavior. While it doesn't explicitly contrast with siblings, the context of the tool name and siblings makes usage clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
unwatchB
Stop and remove an active directory watch.
| Name | Required | Description | Default |
|---|---|---|---|
| watch_id | Yes | The watch_id returned by watch_directory. |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description only states the action without revealing side effects, reversibility, or behavior like stopping event delivery. With no annotations, the description bears the full burden and provides minimal transparency.
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 concisely communicates the tool's purpose with no unnecessary words.
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 tool with one parameter and a clear output schema, the description is adequate but lacks completeness in terms of usage context, side effects, and error conditions.
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?
The schema covers 100% of parameters with a description that matches the tool's description. The description adds no new semantic value beyond the schema, meeting the baseline for high schema coverage.
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 explicitly states the verb 'stop and remove' and the resource 'active directory watch', making the tool's purpose clear and distinct from siblings: watch_directory creates, list_active_watches lists, poll_events polls events.
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 is provided on when to use this tool versus alternatives, or on prerequisites such as the watch being active. The agent must infer usage from context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
watch_directoryB
Start watching a directory for file system events.
Returns a watch_id that can be used with poll_events and unwatch.
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path to the directory to watch. | |
| recursive | No | If True, also watch all subdirectories recursively. | |
| extensions | No | Optional list of file extensions to include, e.g. [".py", ".js"]. If omitted, all extensions are reported. | |
| pattern | No | Optional glob pattern matched against the file *name*, e.g. "*.log". Applied in addition to (not instead of) the extensions filter. | |
| ignore_patterns | No | Optional glob patterns to exclude, e.g. ["*.tmp", ".git/*"]. Matched against both the file name and its full path. | |
| event_types | No | Optional subset of event types to report. Valid values: "created", "modified", "deleted", "moved". If omitted, all event types are reported. |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden but only states 'start watching' and the return value. No disclosure of side effects, permissions, resource usage, or failure modes (e.g., directory not found).
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?
The description is concise (two sentences), front-loaded with the main action, and avoids repetition. It could include more useful context, but is appropriately sized.
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?
Given the tool's complexity (6 parameters, output schema exists, sibling tools), the description lacks guidance on the watch lifecycle, asynchronous behavior, and how the watch_id integrates with other tools. It is incomplete for a tool that requires follow-up steps.
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 the schema already documents all parameters. The description adds no extra meaning beyond the schema, earning the baseline score of 3.
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 clearly states the action ('Start watching a directory') and the resource ('file system events'), and distinguishes itself from sibling tools (list_active_watches, poll_events, unwatch) by initiating the watch.
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?
The description mentions that the returned watch_id is used with poll_events and unwatch, implying the workflow, but does not explicitly state when to use or not use this tool, nor does it provide alternatives or prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool has a distinct purpose: starting, listing, polling, and stopping watches. No overlap or ambiguity.
All tools use verb_noun snake_case pattern. 'unwatch' is slightly non-standard but still clear and consistent.
4 tools is appropriate for a filesystem watcher, covering all essential operations without being too many or too few.
Covers full lifecycle: create (watch_directory), read (list_active_watches, poll_events), delete (unwatch). No obvious gaps for basic watching.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Securely search and manage workspace context files for AI agents and teams.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Shared project context for AI agents and teams: docs, tasks, and messages that stay current.
Real-time planetary signal engine and Model Context Protocol (MCP) server for autonomous AI agents.
Related MCP Servers
- FlicenseDqualityDmaintenanceEnables AI models to perform file system operations (reading, creating, and listing files) on a local file system through a standardized Model Context Protocol interface.3
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables enhanced file system operations including reading, writing, copying, moving files with streaming capabilities, directory management, file watching, and change tracking.21MIT
- FlicenseNot gradedqualityCmaintenanceEquips AI coding agents with filesystem, Git, database, and computation tools via the Model Context Protocol.1
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to securely browse, search, inspect, and understand local project files through Model Context Protocol tools.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- 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/trycatchkamal/filesystemwatcher-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server