MCP Server
by khaosans
MCP Server is a FastAPI-based server that provides WebSocket communication, file management, and tools endpoints. It offers a comprehensive solution for building real-time applications with file handling capabilities.
View on GitHub
Last updated: N/A
MCP Server
A FastAPI-based server providing WebSocket communication, file management, and tools endpoints.
๐ Features
- ๐ File Management API
- ๐ WebSocket Communication
- ๐ ๏ธ Tools Endpoint
- ๐ Static File Serving
- โ Comprehensive Test Suite
๐ ๏ธ Installation
- Clone the repository:
git clone https://github.com/khaosans/mcp-server.git
cd mcp-server
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: .\venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
๐โโ๏ธ Running the Server
Start the server with:
uvicorn server:app --reload --host 0.0.0.0 --port 8080
๐งช Running Tests
Run the test suite with:
python test_server.py
๐ก API Endpoints
HTTP Endpoints
GET /files?q=<query>
: Search files in the public directoryGET /files/{filename}
: Read a specific filePOST /tools
: Execute tools (currently supports summarization)GET /public/*
: Serve static files
WebSocket Endpoint
ws://localhost:8080/ws
: WebSocket endpoint for real-time communication
๐ License
MIT License