πŸš€ MCP File System API

by Vijayk-213

3 stars
47 downloads
Not rated
GitHub

About

MCP implementation code that sets up the server, integrates the LLaMA model for summarization, and serves it via a Flask application.

Details

Author
Vijayk-213
GitHub stars
3
Downloads
47
Categories
Developer Tools

- Read .txt, .csv, .json, .xml, and .docx files.
- Stream large files efficiently.
- Integrate Google Gemini API for text summarization.
- Cloud Run deployment support.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name πŸš€ MCP File System API
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Clone the repository, create and activate a Python 3.9+ virtual environment, then install dependencies from requirements.txt. Set the MCP_SERVER_URL and GEMINI_API_KEY environment variables in a .env file. Start the MCP server with uvicorn mcp_server:app --host 127.0.0.1 --port 8000 --reload, then run python main.py. Use the GET /read-text-from-file?file_path=... endpoint to read files and POST /invoke to call MCP functions.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "\ud83d\ude80 mcp file system api": {
            "Model-Context-Protocol": {
                "command": "python3",
                "args": [
                    "-m",
                    "venv",
                    "venv"
                ]
            }
        }
    }
}

McpServers

{
    "Model-Context-Protocol": {
        "command": "python3",
        "args": [
            "-m",
            "venv",
            "venv"
        ]
    }
}

πŸš€ MCP File System API

πŸ“Œ Overview

This project implements an MCP (Model Context Protocol) Server that allows interaction with a file system via HTTP requests. It supports file creation, reading, copying, moving, and deletion using FastAPI. Additionally, it integrates with Google Gemini API to process and summarize file contents.

---

πŸ“‚ Features

βœ… Read various file formats (.txt, .csv, .json, .xml, .docx) βœ… Stream large files efficiently βœ… Integrate with Google Gemini API for text summarization βœ… Cloud Run deployment support

---

πŸ› οΈ Tech Stack

- Python 3.9+ - FastAPI - MCP (Model Context Protocol) - Google Gemini API - Uvicorn (ASGI Server) - httpx (Async HTTP requests) - aiofiles (Async File Handling) - Docker & Cloud Run

---

πŸš€ Getting Started

1️⃣ Clone the Repository

$ git clone https://github.com/Vijayk-213/Model-Context-Protocol.git
$ cd Model-Context-Protocol

2️⃣ Set Up a Virtual Environment

$ python3 -m venv venv
$ source venv/bin/activate  # On Windows use venv\Scripts\activate

3️⃣ Install Dependencies

$ pip install -r requirements.txt

4️⃣ Set Environment Variables

Create a .env file and add your Google Gemini API Key:
MCP_SERVER_URL=http://127.0.0.1:8000
GEMINI_API_KEY=your_gemini_api_key

---

πŸ”„ Running the Application

Start the MCP Server

$ uvicorn mcp_server:app --host 127.0.0.1 --port 8000 --reload

Run the Main Application

$ python main.py

---

πŸ“Œ API Endpoints

| Method | Endpoint | Description |
|--------|----------------|---------------------------------|
| GET | /read-text-from-file?file_path=path.txt | Read file contents |
| POST | /invoke | Call MCP function |

---

πŸ› οΈ Future Enhancements

βœ… Implement WebSockets for real-time file updates βœ… Add support for cloud storage (Google Cloud Storage, AWS S3) βœ… Improve error handling & logging

---

πŸ“Œ Contributing

Feel free to open issues or pull requests to improve the project!

---

πŸš€ Happy Coding! 🎯

No reviews yet β€” be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.