Server data from the Official MCP Registry
Secure filesystem access for AI agents with configurable directory and file type restrictions
Secure filesystem access for AI agents with configurable directory and file type restrictions
Valid MCP server (0 strong, 3 medium validity signals). 5 known CVEs in dependencies (1 critical, 3 high severity) Package registry verified. Imported from the Official MCP Registry.
4 files analyzed Β· 6 issues found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
Add this to your MCP configuration file:
{
"mcpServers": {
"io-github-oncorporation-filesystem-server": {
"args": [
"vs-filesystem-mcp-server"
],
"command": "uvx"
}
}
}From the project's GitHub README.
Local MCP server for Visual Studio 2022+ that provides code-workspace functionality by giving AI agents selective access to project folders and files
This MCP server is optimized for:
.code-workspace files--allow-write (disabled by default)\) and Unix (/) path separatorspip install vs-filesystem-mcp-server
Ensure you have Python 3.10+ installed
Clone the repository
Navigate to the project directory
Install dependencies using uv:
uv sync
.mcp.jsoninit() tool firstThe easiest way to get started! Create a config.json file:
For MCP server usage:
config.json in the same folder as your .mcp.json file (usually C:\Users\YourUsername\)For debugging from source (Visual Studio 2022+):
config.json in the same directory as app.py (D:/Projects/filesystem_server/){
"allowed_dirs": [
"C:/Users/YourUsername/Documents/projects",
"D:/projects",
"D:/Webs"
],
"allowed_extensions": [
".py", ".js", ".ts", ".json", ".md", ".txt",
".yml", ".yaml", ".toml", ".cfg", ".ini", ".cs",
".css", ".scss", ".htm", ".html", ".xml", ".xaml"
],
"allow_write": false
}
Note: Set
"allow_write": trueto enablewrite_fileandwrite_file_binarytools.
Add this to your .mcp.json file (usually C:\Users\YourUsername\ in VS 2022+):
{
"servers": {
"filesystem-server": {
"command": "vs-filesystem-mcp-server"
}
}
}
Note: When installed via pip, the command is just vs-filesystem-mcp-server - no path to app.py needed!
If you're developing and running from source code:
{
"servers": {
"filesystem-server": {
"command": "python",
"args": [
"/absolute/path/to/your/project/filesystem_server/app.py"
],
"cwd": "/absolute/path/to/your/project/filesystem_server"
}
}
}
Benefits:
Usage:
# For debugging in Visual Studio 2022:
python app.py # Uses config.json from same directory as app.py
# For MCP server usage:
# The MCP client automatically finds config.json in the .mcp.json directory
Important Location Notes:
config.json goes next to app.pyconfig.json goes next to .mcp.jsonBest for production MCP client configurations where you want everything in one place:
{
"servers": {
"filesystem-server": {
"command": "vs-filesystem-mcp-server",
"args": [
"--allowed-dirs", "D:/projects", "D:/Webs",
"--allowed-extensions", ".py", ".js", ".ts", ".json", ".md", ".txt"
]
}
}
}
python app.py --allowed-dirs "D:/projects" "D:/Webs" --allowed-extensions ".py" ".js" ".md"
# With write access enabled:
python app.py --allowed-dirs "D:/projects" "D:/Webs" --allowed-extensions ".py" ".js" ".md" --allow-write true
MCP Client Configuration (.mcp.json):
{
"servers": {
"filesystem-server": {
"command": "python",
"args": [
"/absolute/path/to/your/project/filesystem_server/app.py",
"--allowed-dirs", "D:/projects", "D:/Webs",
"--allowed-extensions", ".py", ".js", ".ts", ".json", ".md", ".txt"
],
"cwd": "/absolute/path/to/your/project/filesystem_server"
}
}
}
Benefits:
The server automatically uses command-line arguments first, then falls back to config.json if no arguments provided.
How it works:
Benefits:
# With command line arguments (MCP clients):
python app.py --allowed-dirs "D:/projects" "D:/Webs" --allowed-extensions ".py" ".js" ".md"
# Using config.json fallback (Visual Studio 2022+ debugging):
python app.py
# Show MCP configuration help:
python app.py --help-mcp
init(directory, file_path) - Validates accessibility of configured directories and can optionally list a directory and/or read a file
directory (optional): Directory path to list contents (can be None)file_path (optional): File path to read content (can be None){ "message": "OK", "isError": false, ... } if all directories accessiblelist_directory(directory, report_progress=True, batch_size=100) - Lists files and subdirectories in a given directory, with optional progress reporting
directory: The absolute or relative path to the directory (supports both / and \ separators)report_progress (optional): If True, returns progress information and batch details (default: True)batch_size (optional): Number of items to process before reporting progress (default: 100)report_progress is Falsereport_progress is True"error" and "error_message" keysread_file(file_path) - Reads the content of a specified file as text
read_file_binary(file_path) - Reads the content of a specified file as base64-encoded binary
{ "content_base64": <base64 string>, "encoding": "base64", "error": False } on successlist_resources(directory=None, report_progress=True, batch_size=100) - Lists all resources (files and directories) in a directory (or all allowed directories) in MCP resource format
directory (optional): Directory to start from (defaults to all allowed_dirs)report_progress (optional): If True, returns progress information and batches (default: True)batch_size (optional): Number of resources per progress batch (default: 100)report_progress is Falsereport_progress is True{
"id": "D:/projects/example.txt",
"type": "file",
"name": "example.txt",
"path": "D:/projects/example.txt",
"metadata": {
"size": 1234,
"modified": "2025-08-18T12:34:56Z"
},
"actions": ["read", "read_binary", "write", "write_binary"]
}
get_resource(path) - Gets metadata and actions for a specific file or directory
path: Absolute or relative path to the resourcewrite_file(file_path, content) - Writes text content to a specified file (requires --allow-write)
file_path: Path to write to (must be within allowed dirs)content: Text string to writeValueError if write access is disabled, path not allowed, extension not allowed, or IO error--allow-write flag or "allow_write": true in config.jsonwrite_file_binary(file_path, content_base64) - Writes binary content from base64 to file (requires --allow-write)
file_path: Path to write to (must be within allowed dirs)content_base64: Base64-encoded binary data{"success": true, "bytes_written": int, "error": false} or error dict--allow-write flag or "allow_write": true in config.jsonPerfect debugging experience:
Debugging setup:
config.json exists (already created for you)Below are step-by-step examples showing how to call the FileSystem MCP Server from within Visual Studio 2022. These screenshots demonstrate the process using the alias "fss" for the server, which is simply a shorter name for "filesystem-server". You can customize this alias in your .mcp.json fileβthe actual name is up to you.
Note: All images are located in the
images/subfolder.

In this example, the MCP client is configured to use "fss" as the server name. This is just an alias for convenience.

The server responds with the results of your request, such as the output from the read_file() tool.
Note:
- The
"fss"alias is used here for brevity. You can use any name you prefer in your.mcp.jsonconfiguration.- To change the server name, simply update the key in your
.mcp.jsonfile from"filesystem-server"to any other name you like.
For more details on configuring your MCP client, see the Configuration Options section above.
You can easily edit your mcp.json configuration file directly from Visual Studio using the GitHub Copilot Chat interface. Follow these steps:
mcp.json file will open for editing.
This allows you to quickly update your MCP server configuration without leaving the IDE.
--allowed-dirs or config.json can be accessed--allowed-extensions or config.json can be read or writtenwrite_file and write_file_binary require --allow-write flag or "allow_write": true in config.jsonThe server provides detailed error messages for:
init() tool)New Error Handling for list_directory():
list_directory() function now returns errors as part of the result list instead of raising exceptions["error", "detailed_error_message"]Your original config had a missing comma after "D:/Webs". The corrected version above fixes this.
init() tool to validate your configurationpython app.py --help # Show help
python app.py --help-mcp # Show MCP configuration examples
python app.py --allowed-dirs DIR1 DIR2 # Set allowed directories
python app.py --allowed-extensions EXT1 EXT2 # Set allowed extensions
python app.py --allow-write true # Enable write tools (disabled by default)
python app.py --allow-write false # Explicitly disable write tools
python app.py --config custom.json # Use custom config file
python app.py # Use config.json fallback (debugging)
The filesystem server automatically normalizes paths to handle different operating system conventions:
{
"allowed_dirs": [
"D:\\projects", // Windows-style backslashes
"F:/sd/wipes", // Unix-style forward slashes
"C:\\Users\\Me\\Docs" // Mixed formats work too
]
}
"F:\sd\wipes" (Windows natural format)"F:/sd/wipes" (Python-friendly format)# All of these work identically:
list_directory("F:\\sd\\wipes") # Windows format
list_directory("F:/sd/wipes") # Unix format
list_directory("F:\\sd/wipes") # Mixed format
F:\sd\wipesF:/sd/wipesFor more advanced, platform-specific, or legacy MCP client configuration examples (including both "servers" and "mcpServers" formats), see the mcp_configuration_examples.json file in this repository.
This file includes:
"mcpServers" formatRefer to it if you need more flexibility or are working with a non-standard MCP client.
Be the first to review this server!
by Modelcontextprotocol Β· File & Storage
Secure file operations with configurable access controls
by Toleno Β· Developer Tools
Toleno Network MCP Server β Manage your Toleno mining account with Claude AI using natural language.
by mcp-marketplace Β· Developer Tools
Create, build, and publish Python MCP servers to PyPI β conversationally.
by Microsoft Β· Content & Media
Convert files (PDF, Word, Excel, images, audio) to Markdown for LLM consumption
by mcp-marketplace Β· Developer Tools
Scaffold, build, and publish TypeScript MCP servers to npm β conversationally
by mcp-marketplace Β· Finance
Free stock data and market news for any MCP-compatible AI assistant.