mcp-chatgpt-file-store
Enables saving and managing files in a sandboxed local folder via MCP, with tools for listing, reading, writing, appending, searching, moving, and deleting files and directories.
README
ChatGPT File Store — MCP Server
A Model Context Protocol server that lets ChatGPT (or any MCP client) save and manage files inside a sandboxed local folder on your Mac.
Everything ChatGPT does is confined to an allowed directory — it cannot read or write anywhere else on your machine.
What it does
ChatGPT gets these tools:
| Tool | Purpose |
|---|---|
list_allowed_directories |
Shows where ChatGPT is allowed to save/read |
list_directory |
Lists files and folders in the store |
read_file |
Reads a text file |
get_file_info |
File metadata (size, modified time) |
search_files |
Finds files matching a pattern (*.md, *notes*) |
write_file |
Saves a file (creates folders automatically) |
append_file |
Appends to a running log/notes file |
create_directory |
Creates folders |
move_file |
Moves/renames files |
delete_file |
Deletes a file or folder |
Folder layout
mcp-chatgpt-file-store/
├── src/
│ ├── index.ts # entrypoint — stdio or HTTP mode
│ ├── http.ts # Streamable HTTP server (stateful sessions)
│ ├── server.ts # MCP server + tool registration
│ └── filesystem.ts # sandboxed file operations + path safety
├── chatgpt/ # default sandbox — <folder where server runs>/chatgpt
└── package.json
Two ways to run it
The server supports two transports — pick whichever your client wants:
| Mode | Command | Endpoint |
|---|---|---|
| stdio (default) | npm run start |
n/a (local process) |
| Streamable HTTP | npm run start:http |
http://localhost:3000/mcp |
Setup
1. Install dependencies and build
cd mcp-chatgpt-file-store
npm install
npm run build
2. Choose where ChatGPT can save
By default the sandbox is <folder where the server runs>/chatgpt (i.e. the
chatgpt/ folder inside this project). To use your own folder(s), set an
environment variable:
export CHATGPT_FILE_STORE_DIRS="/path/to/my/notes,/path/to/another"
3. Test it locally (optional but recommended)
npm run inspect
This opens the MCP Inspector where you can call each tool before wiring it to ChatGPT.
4a. Connect over stdio
In ChatGPT, add a custom MCP server with this command:
node /absolute/path/to/mcp-chatgpt-file-store/dist/index.js
Tip: point the command at the built
dist/index.js(notsrc), and use the absolute path. If you setCHATGPT_FILE_STORE_DIRS, make sure that environment variable is visible to the process ChatGPT launches.
4b. Connect over Streamable HTTP
Start the HTTP server (default port 3000):
npm run start:http
Or with a custom port/host:
node dist/index.js --http --port 8080 --host 0.0.0.0
# or via environment variables
MCP_HTTP_PORT=8080 MCP_HTTP=1 node dist/index.js
Via the npm script, pass flags after --:
npm run start:http -- --port 8080 --host 0.0.0.0
Then register http://localhost:3000/mcp as the MCP server URL in ChatGPT.
Authentication (recommended for any non-localhost deployment)
Set MCP_AUTH_TOKEN to require a Bearer token on every /mcp request:
MCP_AUTH_TOKEN=$(openssl rand -hex 32) node dist/index.js --http --port 8080
Requests must then include Authorization: Bearer <token> — otherwise they get a
401 Unauthorized. /health stays open (no token needed) for liveness checks.
When registering the connector in ChatGPT, add the same value as a custom header:
Authorization: Bearer <token>.
If MCP_AUTH_TOKEN is not set, the server logs a startup warning and accepts
unauthenticated requests — fine for quick local testing, not for anything
reachable from the internet.
The server implements the MCP Streamable HTTP transport:
POST /mcp— JSON-RPC requests (first call creates a session and returns aMcp-Session-Idheader; send it back on subsequent requests)GET /mcp— SSE stream for server-initiated messagesDELETE /mcp— ends a sessionGET /health— liveness check ({"status":"ok","sessions":N})
Example usage
Once connected, you can tell ChatGPT things like:
- "Save the summary of our conversation to
notes/summary.md" - "Append today's ideas to
ideas.md" - "List everything in the
projectsfolder" - "Search for files containing draft in the name"
Security notes
- Every path is resolved and checked against the allowed roots before any operation.
..traversal and paths outside the roots are rejected with an error.- In stdio mode the server exposes no network port at all.
- In HTTP mode the server binds to
0.0.0.0:3000by default — use--host 127.0.0.1to restrict it to localhost only. Sessions are tracked by random UUID. SetMCP_AUTH_TOKEN(see Authentication above) before exposing this server beyond localhost — without it, anyone who finds the URL can read/write files in the sandbox. - Only the configured directory is readable/writable — treat the sandbox as not secret (ChatGPT content is processed by the model provider).
Commands
npm run build # compile TypeScript
npm run start # run compiled server over stdio
npm run start:http # run compiled server over Streamable HTTP (port 3000)
npm run dev # run stdio mode with tsx (no build step)
npm run dev:http # run HTTP mode with tsx (no build step)
npm run inspect # open MCP Inspector UI
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。