Skip to main content
Glama

MCP File & Git Manager Server

by osamaloup

MCP File & Git Manager Server

A Model Context Protocol (MCP) server that provides file and git operations for n8n workflows.

Features

File Operations

  • read_file: Read file contents

  • write_file: Create or update files

  • list_files: List files and directories (with recursive option)

  • delete_file: Delete files or directories

  • create_directory: Create new directories

Git Operations

  • git_status: Check repository status

  • git_add: Stage files for commit

  • git_commit: Create commits

  • git_push: Push to remote repository

  • git_pull: Pull from remote repository

  • git_log: View commit history

  • git_diff: Show file differences

Search

  • search_in_files: Search for text patterns in files

Quick Start

Local Development

# Install dependencies npm install # Build TypeScript npm run build # Start server npm start

Docker

# Build image docker build -t mcp-file-git-server . # Run container docker run -d \ --name mcp-file-git-server \ -p 3001:3001 \ -e PROJECT_ROOT=/workspace \ -v /path/to/your/project:/workspace:rw \ mcp-file-git-server

Docker Compose

Add to your docker-compose.yml:

services: mcp-server: build: ./mcp-file-git-server container_name: mcp-file-git-server environment: - PROJECT_ROOT=/workspace - PORT=3001 - NODE_ENV=production ports: - "3001:3001" volumes: - /path/to/your/project:/workspace:rw - ~/.gitconfig:/root/.gitconfig:ro - ~/.ssh:/root/.ssh:ro networks: - n8n-traefik_default restart: unless-stopped healthcheck: test: ["CMD", "wget", "-q", "--spider", "http://localhost:3001/health"] interval: 30s timeout: 10s retries: 3

Configuration

Environment Variables

  • PROJECT_ROOT: Path to project directory (default: /workspace)

  • PORT: Server port (default: 3001)

Endpoints

  • Health Check: GET http://localhost:3001/health

  • SSE Endpoint: POST http://localhost:3001/sse (for n8n-nodes-mcp)

  • Message Endpoint: POST http://localhost:3001/message

n8n Integration

Create MCP Credential in n8n

  1. Go to CredentialsNew

  2. Search for "MCP"

  3. Configure:

    • Transport: SSE (Server-Sent Events)

    • URL: http://mcp-file-git-server:3001/sse

  4. Save

Use in Workflow

  1. Add MCP Client node

  2. Select your MCP credential

  3. Choose operation (List Tools, Call Tool, etc.)

  4. Connect to AI Agent Tool via ai_tool connection

Testing

Test Health Endpoint

curl http://localhost:3001/health

Test SSE Endpoint

curl -X POST http://localhost:3001/sse \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'

Troubleshooting

Permission Denied

Ensure the mounted project directory has correct permissions:

sudo chown -R $(id -u):$(id -g) /path/to/your/project

Git Not Working

Initialize git in the project directory:

docker exec -it mcp-file-git-server sh cd /workspace git init git config user.name "Your Name" git config user.email "your@email.com" exit

Connection Issues

Check Docker network connectivity:

# From n8n container docker exec -it n8n-traefik-n8n-1 sh wget -O- http://mcp-file-git-server:3001/health exit

License

MIT

-
security - not tested
F
license - not found
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Provides file system operations (read, write, list, delete) and Git repository management (status, commit, push, pull, diff) for n8n workflows through the Model Context Protocol.

  1. Features
    1. File Operations
    2. Git Operations
    3. Search
  2. Quick Start
    1. Local Development
    2. Docker
    3. Docker Compose
  3. Configuration
    1. Environment Variables
    2. Endpoints
  4. n8n Integration
    1. Create MCP Credential in n8n
    2. Use in Workflow
  5. Testing
    1. Test Health Endpoint
    2. Test SSE Endpoint
  6. Troubleshooting
    1. Permission Denied
    2. Git Not Working
    3. Connection Issues
  7. License

    MCP directory API

    We provide all the information about MCP servers via our MCP API.

    curl -X GET 'https://glama.ai/api/mcp/v1/servers/osamaloup/mcp-file-git-server'

    If you have feedback or need assistance with the MCP directory API, please join our Discord server