DM

denshrtie/mcp-file-server

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

0 stars 0 forks 品質 55 トレンド 14

A sandboxed MCP File Server built with Python for my CS3A midterm project.

概要

- Build Your Own MCP File Server Connector - BSCS-3A - CS3-WK06-MCP - Midterms PT. 1 - Python 3.11 - Model Context Protocol (MCP) The MCP File Server Connector is a Python-based application that allows AI clients to manage files through the Model Context Protocol (MCP). The system provides tools for creating, reading, writing, editing, moving, searching, and deleting files. It also supports directory management, file information, basic Git operations, and project checkpoints. To protect files, the server restricts file operations to the designated workspace, D:\Midterms. It also supports local connections through STDIO and remote connections through Streamable HTTP over HTTPS using ngrok and Basic Authentication. 1. Develop an MCP server that allows AI clients to perform file-management operations. 2. Restrict file access to an approved workspace. 3. Validate tool inputs to reduce invalid requests. 4. Support local and remote MCP connections. 5.

README

以下は原文 README の抜粋です。原文を見る。

MCP File Server Connector

1. Project Information

  • Project Title: Build Your Own MCP File Server Connector
  • Course and Section: BSCS-3A
  • Document Reference: CS3-WK06-MCP - Midterms PT. 1
  • Programming Language: Python 3.11
  • Protocol: Model Context Protocol (MCP)

2. Project Description

The MCP File Server Connector is a Python-based application that allows AI clients to manage files through the Model Context Protocol (MCP).

The system provides tools for creating, reading, writing, editing, moving, searching, and deleting files. It also supports directory management, file information, basic Git operations, and project checkpoints.

To protect files, the server restricts file operations to the designated workspace, D:\Midterms. It also supports local connections through STDIO and remote connections through Streamable HTTP over HTTPS using ngrok and Basic Authentication.

3. Project Objectives

The project aims to:

  1. Develop an MCP server that allows AI clients to perform file-management operations.
  2. Restrict file access to an approved workspace.
  3. Validate tool inputs to reduce invalid requests.
  4. Support local and remote MCP connections.
  5. Test the server’s functionality and security.

4. Technologies Used

Technology Purpose
Python 3.11 Main programming language
MCP SDK Connects AI clients to the server’s tools
Pydantic Validates selected tool inputs
pytest Runs automated tests
Git Tracks project changes
ngrok Provides an HTTPS tunnel for remote access
Windows Task Scheduler Starts the server and tunnel at user logon

5. Main Features

  • File Management: Create, read, write, edit, move, and delete files.
  • Directory Management: Create directories and list their contents.
  • File Search: Search for text within files.
  • File Information: Retrieve file details, including size information.
  • Git Tools: Check repository status and view changes.
  • Workspace Security: Reject paths that point outside the approved directory.
  • Input Validation: Check selected tool inputs before processing them.
  • Local Connection: Connect through STDIO using an MCP-compatible client.
  • Remote Connection: Connect through Streamable HTTP using an HTTPS tunnel.
  • Project Tracking: Record checkpoints and read project-state information.

6. Available MCP Tools

The server registers 18 tools.

No. Tool Name Description
1 create_text_file Creates a text file with the provided content.
2 read_text_file Reads the contents of a text file.
3 read_multiple_files Reads multiple files.
4 write_file Writes content to a file.
5 edit_file Replaces specified text in a file.
6 str_replace Performs a string replacement in a file.
7 delete Deletes a supported file or filesystem target.
8 create_directory Creates a directory.
GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →