DEV Community

Cover image for Chat with your documents on a NAS or file server: AnythingMCP File Search for Claude, ChatGPT and Copilot
helpcode.ai
helpcode.ai

Posted on

Chat with your documents on a NAS or file server: AnythingMCP File Search for Claude, ChatGPT and Copilot

In short

  • Most company documents sit on a file server or NAS that an AI assistant cannot open, and many companies do not want to copy them to a cloud drive.
  • AnythingMCP File Search builds a full-text index of a folder on an SFTP, FTPS, WebDAV or S3 server and keeps it in sync. The files stay where they are.
  • Claude, ChatGPT, Copilot and Cursor get tools to search, read pages and find exact codes, and they answer with the file, the page and the date.

The documents your AI cannot reach

Ask an AI assistant what an article costs in the current price list, and it has nothing to look at. The price list is a PDF in a folder on the NAS in the server room. So are the drawings, the offers and ten years of saved e-mails.

The usual advice is to move the files to a cloud drive that the assistant can connect to. For many companies that is not where the files are, and not where they are going.

Two charts: in the EU about 38% of enterprises store files in a paid cloud service and 62% do not; in the US 62% of IT leaders name reducing data risk from AI the top business challenge of unstructured data

So the question is how to let the assistant answer from those documents without moving them.

What File Search is

AnythingMCP is an MCP gateway. MCP, the Model Context Protocol, is the open standard that lets AI clients such as Claude, ChatGPT, Copilot and Cursor call tools. The gateway puts one governed endpoint in front of the systems a company already runs.

File Search is one connector type of that gateway. It lets an AI client search inside the documents of a folder on an SFTP, FTP/FTPS, WebDAV or S3 server, or in a network folder mounted into a self-hosted install. AnythingMCP indexes the file names and the text of every page, keeps the index in sync, and gives the AI tools to search, read pages, find exact codes and hand the file to the person.

Six parts: your file server, the files-worker service that connects and syncs, the isolated file-extractor that turns files into text, the index of file names and page text, the MCP tools, and the AI client that answers with file, page and date

How the sync works, as documented:

  • Syncing runs in its own service, files-worker, never in the process that answers the AI. A large first sync does not slow down your AI clients, and search keeps working on the last index while a sync runs.
  • New and changed files are found by size and modification time (by ETag on WebDAV and S3). Unchanged content is recognised by its SHA-256 checksum and not read again. Deleted files leave the index.
  • A file that cannot be read is retried, and after three failures it stays findable by name until it changes.

The tools the AI gets

Each File Search connector gets its own tools, named with a prefix you choose.

Tool What it does
<prefix>_search Full-text search: the files with the best page, a snippet and the date, with filters for folder, type and dates
<prefix>_find Files by name, typo-tolerant, or by pattern
<prefix>_list One folder: subfolders with counts, files with size and date
<prefix>_read The text of a file, by pages ("1-3,7") or in windows of characters
<prefix>_grep Exact search with two lines of context; spreadsheet rows come with their column names
<prefix>_view_page One page of a PDF, or an image file, as a picture the AI can see: drawings, stamps, signatures
<prefix>_get_file The file itself as a temporary link for members of the workspace (24 hours)
<prefix>_status, <prefix>_guide Sync state and counts; how to search this folder
<prefix>_share_file A temporary link, internal or public. Switched off at install

Every tool except the share tools is read-only. The tools also tell the model that file content is data, and that instructions found inside a file are never followed.

Here is a real session against a demo folder of fictional supplier documents. Claude asks for permission to run the exact search:

Claude asks to use the grep tool of the File Search connector with the pattern AD-24004

And this is the answer. It found two price lists that disagree, names both files with page and row, and says which one it would trust and why:

Claude's answer quotes the row from a PDF price list and the row from an Excel price list, names both file paths, and explains which list is more likely the current one

Tutorial: a Synology NAS over SFTP

The wizard has five steps, and a sixth connects your AI client. They are the same for any SFTP server. The screenshots are from a local test instance with fictional demo data.

Before you start

  • Enable SFTP on the NAS: in DSM, Control Panel → File Services → FTP → SFTP.
  • Create a DSM user with read-only access to the one shared folder.
  • For AnythingMCP Cloud, the NAS has to be reachable from the internet, with the SFTP port forwarded on your router. A self-hosted AnythingMCP in the same network reaches it directly.

Only workspace administrators can set up File Search connectors.

Step 1: Source

Open Connectors → New → File Search and use the Synology NAS shortcut, which presets SFTP. Enter the server, the port, the read-only user and the folder to index.

The Source step of the File Search wizard: protocol tiles for SFTP, FTP/FTPS, WebDAV, network folder and S3, shortcuts for Nextcloud, Synology, QNAP, Fritz!Box and Hetzner, and fields for name, server, port, user and folder

Step 2: Test

AnythingMCP connects, signs in and lists the folder before anything is saved. The result is a checklist: address, reachability, encryption, server identity, login, folder.

The SFTP host key is shown as a fingerprint. Confirm it once. From then on a different key is refused before the password is sent.

The Test step: six green checks and a box asking to confirm the fingerprint of the server's SSH host key

Step 3: Scan

A dry run lists the whole folder without indexing it: files per folder, types, years. Folders that look like archives (Alt, Old, Archive, Backup) are unticked. A bar compares your selection with your plan while you tick folders, file types or an age limit.

The Scan step: 508 files in 212 folders, a budget bar showing 340 selected files against a limit of 2,000, a folder tree with checkboxes, and file type filters

Step 4: Describe

The wizard drafts the connector's instructions and a one-line summary from the scan: naming patterns of the folders, recurring subfolders, file types, years. This text tells the AI what the folder holds and how to search it. Edit it before saving.

If an AI model is configured on the server, the wizard can draft the text with AI instead. It states exactly what is sent: folder names, file names and the first 2,000 characters of up to 20 sample files, with personal data masked.

Step 5: Activate

Choose the tool prefix, the sync interval and the MCP servers that get the connector. The first sync starts at once.

The Activate step: tool prefix, sync interval, the MCP server to add the connector to, and the button to activate and start the first sync

The connector's Files panel then shows the state, the counts against the plan, recent syncs and the files that could not be read.

The Files panel of a File Search connector: 463 of 508 files indexed, last and next sync, the text the AI is told about the folder, recent syncs including one paused sync, and two files that need attention

Step 6: Connect your AI client and ask

In MCP Servers, open the server you chose and copy its URL. In Claude, open Customize → Connectors, click +, then Add custom connector, enter the URL, click Connect and sign in to AnythingMCP.

Then ask about the content of your files, for example: "Give me the latest price list in the Purchasing folder as a download link."

Self-hosted: turn File Search on

On a self-hosted install, two extra services do the work. Add the secrets and the files profile to .env, then start:

echo "FILES_WORKER_URL=http://files-worker:8891" >> .env
echo "FILES_WORKER_TOKEN=$(openssl rand -hex 24)" >> .env
echo "FILE_EXTRACTOR_TOKEN=$(openssl rand -hex 24)" >> .env
echo "COMPOSE_PROFILES=files" >> .env
docker compose up -d
Enter fullscreen mode Exit fullscreen mode

For a Windows share or an NFS volume, mount it on the host read-only, bind it into the app and files-worker containers and set FILE_SOURCE_ROOTS, for example FILE_SOURCE_ROOTS=/mnt/knowledge. The wizard's Network folder source then reads from it.

What leaves your server, and what does not

Table: the files stay on your server; file names and page text are in the index; matches, page text, a page picture or a link go to the AI client per question; the server password is stored encrypted; a shared file exists only if share links are switched on

The details behind the table:

  • The files stay. The connector lists and reads. It has no tool that writes, renames or deletes on the server.
  • The index holds text, not files. On AnythingMCP Cloud it is stored per workspace, and the database enforces the separation with Row-Level Security. Self-hosted, the index stays on your own server.
  • The AI provider gets what a tool returns for one question: a list of matches, the text of a page, a picture of a page, a link.
  • Credentials are stored encrypted and decrypted only in files-worker. The text extractor runs on an internal network with no route out, no database and no secrets.
  • Share links are off at install. A file shared through a link is deleted after the link expires or is revoked.
  • Cloud or self-hosted. AnythingMCP Cloud connects to servers it can reach over the internet, with SFTP or WebDAV. A self-hosted install in your own network also reads SMB and NFS shares directly.

Cloud drive, your own RAG pipeline, or File Search

RAG, retrieval-augmented generation, usually means cutting documents into chunks, turning each chunk into an embedding (a vector that stands for its meaning) and retrieving the most similar chunks for a question.

Copy the files to a cloud drive Build your own RAG pipeline File Search
Where the files are A second copy at the cloud provider On your server, with a copy of the text in your vector database On your server; the index holds the text
Keeping current A copy or sync job you run Your ingestion pipeline Automatic sync; only changed files are read
Exact codes and numbers Depends on the drive's search Weak spot: similar codes look alike to embeddings Literal search, spreadsheet rows with their column names
Questions phrased differently from the text Depends on the drive's search Retrieval by meaning The AI client tries several wordings; matching is literal
Who sees what Permissions rebuilt in the drive You build it MCP roles; folder permissions per role on Enterprise
Sources in the answer Depends on the connector If you build it File, page and date on every hit
Effort A migration A project: chunking, embeddings, evaluation A wizard: source, test, scan, describe, activate

File Search matches words and codes exactly, and the AI client rewords and repeats a search on its own when the first try finds nothing. On a file server, people look for an article number, a name or the newest version of a list. For that, a literal match with a file date is the better tool.

Sources, file types and limits

Sources: SFTP, FTPS, WebDAV, S3, network folder (self-hosted only) and plain FTP. File types read as text: PDF, Excel and CSV, Word, PowerPoint, Outlook messages, OpenDocument, EPUB, ASCII DXF, Markdown, JSON, XML and source code. Found by name: images, archives, DWG and binary DXF. With OCR on Enterprise: scanned PDFs

File Search is included in every plan of AnythingMCP Cloud, the free trial included. Self-hosted, it needs Enterprise, an existing Starter or Team licence key, or the 30-day trial.

Trial (Cloud) Starter Team Enterprise
File Search connectors 3 1 3 by contract (self-hosted: unlimited)
Indexed files, all connectors together 2,000 500 2,000 by contract (self-hosted: unlimited)
Largest file (Cloud) 50 MB 25 MB 50 MB 200 MB
Automatic sync daily daily daily down to every 15 minutes
OCR, folder permissions, workspace policy no no no yes

When a sync finds more files than the plan includes, it pauses before downloading anything. The AI keeps searching the existing index and is told that newer files may be missing.

Questions people ask

Can Claude or ChatGPT read the files on my NAS directly?
No. An AI client cannot open an SFTP or SMB share on its own. It needs a tool that searches for it. File Search provides those tools through an MCP server.

Are my files uploaded to the AI provider?
No. The provider receives what a tool returns for a question: matches, the text of a page, a picture of a page or a link. The files stay on your server.

Does this work with SharePoint, OneDrive or Google Drive?
Those have connectors of their own that search through the drive's API. File Search is for the places without such an API: a NAS, a file server, an SFTP or WebDAV server, an S3 bucket.

Is File Search a RAG system with a vector database?
No. It is a full-text index with page-level results, and the model retrieves through tools. It uses no embeddings.

Do I have to open the NAS to the internet?
Not with a self-hosted AnythingMCP in the same network: it needs no port forwarding and also reads mounted SMB and NFS shares. AnythingMCP Cloud connects over the internet, so there the SFTP or WebDAV port has to be reachable, with a read-only user.

What happens with scanned PDFs?
Without a text layer they are found by name. On Enterprise, with the OCR extractor image, they are read with OCR.

Where to go next

Start with one folder that people ask about every day, and a read-only user for it.

Top comments (0)