MCP File Forge
A Model Context Protocol (MCP) server for secure file operations and project scaffolding.
Features
- Secure File Operations: Read, write, copy, move, and delete files with sandboxed access controls
- Project Scaffolding: Create projects from templates with variable substitution
- Windows-First: Optimized for Windows paths, permissions, and conventions
- Search Capabilities: Glob patterns and regex content search
- Configurable Security: Define allowed paths, size limits, and read-only modes
Installation
npm install @mcp-tool-shop/file-forge
Quick Start
With Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"file-forge": {
"command": "node",
"args": ["path/to/mcp-file-forge/build/index.js"],
"env": {
"MCP_FILE_FORGE_ALLOWED_PATHS": "C:/Projects,C:/Users/you/Documents"
}
}
}
}
Standalone
npx @mcp-tool-shop/file-forge
Available Tools
File Reading
read_file- Read file contents with encoding and line range optionsread_directory- List directory contents with metadataread_multiple- Batch read multiple files
File Writing
write_file- Write or overwrite file contentscreate_directory- Create directoriescopy_file- Copy files or directoriesmove_file- Move or rename filesdelete_file- Delete files or directories
Search
glob_search- Find files matching glob patternsgrep_search- Search file contents with regex
Metadata
file_stat- Get file statisticsfile_exists- Check if path exists
Scaffolding
scaffold_project- Create project from templatelist_templates- List available templates
Configuration
Environment Variables
| Variable | Description | Default |
|---|---|---|
MCP_FILE_FORGE_ALLOWED_PATHS |
Comma-separated allowed paths | . |
MCP_FILE_FORGE_READ_ONLY |
Disable write operations | false |
MCP_FILE_FORGE_MAX_FILE_SIZE |
Max file size in bytes | 104857600 |
MCP_FILE_FORGE_LOG_LEVEL |
Logging level | info |
Config File
Create mcp-file-forge.json in the working directory:
{
"sandbox": {
"allowed_paths": ["./projects"],
"denied_paths": ["**/secrets/**"],
"max_file_size": 52428800
}
}
Security
- Path sandboxing restricts operations to allowed directories
- Symlink following is disabled by default
- Read-only mode available for safe browsing
- Size limits prevent memory exhaustion
Development
# Install dependencies
npm install
# Build
npm run build
# Development mode (watch)
npm run dev
# Run tests
npm test
License
MIT
Author
mcp-tool-shop