MCP YAML Filesystem Manager
Provides tools for managing Home Assistant YAML configuration files: reading, creating and updating configuration files with YAML syntax validation, surgical SEARCH/REPLACE diff edits, pattern search across all config files, and directory tree listing. The config tree can be a local directory or a Home Assistant config directory accessed directly over an SMB share (e.g. on a NAS) without needing a system mount or root privileges.
Provides tools for managing YAML files with validation: read_file, create_file, update_file (SEARCH/REPLACE diff blocks), grep_files for searching patterns across YAML files, and list_directory_structure for viewing the directory tree, with path traversal protection and extension whitelisting.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
MCP YAML Filesystem Manager
A secure MCP server for managing YAML configuration files. This tool provides AI assistants with controlled access to YAML files through the Model Context Protocol (MCP). Originally built for managing Home Assistant configuration files, it works with any YAML-based configuration system.
Supports both local directories and SMB network shares (useful for accessing Home Assistant configs on a NAS or remote server).
Features
Read, create, and update YAML files with syntax validation
Surgical file edits using SEARCH/REPLACE diff blocks
Grep search across all managed YAML files
Directory tree listing
SMB network share support without requiring system mounts or root privileges
Path traversal protection and extension whitelisting
HTTP transport with optional Google OAuth authentication for remote access
Docker deployment for network-accessible MCP server mode
Related MCP server: Config MCP Server
Architecture
Component Overview
classDiagram
class MCPServer {
+config: Config
+yaml_manager: YAMLConfigManager
+diff_engine: YAMLDiffEngine
+read_file(file_path) str
+create_file(file_path, content) str
+update_file(file_path, diff_content) str
+grep_files(search_pattern, file_pattern) str
+list_directory_structure() str
}
class YAMLConfigManager {
+config_dir: Path
+allowed_extensions: set
+read_file(file_path) str
+write_file(file_path, content)
+create_file(file_path, content)
+list_yaml_files(pattern) list
+grep_files(pattern, file_pattern) list
+validate_path(file_path) str
}
class YAMLDiffEngine {
+parse_diff(diff_content) list
+apply_diff(content, diff_content) str
+generate_diff_preview(diff_content) str
}
class FileSystemBackend {
<<abstract>>
+exists(path) bool
+read_text(path) str
+write_text(path, content)
+glob(pattern) list
+resolve_path(path) str
+root_path str
}
class LocalFileSystem {
+_root: Path
}
class SMBFileSystem {
+_conn: SMBConnection
+_base_path: str
+_ignore_dirs: frozenset
}
class Config {
+yaml_root_path: Path
+allowed_extensions: set
+smb_config: SMBConfig
+http_config: HTTPConfig
+oauth_config: OAuthConfig
+get() Config
}
MCPServer --> YAMLConfigManager : uses
MCPServer --> YAMLDiffEngine : uses
MCPServer --> Config : reads
YAMLConfigManager --> FileSystemBackend : delegates to
FileSystemBackend <|-- LocalFileSystem
FileSystemBackend <|-- SMBFileSystemHappy Path Flow
sequenceDiagram
participant Client as MCP Client
participant Server as MCPServer
participant Manager as YAMLConfigManager
participant Engine as YAMLDiffEngine
participant FS as Filesystem / SMB Share
Client->>Server: update_file(file_path, diff)
Server->>Manager: read_file(file_path)
Manager->>FS: open and read file
FS-->>Manager: raw content
Manager-->>Server: current content
Server->>Engine: apply_diff(content, diff)
Engine-->>Server: updated content (YAML validated)
Server->>Manager: write updated content
Manager->>FS: write file
FS-->>Manager: success
Manager-->>Server: confirmation
Server-->>Client: success responseUsage
Option A: Docker (recommended for remote/SMB access)
Clone and configure:
git clone https://github.com/max-rousseau/mcp-yamlfilesystem.git
cd mcp-yamlfilesystem
cp .env.example .env
cp config/config.example config/config
chmod 600 config/configEdit
config/configwith your YAML source (see Configuration below). The config file mount is required — the container will not start without it.For local mode, add a data volume to
docker-compose.yml:
volumes:
- ./config/config:/home/mcp/.config/mcp-yamlfilesystem/config:ro
- /path/to/your/yaml/files:/data:rwBuild and start:
docker compose up -d --buildAdd to Claude Desktop (
~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"yaml-filesystem": {
"command": "npx",
"args": ["mcp-remote", "http://127.0.0.1:8000/mcp"]
}
}
}Option B: pipx (recommended for local directories)
Install:
pipx install mcp-yamlfilesystemAdd to Claude Desktop (
~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"yaml-filesystem": {
"command": "mcp-yamlfilesystem",
"args": ["--local-path", "/path/to/your/yaml/files"]
}
}
}For SMB access via pipx, copy config/config.example to ~/.config/mcp-yamlfilesystem/config and configure the SMB settings there.
Configuration
Edit config/config (Docker) or ~/.config/mcp-yamlfilesystem/config (pipx). See config/config.example for all options.
Local directory:
MCP_FILESYSTEM_LOCAL_PATH=/dataSMB network share:
MCP_FILESYSTEM_SMB_PATH=//nas.local/homeassistant/config
MCP_FILESYSTEM_SMB_USER=your_username
MCP_FILESYSTEM_SMB_PASSWORD=your_password
MCP_FILESYSTEM_SMB_IGNORE_DIRS=deps,.storage,backups,__pycache__Available Tools
Tool | Description |
| Read contents of a YAML file |
| Create a new YAML file with syntax validation |
| Surgical edits using SEARCH/REPLACE diff blocks |
| Search for patterns across YAML files |
| View directory tree |
CLI Options
Flag | Description |
| Path to directory containing YAML files |
| Test connection to configured filesystem and exit |
| Enable HTTP streaming transport (default: stdio) |
| Host address for HTTP transport |
| Port for HTTP transport |
| Endpoint path for HTTP transport |
| Enable/disable OAuth for HTTP mode |
| Public URL for OAuth callbacks |
Security Considerations
Local mode: Path traversal protection resolves symlinks before validating containment, preventing escape from the configured root directory.
SMB mode: Path containment is enforced textually (normalizing
..components). Symlinks on the remote share are not resolved, so containment depends on share-level permissions configured on the SMB server. Restrict share access to the intended directory tree.HTTP mode: The built-in HTTP transport does not enforce rate limiting or connection limits. When exposing the server over a network, deploy behind a reverse proxy (nginx, caddy, traefik) with appropriate rate limiting and request size constraints.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Safe folder access for ChatGPT and Claude: read, write and search files, risky tools opt-in.
Securely search and manage workspace context files for AI agents and teams.
- DNS-DATA RemoteDeprecatedcom.dns-data
Connect AI assistants to authorized Windows and macOS devices for files, commands, and management.
Your own computer's files from ChatGPT or Claude: folder rules, confirmations and undo.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides secure file system operations for AI assistants including directory listing, file reading/writing, deletion, searching, and copying. Features safety controls like path validation, permission checks, and file size limits.-
- FlicenseBqualityFmaintenanceEnables AI assistants to search documentation, read and update configuration files, and discover settings across your development workspace. Supports JSON, YAML, TOML, and Markdown files with seamless integration for GitHub Copilot and other MCP clients.5-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to safely explore directories, read files, search content by pattern or filename, and edit files with checksum verification and dry-run preview within sandboxed filesystem access.76MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to read, write, and manage files on the local system with security features like path restrictions and optional read-only mode.92MIT