Vijayk-213/Model-Context-Protocol
If you are the rightful owner of Model-Context-Protocol and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This project implements an MCP Server for file system interaction via HTTP requests, supporting file operations and integration with Google Gemini API.
๐ 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! ๐ฏ