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