Sponsored by Deepsite.site

MCP Server Filesystem Service

Created By
PimpMyNines10 months ago
MCP Filesystem Solution
Content

MCP Server Filesystem Service

This repository implements a highly scalable filesystem service for the MCP server. It provides functionalities such as:

  • Validating and normalizing file paths
  • Reading, writing, and editing files with support for caching
  • Searching files by patterns
  • Creating directory trees and listing directories
  • Enforcing security limits (e.g., maximum file size, allowed directories)

Table of Contents

Overview

The Filesystem Service is built using TypeScript and Node.js. It is designed to:

  • Ensure DRY code following 12-factor app and AWS well-architected principles.
  • Handle file operations securely by validating paths against allowed directories.
  • Cache file contents for improved performance.
  • Provide diff-based file editing with flexible matching.

Installation

  1. Clone the repository:
git clone https://github.com/your-repo/mcp-server-filesystem.git
cd mcp-server-filesystem
  1. Install dependencies:
make install

Usage

Running Locally

To build and run the service locally:

  1. Build the project:
make build-local
  1. Run the service:
npm start

or, if you prefer:

node dist/index.js

Docker & Production

  1. Build the Docker image:
make build
  1. Run the container (with a workspace mounted):
make run
  1. For development mode (with Docker Compose):
make dev
  1. For production mode (with Docker Compose):
make prod

Testing

This project uses Jest for testing.

  • Run unit tests:
make test
  • Run tests in watch mode:
make test-watch
  • Generate test coverage report:
make test-coverage

Test fixtures are set up in the tests/__fixtures__ directory. To update tests or add new ones, modify files under tests/ and run the tests using the above commands.

Development Workflow

  • Install dependencies:
make install
  • Build the project:
make build-local
  • Run the TypeScript compiler in watch mode:
make watch
  • Lint and format code:
make lint
make format

CI/CD Pipelines

GitLab CI

The GitLab pipeline is defined in .gitlab-ci.yml and includes stages for:

  • Linting: Both TypeScript and Python lint checks.
  • Building: Docker image building and pushing.
  • Testing: Running unit and integration tests.
  • Security: Running Snyk tests and npm audit.
  • Versioning & Release: Running version management scripts.
  • Cleanup: Pruning Docker resources.

GitHub Actions

A GitHub Actions workflow is provided in .github/workflows/ci.yml that mirrors the GitLab pipeline. It includes jobs for linting, building, testing, security scanning, versioning, and cleanup.

Making Changes to Tests

  • All tests are located in the tests/ directory.
  • Update test fixtures in tests/setup.ts if you modify how files/directories are structured.
  • Run tests locally using:
make test
  • For coverage, run:
make test-coverage

Contributing

Feel free to open issues or pull requests. When contributing:

  • Follow the coding style and best practices.
  • Update tests to cover any new functionality.
  • Ensure that the CI/CD pipeline passes on both GitLab and GitHub Actions.
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Playwright McpPlaywright MCP server
WindsurfThe new purpose-built IDE to harness magic
DeepChatYour AI Partner on Desktop
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Serper MCP ServerA Serper MCP Server
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Tavily Mcp
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
CursorThe AI Code Editor
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
ChatWiseThe second fastest AI chatbot™
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Amap Maps高德地图官方 MCP Server
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.