Skip to main content
Glama

remote-fs-mcp

Give any AI access to your computer's files and terminal, from anywhere.

Run this MCP server on your PC, a VPS, or in Docker. Then connect Claude, Cursor, VS Code, or your own agent to it. The AI can read, write, edit and search files, and run terminal commands on that machine. That works even when you're only using a browser or your phone.

Python MCP License


Features

  • Files and folders: read, write, edit, list, search, copy, move and delete

  • Terminal: run commands, plus start long-running processes like dev servers and watch their output

  • Fast: stateless HTTP; uses ripgrep for search when it's installed

  • Secure: token auth, every file locked to one folder, read-only and no-commands modes

  • Works everywhere: Windows, macOS and Linux, Docker, VPS, or your PC through a tunnel

  • Any MCP client: Claude (web, desktop and Code), Cursor, VS Code, or your own code


Related MCP server: remote-access-mcp

Quick start

1. Install

git clone https://github.com/RaheesAhmed/remote-fs-mcp.git
cd remote-fs-mcp

Then install:

uv sync

2. Configure

Copy the example config:

cp .env.example .env        # Windows: copy .env.example .env

Open .env and set at least these two values:

MCP_FS_TOKEN=put-a-long-random-string-here
MCP_FS_ROOT=D:\projects            # the folder the AI is allowed to work in

Generate a strong token with:

python -c "import secrets; print(secrets.token_urlsafe(32))"

3. Run

uv run remote-fs-mcp

The server is now running at http://localhost:8765/mcp. Check that it's up by opening http://localhost:8765/health.


Use it from anywhere (browser or phone)

Your PC has to be reachable from the internet. Pick one of these options.

Option A: Tunnel from your PC (easiest)

Use ngrok or cloudflared. Add these lines to .env:

MCP_FS_ALLOWED_HOSTS=*.ngrok-free.app       # cloudflared: *.trycloudflare.com
MCP_FS_ALLOWED_ORIGINS=https://claude.ai
MCP_FS_URL_TOKEN=true

Start the server, then start the tunnel in a second terminal:

remote-fs-mcp
ngrok http 8765          # or: cloudflared tunnel --url http://localhost:8765

Your server URL is the address ngrok gives you, for example https://abc123.ngrok-free.app.

Option B: VPS with your own domain

  1. Run the server on the VPS with MCP_FS_HOST=127.0.0.1.

  2. Put Caddy in front of it for free HTTPS. A ready config is in deploy/Caddyfile.

  3. Set MCP_FS_ALLOWED_HOSTS=mcp.yourdomain.com.

  4. Optional: run it as a background service with deploy/remote-fs-mcp.service.

Option C: Docker (safest)

Commands run inside the container, not directly on your machine.

cp .env.example .env
mkdir workspace
docker compose up -d --build

Put the files you want the AI to work on in ./workspace.


Connect your AI

In every example below:

  • Replace https://YOUR-URL with your server address (local: http://localhost:8765).

  • Replace YOUR_TOKEN with your MCP_FS_TOKEN.

Claude (web and mobile)

  1. Go to Settings → Connectors → Add custom connector.

  2. Paste this URL: https://YOUR-URL/YOUR_TOKEN

  3. Leave the auth settings empty.

This needs MCP_FS_URL_TOKEN=true in .env, as shown in Option A.

Claude Code

claude mcp add --transport http remote-fs https://YOUR-URL/mcp \
  --header "Authorization: Bearer YOUR_TOKEN"

Cursor

Add this to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "remote-fs": {
      "url": "https://YOUR-URL/mcp",
      "headers": { "Authorization": "Bearer YOUR_TOKEN" }
    }
  }
}

VS Code / GitHub Copilot

Add this to .vscode/mcp.json:

{
  "servers": {
    "remote-fs": {
      "type": "http",
      "url": "https://YOUR-URL/mcp",
      "headers": { "Authorization": "Bearer YOUR_TOKEN" }
    }
  }
}

Claude Desktop (and other apps that only support local commands)

{
  "mcpServers": {
    "remote-fs": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://YOUR-URL/mcp",
               "--header", "Authorization: Bearer YOUR_TOKEN"]
    }
  }
}

Same computer, no network

{
  "mcpServers": {
    "remote-fs": {
      "command": "remote-fs-mcp",
      "args": ["--stdio", "--root", "/path/to/project"]
    }
  }
}

Your own Python code

import asyncio
from fastmcp import Client

async def main():
    async with Client("https://YOUR-URL/mcp", auth="YOUR_TOKEN") as ai:
        result = await ai.call_tool("run_command", {"command": "dir"})
        print(result.structured_content["stdout"])

asyncio.run(main())

Any language (plain HTTP)

curl -s https://YOUR-URL/mcp \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"list_directory","arguments":{"path":"."}}}'

Usage

Once connected, talk to your AI normally. It picks the right tools on its own.

Example prompts:

  • "Show me what's in my project folder."

  • "Find every file that uses fetchUser and rename it to getUser."

  • "Read src/app.py and fix the bug on line 40."

  • "Create a new Next.js app in a folder called my-site."

  • "Run npm install, then start the dev server and tell me when it's ready."

  • "Run the tests and fix whatever fails."

  • "Check git status and commit my changes with a good message."

  • "Zip the reports folder."

All paths are relative to MCP_FS_ROOT, so src/app.py means <root>/src/app.py.

Tools

Files and folders

Tool

What it does

read_file

Read a file, or a range of lines (offset, limit). Binary files can be read as base64.

read_many_files

Read up to 50 files in one call.

write_file

Create or overwrite a file. Modes: overwrite, append, create_only. Missing folders are created.

edit_file

Find and replace exact text in a file and get back a diff. Supports dry_run.

list_directory

List a folder. Use depth to go deeper; node_modules, .git and similar are skipped.

get_file_info

Size, type, permissions and dates.

create_directory

Create a folder, including any missing parents.

copy_path

Copy a file or a whole folder.

move_path

Move or rename a file or folder.

delete_path

Delete a file or folder. A folder that isn't empty needs recursive: true.

Search

Tool

What it does

find_files

Find files by name, e.g. *.py or src/**/test_*.js.

search_text

Search inside files, as plain text or regex, with optional context lines.

Terminal

Tool

What it does

run_command

Run a command and wait for it to finish. Returns output and exit code. Has a timeout.

start_process

Start something that keeps running (dev server, watcher) and return its id.

process_output

Read new output from a running process.

send_process_input

Type into a running process, e.g. to answer a prompt.

stop_process

Stop a process and everything it started.

list_processes

Show the processes that are running.

Info

Tool

What it does

server_info

Root folder, OS, shell, and which features are enabled.


Configuration

All settings go in .env.

Setting

Default

What it does

MCP_FS_TOKEN

auto-generated

Access token.

MCP_FS_TOKENS

–

Several tokens, comma separated, so each AI gets its own.

MCP_FS_ROOT

current folder

The only folder the file tools can access.

MCP_FS_READ_ONLY

false

Allow reading only. Hides all write, delete and command tools.

MCP_FS_ALLOW_COMMANDS

true

Turn the terminal tools on or off.

MCP_FS_ALLOW_DELETE

true

Turn deleting on or off.

MCP_FS_DENY_GLOBS

–

Files the AI can never touch, e.g. .env,*.pem,*.key.

MCP_FS_ALLOW_HIDDEN

true

Allow access to dotfiles.

MCP_FS_ALLOWED_HOSTS

–

Your public domain. Wildcards work, e.g. *.ngrok-free.app.

MCP_FS_ALLOWED_ORIGINS

–

Allowed web origins, e.g. https://claude.ai.

MCP_FS_URL_TOKEN

false

Accept the token in the URL: https://host/<token>.

MCP_FS_HOST

0.0.0.0

Address to listen on.

MCP_FS_PORT

8765

Port.

MCP_FS_SHELL

bash / cmd.exe

Shell used for commands, e.g. pwsh.

MCP_FS_COMMAND_TIMEOUT

120

Default command timeout in seconds.

MCP_FS_MAX_COMMAND_TIMEOUT

1800

Longest timeout a command can ask for.

MCP_FS_MAX_OUTPUT_CHARS

100000

Maximum size of each tool response.

MCP_FS_MAX_PROCESSES

16

Maximum background processes at once.

Command-line flags (these override .env):

remote-fs-mcp --root D:\projects --port 9000
remote-fs-mcp --read-only          # AI can only look, not change anything
remote-fs-mcp --no-commands        # files only, no terminal
remote-fs-mcp --stdio              # local use, no network

Security

⚠️ This gives an AI real control over a computer. Treat your token like a password.

  • Every request needs your token. Requests without it are rejected.

  • File tools only work inside MCP_FS_ROOT. Paths using ../, other drives, and symlinks that point outside are all blocked.

  • Terminal commands are not limited to the root folder. They can do anything your user account can do. If others might use the server, run it in Docker or a VM, or use --no-commands.

  • Always use HTTPS on the internet. Tunnels and Caddy give you HTTPS automatically.

  • If you use MCP_FS_URL_TOKEN, the URL itself is the password. Don't share it. If it leaks, change MCP_FS_TOKEN and restart.

  • Your token is hidden from the commands the AI runs.

  • Use MCP_FS_DENY_GLOBS to protect secrets like .env files and keys.


Troubleshooting

Error

Fix

421 Misdirected Request

Add your domain to MCP_FS_ALLOWED_HOSTS.

403 Forbidden Origin

Add the site to MCP_FS_ALLOWED_ORIGINS, e.g. https://claude.ai.

401 Unauthorized

The token is missing or wrong.

404 with the token in the URL

Set MCP_FS_URL_TOKEN=true and check the token.

Search is slow

Install ripgrep: winget install BurntSushi.ripgrep.MSVC, brew install ripgrep, or apt install ripgrep.

AI can't find my files

Check MCP_FS_ROOT. Ask the AI to call server_info to see the current root.


Development

pip install -e ".[dev]"
python tests/test_e2e.py

The tests start a real server and check every tool, the auth, and the sandbox.


License

MIT. Use it, change it, ship it.

Available Tools

19 tools
copy_pathCopy PathB

Copy a file or a whole folder.

Inputs: source (required), destination (required), overwrite. Returns: object

create_directoryCreate DirectoryB
Idempotent

Create a folder and any missing parents.

Inputs: path (required). Returns: object

delete_pathDelete PathB
Destructive

Permanently delete a file or folder.

Inputs: path (required), recursive. Returns: object

edit_fileEdit FileA

Surgical edit: replace exact text blocks and return a unified diff. Much cheaper than rewriting a whole file.

Inputs: path (required), edits (required), dry_run. Returns: object

find_filesFind FilesB
Read-onlyIdempotent

Find files by name/glob, fast (uses ripgrep when installed).

Inputs: pattern (required), path, max_results, include_ignored. Returns: object

get_file_infoGet File InfoC
Read-onlyIdempotent

Size, type, permissions and timestamps for a path.

Inputs: path (required). Returns: object

list_directoryList DirectoryB
Read-onlyIdempotent

List a folder (optionally recursive). Returns compact lines: 'd name/' for folders, 'f name size' for files.

Inputs: path, depth, pattern, skip_heavy, +2 more. Returns: object

list_processesList ProcessesA
Read-onlyIdempotent

List background processes started by this server.

Inputs: no named parameters. Returns: result

move_pathMove PathC

Move or rename a file or folder.

Inputs: source (required), destination (required), overwrite. Returns: object

process_outputProcess OutputA
Read-onlyIdempotent

Read output from a background process (incrementally with since).

Inputs: process_id (required), since, wait_ms. Returns: object

read_fileRead FileA
Read-onlyIdempotent

Read a file. Text is returned by line range; binary files can be returned as base64.

Inputs: path (required), limit, offset, as_base64, +1 more. Returns: object

read_many_filesRead Many FilesA
Read-onlyIdempotent

Read several text files in one round-trip. Errors are reported per file, not raised.

Inputs: paths (required), max_chars_each. Returns: result

run_commandRun CommandA
Destructive

Run a shell command and wait for it to finish. Returns exit code, stdout and stderr. For servers/watchers that never exit, use start_process instead.

Inputs: command (required), cwd, env, stdin, +1 more. Returns: object

search_textSearch TextB
Read-onlyIdempotent

Grep across files (ripgrep speed when installed). Returns 'path:line: text' lines.

Inputs: query (required), path, regex, file_glob, +3 more. Returns: object

send_process_inputSend Process InputA
Destructive

Type into a running process's stdin (answer prompts, REPLs).

Inputs: text (required), process_id (required), newline. Returns: object

server_infoServer InfoA
Read-onlyIdempotent

Server root, OS/shell, enabled features and limits. Call once at the start.

Inputs: no named parameters. Returns: object

start_processStart ProcessA
Destructive

Start a background process and return its id. Poll it with process_output.

Inputs: command (required), cwd, env, wait_ms. Returns: object

stop_processStop ProcessB
Destructive

Stop a background process and all its children.

Inputs: process_id (required), force, forget. Returns: object

write_fileWrite FileA

Create or replace a file atomically (never leaves a half-written file).

Inputs: path (required), content (required), mode, is_base64. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 19 tools

    Disambiguation5/5

    Each tool targets a distinct resource+action pair: read/write/edit/move/copy/delete operate on clearly different file operations, and the filesystem search trio (list_directory, find_files, search_text) is well separated by what each returns. The process set (start_process, process_output, send_process_input, stop_process, list_processes) maps cleanly onto distinct lifecycle stages, and run_command explicitly documents its boundary against start_process.

    Naming Consistency4/5

    The overwhelming majority follow a verb_noun pattern (read_file, create_directory, delete_path, start_process, list_processes). Two outliers break it: server_info (noun-only) and process_output (noun_verb), a minor but noticeable deviation from the otherwise uniform convention.

    Tool Count4/5

    19 tools is on the heavy side of the ideal range, but nearly every one earns its place across two coherent sub-domains (filesystem and process control). Nothing looks redundant or padded, though the process tooling adds bulk an agent may rarely use.

    Completeness4/5

    Full CRUD plus metadata, recursive listing, glob find, and text grep cover the filesystem domain thoroughly, and the background process lifecycle is complete (start/output/input/stop/list). Minor gaps remain: no append/tail, no permission or timestamp mutation (chmod/touch), and no symlink or archive handling.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Turns any Linux server into an AI-agent-accessible machine over HTTPS, allowing MCP clients like ChatGPT, Claude, and Grok to securely control files, run shell commands, inspect system state, query SQLite, and work with git behind a bearer token.
      149 npm
      7
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Gives MCP-compatible AI clients a controlled bridge to local files, processes, search, and document utilities, including reading/writing and moving files, text block editing, directory listing, content search, starting and managing terminal processes, and PDF/Excel/DOCX/image handling. It serves these tools over MCP Streamable HTTP at a configurable endpoint, with optional Bearer-token authentication and read-only or restricted-directory modes for safer remote exposure.
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Turns your own computer into a remotely reachable MCP server so AI clients anywhere can read, write, and run commands against its files, toolchains, and local services. Includes a built-in Cloudflare tunnel, bearer-token auth, and switchable read-only, workspace, and full permission tiers with call logging.
      5
      MIT