fsgate
Enables the Google Gemini web app to connect as a custom MCP app, giving it controlled read/search/create/edit/move/delete access to configured local folders over a public HTTPS/OAuth endpoint, with per-connection tool and folder permissions.
Allows Perplexity custom connectors to use the same MCP/OAuth flow to access local files, with its redirect URIs permitted by default; the README notes this has not been live-tested.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
fsgate-mcp
A filesystem MCP server you can actually switch off piece by piece. Read, search, create, edit, move, delete and (optionally) run commands in the folders you choose, with every tool and every folder individually controllable. Built so that chat UIs such as gemini.google.com can work on your local files, on Windows and Linux, with nothing hardcoded to your machine.
You (browser) ──► gemini.google.com ──► Google's cloud ──► https://<you>.ts.net/mcp ──► fsgate ──► your folders
(Tailscale Funnel, TLS) (OAuth + passcode)Why this exists
Gemini's web app supports custom MCP servers ("custom apps"), which gives you Google's newest models on your own files. But the connector is called from Google's servers, so localhost does not work: you need a public HTTPS URL, OAuth 2.1, and a server you can trust on the open internet. Existing filesystem servers are stdio-only, have no authentication, and are all-or-nothing. fsgate is the missing piece:
Modular control: 16 tools in five categories, switchable globally, per folder, and per connection (per OAuth grant). Presets for quick setup.
Built for the internet: OAuth 2.1 (PKCE, dynamic client registration), a consent page protected by a passcode, a strict redirect allowlist, Host and Origin checks, hashed token storage.
Safe defaults: no delete and no command execution until you turn them on, secrets (
.env, keys,.git,.ssh...) denied everywhere, deletes go to a trash folder, writes are atomic, edits keep CRLF/BOM/encoding.Portable: Node.js only, no native dependencies, config in standard per-OS locations, paths never hardcoded.
Also works as a plain stdio server for Claude Desktop, Cursor, VS Code and other local MCP clients.
Status: tested on Windows 11 and Ubuntu (WSL) with the official MCP SDK client, including full OAuth flows, and used live from the Gemini web app. Claude, ChatGPT, Perplexity and Mistral Le Chat custom connectors speak the same protocol and their redirect URIs are allowed by default, but they have not been tried against the real services; see docs/other-chat-apps.md. Gemini's availability depends on Google's eligibility rules; see docs/gemini-setup.md.
Related MCP server: AKIMCP
Quick start (Gemini)
Requirements: Node.js 20.12+, a personal Google account that has custom apps enabled in the Gemini web app (Google's requirements), and Tailscale with Funnel enabled (free).
git clone https://github.com/<your-user>/fsgate-mcp.git
cd fsgate-mcp
npm install # also builds
npm link # puts the `fsgate` command on your PATH (or use: node bin/fsgate.js ...)Create a config (it prints a passcode once; write it down):
fsgate init --mode gemini --public-url https://<machine>.<tailnet>.ts.net --root ~/code/my-projectOmit the flags to be asked interactively.
--rootcan be repeated.Start the server:
fsgate servePublish it with Tailscale Funnel (second terminal):
tailscale funnel --bg 8787Connect Gemini: gemini.google.com → Settings → Connected Apps → Add a custom app → paste
https://<machine>.<tailnet>.ts.net/mcp→ Next → approve on the fsgate consent page with your passcode.In a chat, type
@and pick the app, then ask: "List the files in my project and summarise the README."
Check anything that does not work with fsgate doctor (add --online to test the public URL). Full walkthrough: docs/gemini-setup.md, tunnel details: docs/tailscale-funnel.md.
Quick start (local clients, no network)
fsgate serve --transport stdio --root ~/code/my-projectFor an MCP client that launches servers itself (Claude Desktop, Cursor, VS Code...):
{
"mcpServers": {
"fsgate": {
"command": "fsgate",
"args": ["serve", "--transport", "stdio", "--root", "/absolute/path/to/project"]
}
}
}Use --read-only, --tools read_file,grep,glob or --preset readonly to narrow it. On Windows use forward slashes or doubled backslashes in JSON.
The tools
Category | Tool | What it does |
read |
| Shows exposed folders, which tools are on for each, and the path conventions |
read |
| Read a file with line numbers; paging with |
read |
| Read up to 20 files in one call |
read |
| Tree listing with depth, hidden files and sizes optional |
read |
| Type, size, mtime, mode, line endings, sha256 |
read |
| Find files by pattern ( |
read |
| Regex or literal search with context lines, three output modes, ReDoS-safe |
create |
| New file; refuses to overwrite |
create |
| Create folders (recursive) |
create |
| Copy a file or folder (never follows symlinks) |
modify |
| Overwrite or append; optional |
modify |
| Exact string replacement, CRLF-aware, single-match rule, diff in the result |
modify |
| Several edits in one file, all-or-nothing |
modify |
| Move or rename |
delete |
| Delete to a recoverable trash folder (or permanently, if configured) |
exec |
| Run an allowlisted program. Off by default; see the warning below |
All paths are written as @root/relative/path (or an absolute path inside a root). Tool results use the @root/... form, with one exception: list_roots prints each root's absolute path so you can see what is exposed.
Controlling what the model can do
Four independent layers, all cumulative:
Preset (
readonly,standard,full):standard= read + create + modify (the default).fulladds delete.execis never part of a preset.Global tool switches:
fsgate tools disable grep,fsgate tools enable delete_path.Per-folder rules: mark a folder
readOnly, or switch individual tools per root:fsgate tools disable edit_file --root docs. A tool is visible if at least one folder allows it and is re-checked against the folder it touches on every call.Per-connection grants (Gemini): on the consent page you tick which categories this connection may use. A connection you granted only read access to cannot see or call write tools, even if the server allows them.
Secrets stay out of reach regardless of the above: deny patterns (.env*, *.pem, *.key, id_rsa*, .ssh, .git, .aws, .npmrc by default) block every tool, and fsgate protects its own config file and data directory.
fsgate tools # table of every tool, globally and per folder
fsgate tools disable delete_path
fsgate tools enable run_command --root scripts # --root takes a configured root name, not a path
fsgate tools preset readonly
fsgate tools roots add ~/notes --read-only
fsgate tools roots listConfig files and the full option reference: docs/configuration.md · docs/tools.md · docs/local-clients.md.
Where things live
Windows | Linux | |
Config |
|
|
Data (tokens, audit log, trash) |
|
|
Override with --config, FSGATE_CONFIG, FSGATE_DATA_DIR. ./fsgate.config.json in the working directory is also picked up. Paths in the config accept ~, ${VAR} and %VAR%.
Security in one minute
The public endpoint is protected by OAuth 2.1 with PKCE. Nobody gets a token without typing your passcode on the consent page; five wrong attempts lock it for 15 minutes.
Only the fixed callbacks of the supported chat apps (and anything you add to
auth.allowedRedirectUris) can receive authorisation codes.Tokens are stored hashed.
fsgate auth revoke-allkills every grant;fsgate passcoderotates the passcode and revokes everything.Stop the Funnel (
tailscale funnel reset) when you are not using it.run_commandis arbitrary code execution as you. An allowlist ofgitis fine; an allowlist containingpython,node,powershellorbashlets the model run anything. It is off by default and per-folder opt-in.Everything the model reads is sent to Google. Do not expose folders whose contents you would not paste into a chat.
Read docs/security.md before exposing anything sensitive.
Known limitations
Only Gemini has been tried live. The OAuth flows are tested with the official MCP SDK client on Windows 11 and Ubuntu, and with a real Gemini account. Claude, ChatGPT, Perplexity and Mistral Le Chat are allowed by default but untested; each has its own eligibility rules, and the Perplexity and Mistral redirect URIs come from vendor guides rather than their own docs. If one behaves differently, please open an issue.
The passcode lockout is global. Five wrong passcodes lock the consent page for 15 minutes for everyone, including you; anyone who finds your URL can trigger it. Restarting the server clears it. It protects the passcode, at the cost of availability.
run_commandcannot reliably kill grandchildren on Windows if a started program spawns something that outlives it. Prefer not to enable it there, or allow only simple programs.Search skips dot-files (use
include_hidden), does not descend into symlinked folders, and ignores paths matched by.gitignoreunlessinclude_ignoredis set. Paths deeper than 128 segments or 4096 characters are refused.Large trees are slow, not unbounded. Every entry is path-checked, so a directory walk costs roughly a millisecond per file on Windows; scans stop at
limits.maxFilesScanned.Overlapping roots are rejected (one root inside another) so that the per-folder rules stay unambiguous.
Edits are serialised inside one server process only. If another program writes the same file at the same moment, fsgate's
if_matchhash and atomic-rename checks catch most conflicts but cannot rule out every race.
Troubleshooting
Symptom | Fix |
Gemini cannot connect / times out |
|
Consent page says redirect URI not allowed | Copy the URI from the server log into |
Passcode rejected | It is case-sensitive; after 5 failures wait 15 minutes or restart; reset with |
"Custom apps" missing in Gemini | Google restricts the feature (personal account, history on, region); see Google's help page |
Tool says disabled |
|
More in docs/troubleshooting.md.
Development
npm install
npm run typecheck
npm test # unit, adversarial and end-to-end suites
npm run buildCI runs on Windows and Ubuntu with Node 20 and 22. See DESIGN.md for the architecture and the security contract every module is written against.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Safe folder access for ChatGPT and Claude: read, write and search files, risky tools opt-in.
Your own computer's files from ChatGPT or Claude: folder rules, confirmations and undo.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Related MCP Servers
- FlicenseNot gradedqualityAmaintenanceExposes a governed suite of 38 OAuth-gated MCP tools that let web-based AI chats and other clients read and edit files, run whitelisted shell commands, search, use Git, SQLite, browser automation, DevTools, background tasks, localhost services, clipboard, notifications, and ports on a user's own machine. It runs locally with folder scoping and a strict command whitelist, so remote clients gain a large operating surface without unrestricted shell access.-
- FlicenseNot gradedqualityAmaintenanceExposes an OAuth-gated MCP endpoint with a governed suite of 38 tools that let web-based AI chat clients work directly on your local machine — reading and editing files, running whitelisted shell commands, searching, using Git and SQLite, automating browsers, driving DevTools, managing background tasks and ports, and reaching localhost services, clipboard, and notifications. A strict command whitelist and folder-scoped access keep that remote operating surface safe by default.-
- FlicenseNot gradedqualityAmaintenanceExposes 38 OAuth-gated tools over one MCP endpoint so web-based AI clients like Claude, ChatGPT, and Grok can read and edit local files, run whitelisted shell commands, search content, use Git, SQLite, browser automation, DevTools, clipboard, notifications, ports, and background jobs on your own machine. A strict command whitelist and folder restrictions keep the local operating surface governable and safe by default.-
- AlicenseNot gradedqualityAmaintenanceExposes a governed suite of 38 tools over a single OAuth-gated MCP endpoint, letting web-based AI chat clients read and edit local files, run whitelisted shell commands, search, use Git, inspect SQLite databases, and drive browser, DevTools, clipboard, and background-task workflows. It requires no system-wide install or admin rights and restricts access to folders and commands approved from a local control panel.MIT