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
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.
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.
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.
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.