MCP File Operations Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP File Operations Server read composer.json and summarize this Laravel project"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP File Operations Server
A powerful Model Context Protocol (MCP) server built with Express.js that provides seamless file operations for AI assistants like Claude Desktop and Web Claude.
๐ Features
Automatic Operation Mode Detection: Auto-selects stdio/HTTP mode based on environment
Multiple Project Support: Tool namespace isolation with PROJECT_ID
File Operations: Comprehensive file system access with security controls
Laravel Project Support: Built-in Laravel project structure analysis
Real-time Updates: SSE (Server-Sent Events) for real-time communication
OAuth Integration: Complete OAuth 2.0 flow for Web Claude connections
Git Integration: Comprehensive Git operations with AI-powered commit message generation
Subdirectory Git Support: Manage nested Git repositories independently
Laravel-Optimized Commit Messages: AI generates Laravel-specific commit formats
Related MCP server: mcp-server-laravel
๐ Requirements
Node.js: v18.0.0 or higher (tested with v22.15.0)
npm: Latest version
TypeScript: v5.5.0 or higher
Git: Version control system (for Git integration features)
โ๏ธ Configuration Methods
This server supports 2 configuration methods:
1. Environment Variables
# Direct environment variable specification
SERVER_ROOT=/path/to/project PROJECT_ID=myproject PORT=3001 node dist/index.js
# systemd service configuration example
Environment=SERVER_ROOT=/var/www/project
Environment=PROJECT_ID=production
Environment=PORT=30012. .env File Configuration
Create a .env file in the project root:
# MCP Server Configuration
# Operation mode (auto, stdio, http)
MCP_MODE=auto
# Project settings
PROJECT_ID=myproject
SERVER_ROOT=/var/www/project
# HTTP mode settings
PORT=3001
BASE_URL=https://mcp.your-domain.com
ENDPOINT_PATH=/sse
# Security settings
ALLOWED_EXTENSIONS=.php,.js,.ts,.json,.md,.txt,.yaml,.yml,.blade.php,.service,.conf,.sh,.xml
# Node.js environment
NODE_ENV=productionConfiguration Priority
Environment Variables (highest priority)
Claude Desktop config env settings
.env file
Default values
Claude Desktop Configuration Example
{
"mcpServers": {
"my-project": {
"command": "/path/to/node",
"args": ["/path/to/mcp-server/dist/index.js"],
"env": {
"SERVER_ROOT": "/path/to/project",
"MCP_MODE": "stdio",
"PROJECT_ID": "myproject"
}
}
}
}In this case, Claude Desktop's env settings take highest priority, overriding .env file settings.
Remote Server Configuration Examples
systemd service (environment variables):
Environment=NODE_ENV=production
Environment=SERVER_ROOT=/var/www/project
Environment=PORT=3001
Environment=PROJECT_ID=productionOr .env file:
NODE_ENV=production
SERVER_ROOT=/var/www/project
PORT=3001
PROJECT_ID=production๐๏ธ Operation Modes
Automatic Mode Detection Logic
const MODE = process.env.MCP_MODE || 'auto';
const isHttpArgs = process.argv.includes('--http');
const hasPortEnv = process.env.PORT;
const isStdioMode = MODE === 'stdio' || (MODE === 'auto' && !hasPortEnv && !isHttpArgs);Condition | Operation Mode | Use Case |
| stdio | Desktop Claude (local development) |
| HTTP | Remote server (production) |
| stdio | Desktop Claude (auto-detection) |
| HTTP | Remote server (auto-detection) |
| HTTP | Command line specification |
stdio Mode (Local Development - Recommended)
Features:
Best performance
No network overhead
Desktop Claude exclusive
Direct process communication
Claude Desktop automatically starts and manages processes
Test Method (for verification):
# Build verification
npm run build
# Operation test (exit immediately with Ctrl+C)
node dist/index.js
# Expected output: "Desktop Claude MCP Server started"HTTP Mode (Remote Server)
Features:
Web Claude compatible
Remote access capable
OAuth authentication support
SSL support via Nginx
Startup Methods:
# Environment variable specification
PORT=3001 node dist/index.js
# Explicit specification
MCP_MODE=http PORT=3001 node dist/index.js๐ ๏ธ Installation
Local Development (stdio mode)
# Clone repository
git clone <your-repo-url>
cd mcp-server
# Install dependencies
npm install
# Build project
npm run build
# Test stdio mode
node dist/index.js
# Output: "Desktop Claude MCP Server started"Remote Server (HTTP mode)
# Install dependencies
npm install
# Build project
npm run build
# Start in HTTP mode
PORT=3001 npm start
# Output: "HTTPใตใผใใผ่ตทๅๅฎไบ (Port: 3001)"๐ฏ Usage
With Claude Desktop (stdio mode)
Add to Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"local-project-files": {
"command": "/Users/[USERNAME]/Library/Application Support/Herd/config/nvm/versions/node/v22.15.0/bin/node",
"args": [
"/path/to/mcp-server/dist/index.js"
],
"env": {
"SERVER_ROOT": "/path/to/your/project",
"MCP_MODE": "stdio",
"PROJECT_ID": "myproject"
}
},
"mcp-server-files": {
"command": "/Users/[USERNAME]/Library/Application Support/Herd/config/nvm/versions/node/v22.15.0/bin/node",
"args": [
"/path/to/mcp-server/dist/index.js"
],
"env": {
"SERVER_ROOT": "/path/to/mcp-server",
"MCP_MODE": "stdio",
"PROJECT_ID": "mcp"
}
}
}
}With Claude Desktop (Remote HTTP mode)
{
"mcpServers": {
"remote-server-files": {
"command": "/Users/[USERNAME]/Library/Application Support/Herd/config/nvm/versions/node/v22.15.0/bin/npx",
"args": [
"mcp-remote",
"https://your-server.com/sse"
],
"env": {
"PATH": "/Users/[USERNAME]/Library/Application Support/Herd/config/nvm/versions/node/v22.15.0/bin:/usr/local/bin:/usr/bin:/bin",
"NODE_PATH": "/Users/[USERNAME]/Library/Application Support/Herd/config/nvm/versions/node/v22.15.0/lib/node_modules"
}
}
}
}Important Notes for Multiple Project Management
PROJECT_ID is required:
Set different
PROJECT_IDfor each projectPrevents tool name conflicts (e.g.,
projecta_list_files,projectb_list_files)Auto-generated from directory name if not set
Finding Your Node.js Path
# Find Node.js installation path
which node
# If using nvm (Node Version Manager)
nvm which current
# Example outputs:
# /Users/username/Library/Application Support/Herd/config/nvm/versions/node/v22.15.0/bin/node
# /usr/local/bin/node
# /opt/homebrew/bin/node๐ Production Remote Server Setup
systemd Service Configuration
/etc/systemd/system/mcp-server.service:
[Unit]
Description=MCP File Operations Server
Documentation=https://github.com/itcomllc/mcp-server
After=network.target
Wants=network.target
[Service]
Type=simple
User=web
Group=web
WorkingDirectory=/var/www/project/mcp-server
Environment=NODE_ENV=production
Environment=SERVER_ROOT=/var/www/project
Environment=PORT=3001
ExecStart=/usr/bin/node dist/index.js
Restart=always
RestartSec=10
StandardOutput=journal
StandardError=journal
SyslogIdentifier=mcp-server
# Security settings
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=strict
ProtectHome=false
ReadWritePaths=/var/www/project/mcp-server
ReadOnlyPaths=/var/www/project
# Resource limits
LimitNOFILE=65536
LimitNPROC=4096
[Install]
WantedBy=multi-user.targetNginx Configuration
/etc/nginx/sites-available/mcp-server:
server {
listen 80;
listen 443 ssl http2;
server_name mcp.your-domain.com;
root /var/www/project/mcp-server;
# SSL configuration
ssl_certificate /etc/letsencrypt/live/mcp.your-domain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mcp.your-domain.com/privkey.pem;
# SSL optimization
ssl_protocols TLSv1.3 TLSv1.2;
ssl_ciphers 'ECDHE+AESGCM:ECDHE+CHACHA20:DHE+AESGCM:!DSS:!3DES:!RC4:!aNULL:!eNULL:!MD5:!SHA1:!EXP:!PSK:!SRP';
ssl_ecdh_curve prime256v1;
ssl_prefer_server_ciphers on;
# MCP SSE endpoint
location /sse {
proxy_pass http://127.0.0.1:3001;
proxy_http_version 1.1;
proxy_set_header Connection '';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# SSE specific settings
proxy_cache off;
proxy_buffering off;
chunked_transfer_encoding off;
proxy_read_timeout 300s;
proxy_connect_timeout 75s;
}
# OAuth endpoints
location ~ ^/(\.well-known/oauth-authorization-server|authorize|token|register) {
proxy_pass http://127.0.0.1:3001;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# Health check endpoint
location /health {
proxy_pass http://127.0.0.1:3001;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Short timeout for health checks
proxy_read_timeout 10s;
proxy_send_timeout 10s;
proxy_connect_timeout 5s;
}
# Security headers
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
}Deployment Steps
# 1. Prepare code on server
git clone <your-repo-url> /var/www/project/mcp-server
cd /var/www/project/mcp-server
npm install
npm run build
# 2. Enable systemd service
sudo systemctl enable mcp-server
sudo systemctl start mcp-server
sudo systemctl status mcp-server
# 3. Enable Nginx configuration
sudo ln -s /etc/nginx/sites-available/mcp-server /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
# 4. Obtain SSL certificate (Let's Encrypt)
sudo certbot --nginx -d mcp.your-domain.com
# 5. Verify operation
curl https://mcp.your-domain.com/health๐ง Available Tools
All tools are automatically prefixed with your PROJECT_ID:
File Operations
[PROJECT_ID]_list_files
List files and directories with filtering options.
{
"directory": ".",
"recursive": false,
"include_hidden": false,
"exclude_dirs": ["vendor", "node_modules", "storage", ".git"]
}[PROJECT_ID]_read_file
Read file contents with encoding support.
{
"file_path": "path/to/file.txt",
"encoding": "utf8"
}[PROJECT_ID]_get_laravel_structure
Analyze Laravel project structure and get statistics.
{
"project_root": ".",
"include_config": true
}[PROJECT_ID]_search_files
Search files with pattern matching and content search.
{
"directory": ".",
"pattern": "Controller",
"content_search": "function",
"file_extension": ".php"
}[PROJECT_ID]_get_server_info
Get server status and configuration information.
{}Git Operations
[PROJECT_ID]_git_status
Display current Git repository status.
{
"directory": "subdirectory-name" // optional: for subdirectory Git repos
}[PROJECT_ID]_git_diff
Show Git diff with staging support.
{
"staged": false, // show staged changes if true
"file_path": "specific/file.php", // optional: specific file diff
"directory": "subdirectory-name" // optional: for subdirectory Git repos
}[PROJECT_ID]_git_log
Display Git commit history with filtering.
{
"limit": 10, // number of commits to show
"oneline": false, // compact one-line format
"author": "john@example.com", // filter by author
"since": "1 week ago", // time period filter
"directory": "subdirectory-name" // optional: for subdirectory Git repos
}[PROJECT_ID]_git_branch
Show Git branch information.
{
"directory": "subdirectory-name" // optional: for subdirectory Git repos
}[PROJECT_ID]_git_show
Display detailed commit information.
{
"commit": "HEAD", // commit hash or reference
"directory": "subdirectory-name" // optional: for subdirectory Git repos
}[PROJECT_ID]_git_blame
Show line-by-line change history for a file.
{
"file_path": "app/Models/User.php", // required: file to analyze
"directory": "subdirectory-name" // optional: for subdirectory Git repos
}[PROJECT_ID]_git_generate_commit_message
AI-powered commit message generation for Laravel projects.
{
"directory": "subdirectory-name" // optional: for subdirectory Git repos
}Features:
Analyzes staged changes automatically
Recognizes Laravel file patterns (Controllers, Models, Migrations, Views, Routes)
Generates appropriate commit prefixes:
feat(api):,feat(db):,feat(ui):,config:Provides meaningful commit messages based on actual code changes
Example Generated Messages:
feat(api): UserController - ADD: role validation methodfeat(db): create_users_table - ADD: role_id columnfeat(ui): dashboard.blade.php - ADD: user statistics widget
[PROJECT_ID]_git_commit_analyze
Analyze changes and suggest commit splitting strategies.
{
"directory": "subdirectory-name" // optional: for subdirectory Git repos
}Analysis Features:
File change statistics (new, modified, deleted, renamed)
Commit size recommendations
Suggestions for splitting large commits
Laravel-specific pattern recognition
๐ Git Workflow Integration
Typical Development Workflow
# 1. Check current repository status
# [PROJECT_ID]_git_status
# 2. Review changes before staging
# [PROJECT_ID]_git_diff
# 3. Stage files manually
git add app/Http/Controllers/UserController.php
# 4. Generate AI commit message
# [PROJECT_ID]_git_generate_commit_message
# 5. Commit with generated message
git commit -m "feat(api): UserController - ADD: role validation method"Subdirectory Git Management
For projects with nested Git repositories (e.g., main project + MCP server):
# Main project operations
# [PROJECT_ID]_git_status
# Subdirectory operations
# [PROJECT_ID]_git_status({directory: "mcp-server"})
# [PROJECT_ID]_git_diff({directory: "mcp-server"})
# [PROJECT_ID]_git_generate_commit_message({directory: "mcp-server"})Laravel-Optimized Commit Messages
The AI analyzes your Laravel project structure and generates appropriate commit messages:
File Type | Generated Prefix | Example |
Controllers |
|
|
Models |
|
|
Migrations |
|
|
Views |
|
|
Routes |
|
|
Config |
|
|
Commit Analysis and Optimization
Use git_commit_analyze to optimize your commits:
Large commits: Suggests splitting by functionality
Mixed changes: Recommends separating new features from bug fixes
Laravel patterns: Recognizes framework-specific file types
โ๏ธ Environment Variables
Variable | Description | Default | stdio | HTTP |
| Operation mode: auto/stdio/http |
| โ | โ |
| Tool namespace identifier | auto-generated | โ | โ |
| Root directory for file operations |
| โ | โ |
| HTTP server port | none | โ | โ |
| Base URL for HTTP mode |
| โ | โ |
| MCP endpoint path |
| โ | โ |
| Enable Git integration features |
| โ | โ |
๐ Troubleshooting
Operation Mode Verification
# stdio mode verification
node dist/index.js
# Output: "Desktop Claude MCP Server started"
# HTTP mode verification
PORT=3001 node dist/index.js
# Output: "HTTPใตใผใใผ่ตทๅๅฎไบ (Port: 3001)"Common Issues
Node.js path not found:
which node
nvm which currentPROJECT_ID conflicts:
Set different PROJECT_ID for each project
Same PROJECT_ID causes tool name conflicts
systemd service won't start:
sudo systemctl status mcp-server
sudo journalctl -u mcp-server -fNginx configuration errors:
sudo nginx -t
sudo tail -f /var/log/nginx/error.log๐ Configuration Templates
claude-desktop-config.json (Complete)
{
"mcpServers": {
"local-project-a": {
"command": "/path/to/node",
"args": ["/path/to/mcp-server/dist/index.js"],
"env": {
"SERVER_ROOT": "/path/to/project-a",
"MCP_MODE": "stdio",
"PROJECT_ID": "projecta"
}
},
"local-project-b": {
"command": "/path/to/node",
"args": ["/path/to/mcp-server/dist/index.js"],
"env": {
"SERVER_ROOT": "/path/to/project-b",
"MCP_MODE": "stdio",
"PROJECT_ID": "projectb"
}
},
"remote-production": {
"command": "/path/to/npx",
"args": ["mcp-remote", "https://mcp.your-domain.com/sse"],
"env": {
"PATH": "/path/to/node/bin:/usr/local/bin:/usr/bin:/bin"
}
}
}
}๐ก Best Practices
Use stdio mode for local development - Best performance
Use HTTP mode for production - Nginx + systemd + SSL
Namespace separation with PROJECT_ID - Prevent tool name conflicts
Mode control with environment variables - Explicit specification with
MCP_MODESecurity settings - systemd restrictions and Nginx headers
๐ค Contributing
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
Anthropic for the Model Context Protocol specification
Cloudflare for MCP implementation guidance
The MCP community for protocol development and best practices
Seamless MCP experience from local development to remote production!
Available Tools
13 toolsapp_get_laravel_structureC
ใappใLaravelใใญใธใงใฏใใฎๆง้ ใๅๅพใใพใ
Inputs: project_root, include_config.
app_get_server_infoC
ใappใใตใผใใผๆ ๅ ฑใๅๅพใใพใ
Inputs: no named parameters.
app_git_blameB
ใappใใใกใคใซใฎ่กใใจใฎๅคๆดๅฑฅๆญดใ่กจ็คบใใพใ
Inputs: file_path (required), directory.
app_git_branchC
ใappใGitใใฉใณใๆ ๅ ฑใ่กจ็คบใใพใ
Inputs: directory.
app_git_commit_analyzeB
ใappใ็พๅจใฎๅคๆดๅ ๅฎนใๅๆใใฆใณใใใๅๅฒใๆๆกใใพใ
Inputs: directory.
app_git_diffC
ใappใGitๅทฎๅใ่กจ็คบใใพใ
Inputs: staged, directory, file_path.
app_git_generate_commit_messageB
ใappใ็พๅจใฎๅคๆดๅ ๅฎนใใAIใใณใใใใกใใปใผใธใ็ๆใใพใ
Inputs: directory.
app_git_logC
ใappใGitใณใใใๅฑฅๆญดใ่กจ็คบใใพใ
Inputs: limit, since, author, oneline, +1 more.
app_git_showC
ใappใ็นๅฎใฎใณใใใใฎ่ฉณ็ดฐใ่กจ็คบใใพใ
Inputs: commit, directory.
app_git_statusC
ใappใGitใชใใธใใชใฎ็พๅจใฎ็ถๆ ใ่กจ็คบใใพใ
Inputs: directory.
app_list_filesC
ใappใใใฃใฌใฏใใชๅ ใฎใใกใคใซไธ่ฆงใๅๅพใใพใ
Inputs: directory, recursive, exclude_dirs, include_hidden.
app_read_fileC
ใappใใใกใคใซใฎๅ ๅฎนใ่ชญใฟๅใใพใ
Inputs: file_path (required), encoding.
app_search_filesC
ใappใใใกใคใซๆค็ดขใ่กใใพใ
Inputs: pattern, directory, exclude_dirs, content_search, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
TDQS
Scored across 13 tools
Most tools have clearly distinct purposes: the git inspection commands (status, branch, diff, log, show, blame) target different aspects of repository state, and the file tools (list, read, search) are separable. The only mild overlap is between app_git_generate_commit_message and app_git_commit_analyze, both of which analyze current changes, but their intended outputs differ enough to distinguish them.
Every tool follows the same app_<verb>_<noun> snake_case convention, with no mixing of camelCase or inconsistent verb styles. The prefix is uniform across git, file, and server-info tools, making the set predictable.
With 13 tools, the set is within a reasonable range for a file-and-git operations server. Each tool has a discrete role, and there is no obvious filler or redundant tool bloating the surface.
Despite the server being named 'MCP File Operations Server', the file surface is read-only: it offers list, read, and search but no create, write, update, delete, move, or copy operations. The git surface is also largely read-only plus message generation and commit-split analysis, but no actual commit/add/checkout operations, leaving major workflow gaps for file and git lifecycle management.
Maintenance
Related MCP Connectors
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Connect AI assistants to your approved computer for files, commands, browser and desktop tasks.
Use your own Windows, Mac or Linux computer from ChatGPT, Claude, Cursor or Gemini CLI: run commands, read, write and search files, run long processes. Your computer only makes an outgoing connection (no open ports or VPN). Read-only mode, allowed folders, blocked commands and an action log keep you in control. Free plan available.
Persistent cloud workspaces for AI agents: run commands, edit files, use git and a browser.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables secure execution of Laravel Artisan commands through AI assistants, allowing controlled management of Laravel projects via natural language.6MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to introspect a Laravel application's routes, models, controllers, migrations, and more through the Model Context Protocol, running locally via php artisan commands and filesystem scanning.8 npmMIT
- AlicenseBqualityDmaintenanceA guarded Model Context Protocol server that lets AI assistants inspect, edit, test, and validate explicitly approved local software projects, featuring 49 focused MCP tools for project discovery, safe editing, Git inspection, Laravel integration testing, and more.491MIT
- AlicenseNot gradedqualityDmaintenanceSecure bridge between AI clients and local Laravel projects, enabling AI to run artisan commands, read logs and routes, and safely read/write code with layered security protections.9 npmMIT