filesystem-mcp-local-test
This MCP server provides read-only access to a single allowed local directory through a secure HTTP gateway, enabling remote MCP clients to read files without syncing them to cloud storage.
README
Notion local filesystem MCP pilot
This project verifies a narrow path from a remote MCP client to a local file without syncing that file to GitHub, Google Drive, or another content store.
remote MCP client
-> HTTPS tunnel
-> Bearer-authenticated Streamable HTTP gateway on 127.0.0.1
-> official filesystem MCP over stdio
-> one explicitly allowed local directory
The default verification root is fixtures/allowed/. Global Codex configuration and Notion configuration remain unchanged.
Components
@modelcontextprotocol/server-filesystem@2026.7.10@modelcontextprotocol/sdk@1.29.0express@5.2.1cloudflared@2026.7.2installed with Homebrew
Verify locally
npm install
npm run verify
npm run verify runs two checks:
- Direct
stdioverification of the official filesystem server - Streamable HTTP verification through the read-only gateway
Verified on 2026-07-18 with Node v26.0.0 and npm 11.12.1:
- MCP initialization over
stdio: passed - Official filesystem tools discovered: 14
- Gateway tools exposed: 6 read-only tools
- Bearer authentication: required
- Untrusted browser
Origin: blocked - Allowed file read: passed
- Direct outside-root read: blocked
- Outside-root symlink traversal: blocked
- Sensitive credential-like file read: blocked
- Sensitive allowed root: rejected
- Sensitive entries in tree and search tools: excluded
- Write tool omitted and direct write call: blocked
- Dead upstream readiness:
503 - Public HTTPS MCP read through a temporary tunnel: passed
- Temporary tunnel and gateway shutdown after the check: passed
npm audit --omit=dev: 0 vulnerabilities
Run the local HTTP gateway
The gateway refuses to start unless the root is absolute and the token contains at least 32 characters.
export MCP_ALLOWED_ROOT="/absolute/path/to/one/allowed/directory"
export MCP_BEARER_TOKEN="<strong-random-secret>"
export MCP_PORT="8765"
npm run start:http
The MCP endpoint is http://127.0.0.1:8765/mcp. The unauthenticated health endpoint is http://127.0.0.1:8765/healthz and returns no filesystem path or tool details.
Do not save the bearer token in this repository or include it in command-line arguments.
Verify through an ephemeral public tunnel
npm run verify:tunnel
The tunnel verifier generates an in-memory token, opens a temporary trycloudflare.com tunnel to the sample root, repeats the MCP checks through public HTTPS, and terminates both processes. It does not print the token or temporary URL. On this Mac, the local DNS resolver did not consistently resolve temporary tunnel hostnames, so the verifier resolves them with public DNS and pins the returned address only for each test request.
Quick Tunnel has no stable hostname or uptime guarantee and does not support SSE. The gateway therefore uses stateless Streamable HTTP with JSON responses. A persistent Notion connection should use a named tunnel or another stable HTTPS endpoint.
Security boundary
The upstream official server exposes ten read tools plus write_file, edit_file, create_directory, and move_file. It has no server-side read-only CLI switch. This gateway exposes only these tools:
read_text_filelist_directorydirectory_treesearch_filesget_file_infolist_allowed_directories
Unknown or write-capable tool calls are rejected before they reach the upstream server. read_multiple_files is omitted to limit bulk reads, and list_directory_with_sizes is omitted because its current upstream implementation can follow an external symlink while collecting metadata. The upstream server separately enforces the allowed root, and the upstream process runs under a macOS sandbox that denies all file writes.
The gateway refuses an allowed root inside .git, .ssh, .aws, or .gnupg, and denies direct reads of those directory trees, .env*, common private-key/certificate extensions, and common credential file names. Recursive tree and search calls automatically exclude the same high-risk entries. Text reads default to 400 lines, cap at 2,000 lines, and reject files larger than 5 MB.
The gateway binds only to 127.0.0.1, validates the HTTP Host, rejects unconfigured browser origins, uses constant-time bearer comparison, allows at most two concurrent calls, applies a 15-second tool timeout, limits text reads and responses, and does not log request headers or tokens. If the upstream process dies or a call times out, readiness changes to 503 and the dedicated upstream is stopped; restart the gateway before retrying.
Do not expose /Users/seokmogu/project as a single root. Select the smallest directory needed by one private Notion Custom Agent. Files returned by an MCP tool leave the Mac and are processed by Notion even though they are not synchronized to another storage service.
Current limitations
- The static bearer token is suitable for a private pilot, not a replacement for OAuth lifecycle management.
- The public Quick Tunnel check depends on an account-less external service with no SLA.
- A stable Notion connection still needs a persistent HTTPS hostname and an explicitly selected Custom Agent.
- No Notion workspace or Custom Agent configuration is changed by this pilot.
- The official Inspector CLI
0.22.0fails on the local Nodev26.0.0runtime because it cannot resolve its owncli/package.json; verification uses the official SDK client instead.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.