file-share-mcp
v1.0.32MCP server for bidirectional file sharing between AI agents and users, with a built-in web GUI
An MCP server for bidirectional file sharing between AI agents and users, with a built-in web GUI. The agent can list, read, and notify about files. The user can upload, download, and delete files via the GUI — all through a shared local folder. Add this to your Cursor MCP configuration (~/.cursor/mcp.json or your workspace .cursor/mcp.json):
Summary extracted from the README.
File Share MCP
An MCP server for bidirectional file sharing between AI agents and users, with a built-in web GUI.
The agent can list, read, and notify about files. The user can upload, download, and delete files via the GUI — all through a shared local folder.
Features
- MCP Tools for the AI agent:
get_shared_folder— Get the current shared folder pathlist_shared_files— List all files available in the shared foldershare_file— Notify the user that a file is ready to downloadpreview_file— Read the content of a.txtor.mdfile (max 1 MB)write_file— Write text content to a new file in the shared foldercopy_file— Copy a file from the agent machine into the shared folder (see Moving files across machines)download_file— Copy a file from the shared folder onto the agent machine (any file type, binary included — see Downloading to the agent machine)create_directory/delete_directory— Manage subdirectoriesmove_file— Move or rename a file inside the shared folder
- Web GUI (French) — browse the shared folder, create folders, move, download and delete files from a browser:
- drop one or several files anywhere in the window (or use Envoyer des fichiers) to upload them into the open folder; a panel shows each file's progress, one upload at a time
.txtand.mdfiles open in a side panel next to the list, Markdown rendered; the rendered HTML is sanitised with DOMPurify, so a file cannot run scripts in the page- row actions appear on hover on a desktop and stay visible on a phone
- the shared folder path is changed from the settings dialog (gear icon)
- One required setting —
DATA_DIR, the storage folder, filled automatically by the MCP Gateway Manager - Proxy-ready — optional integration with the file-share-mcp proxy
Quick Start with Cursor
Add this to your Cursor MCP configuration (~/.cursor/mcp.json or your workspace .cursor/mcp.json):
{
"mcpServers": {
"file-share": {
"command": "npx",
"args": ["-y", "file-share-mcp"],
"env": {
"DATA_DIR": "C:/Users/YourName/.file-share-mcp"
}
}
}
}
Once added, restart Cursor. The GUI will be available at http://localhost:3005.
Quick Start with Claude Desktop
Add this to your Claude Desktop configuration (claude_desktop_config.json):
{
"mcpServers": {
"file-share": {
"command": "npx",
"args": ["-y", "file-share-mcp"],
"env": {
"DATA_DIR": "C:/Users/YourName/.file-share-mcp"
}
}
}
}
Configuration
All configuration is done via environment variables, passed in the MCP env block or in a .env file inside the package directory.
| Variable | Default | Description |
|---|---|---|
GUI_PORT |
3005 |
Port for the web GUI |
DATA_DIR |
(none, required) | Directory for configs.json, the logs and the default shared folder; created if missing. The server refuses to start without it. The MCP Gateway Manager fills it automatically |
PROXY_URL |
(none) | URL of the proxy server (optional) |
PROXY_APP_PATH |
/file-share |
Path to register on the proxy |
PROXY_APP_NAME |
File Share MCP |
Display name shown in the proxy dashboard |
APP_GROUP |
(none) | Groups the app under a collapsible section (folded by default) in the proxy dashboard. Apps sharing the same value appear together; if unset, the app lands in the default "ungrouped" section |
Example: custom port and data directory
{
"mcpServers": {
"file-share": {
"command": "npx",
"args": ["-y", "file-share-mcp"],
"env": {
"GUI_PORT": "3010",
"DATA_DIR": "C:/Users/YourName/my-shared-files"
}
}
}
}
Example: with proxy integration
{
"mcpServers": {
"file-share": {
"command": "npx",
"args": ["-y", "file-share-mcp"],
"env": {
"DATA_DIR": "C:/Users/YourName/.file-share-mcp",
"PROXY_URL": "http://localhost:3000",
"PROXY_APP_PATH": "/file-share",
"PROXY_APP_NAME": "File Share MCP",
"APP_GROUP": "Files"
}
}
}
}
Moving files across machines
Two tools move a file between the agent and the shared folder, in opposite directions:
| Tool | Direction | Names the file with |
|---|---|---|
copy_file |
agent machine → shared folder | source_path (absolute file path) |
download_file |
shared folder → agent machine | destination_path (absolute directory) |
Both are straightforward over stdio, the usual case where the MCP server is a child process of the agent: one filesystem, and the paths mean the same thing on both sides. Nothing to configure.
Through @imenam/mcp-http-gateway
the server runs on the gateway machine, and neither path means anything there. MCP has no
file-transfer primitive — only the bytes a message carries actually travel — so the relay,
which runs next to the agent in --mcp mode, fills the gap in both directions. Configure it
with GATEWAY_INLINE_ROOTS (reading, for copy_file) and GATEWAY_INLINE_WRITE_ROOTS
(writing, for download_file). Those two directory lists are the whole configuration: every
file type is allowed by default.
Neither direction has a fallback. With the relay in the chain but the matching root unconfigured, the call fails and names the variable to set; nothing is read, written, or dumped into the conversation.
Uploading: copy_file
source_path is the absolute path of the file on the agent machine. Through the relay, the
hidden source_content / source_name parameters carry the file itself; the agent only ever
names a path.
Downloading: download_file
destination_path is the absolute directory where the file should land on the agent
machine. The file keeps its own name; destination_overwrite (default false) governs
replacing an existing file.
absolute directory where it should land on the agent machine. The file keeps its own
name; destination_overwrite (default false) governs replacing an existing file.
Through the relay, the hidden destination_relay flag tells the server the destination is
on another machine: it then returns the file's bytes in its response, and the relay writes
them and strips them from the result. The bytes never reach the agent's context — an 8 MiB
file base64-encoded into a conversation would be costly, and an agent re-typing it by hand
would corrupt it.
Data & Logs
All user data is stored in DATA_DIR:
<DATA_DIR>/
├── configs.json # Saved configuration (shared folder path, etc.)
├── shared/ # Default shared folder
│ └── .uploads-tmp/ # Staging area for in-flight GUI uploads (hidden, purged at startup)
└── logs/
└── server.log # Application logs
This directory survives package updates and reinstalls. Both processes (MCP server
and GUI) log under <DATA_DIR>/logs, never under the working directory — the cwd of
an MCP launched by a gateway is not its own and is not necessarily writable.
Uploads are staged in .uploads-tmp inside the shared folder rather than in the
system temp directory, so the final move never crosses a mount boundary. rename()
returns EXDEV as soon as it does, even when both sides are on the same filesystem —
which is the case under systemd PrivateTmp=yes, with /tmp on tmpfs, or with a
TMPDIR on another volume. A copy-then-rename fallback covers the remaining case
where DATA_DIR and a custom shared_folder_path sit on different volumes.
Network exposure
The GUI server listens on 127.0.0.1 only. Other machines reach it through the proxy or
the gateway manager, which relay to localhost.
Every GUI request goes through the request guard of @imenam/mcp-gui-interface: it
refuses (HTTP 403) a Host header other than localhost / 127.0.0.1 / ::1, and any
modifying request (other than GET, HEAD, OPTIONS) that the browser marks as coming from
another site (Sec-Fetch-Site, or Origin outside this machine and the proxy).
The GUI sends no CORS headers: the frontend is served by the same server, and other websites cannot read the shared files through the browser.
Development
# Install dependencies
npm install
cd gui && npm install && cd ..
# Build (backend + frontend)
npm run build
# Start
npm start
Project structure
src/
├── mcp-server.ts # MCP server (MASTER process)
├── gui.ts # Express GUI server (WORKER process)
├── version.ts # Version read from package.json
└── utils/
├── config-manager.ts
├── file-manager.ts
└── logger.ts
gui/ # React + Vite frontend (builds to ../public/)
public/ # Built frontend (served by the GUI server)
Publication
Chaque push sur master, merge de pull request compris, publie une nouvelle version de file-share-mcp sur npm (.github/workflows/publish.yml) : npm ci, installation des dépendances de gui/ et build, puis npm version patch, dont le commit et le tag sont poussés sur master, et npm publish. La publication passe par le trusted publishing de npm (OIDC, sans token), avec attestation de provenance. Un échec du build arrête le workflow avant la montée de version.
Sur npmjs.com, le paquet déclare ce workflow comme publieur de confiance (Settings → Trusted publishing → GitHub Actions : Matthieu-Pesnot-Pin, file-share-mcp, publish.yml, avec npm publish dans les actions autorisées). Le commit de version est poussé avec GITHUB_TOKEN : si master est protégée, la règle doit autoriser GitHub Actions à y pousser.
License
ISC