filesystem-mcp-local-test

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.

Category
访问服务器

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.0
  • express@5.2.1
  • cloudflared@2026.7.2 installed with Homebrew

Verify locally

npm install
npm run verify

npm run verify runs two checks:

  1. Direct stdio verification of the official filesystem server
  2. 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_file
  • list_directory
  • directory_tree
  • search_files
  • get_file_info
  • list_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.0 fails on the local Node v26.0.0 runtime because it cannot resolve its own cli/package.json; verification uses the official SDK client instead.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选