MCP Server logo

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

  1. Clone the repository:
git clone https://github.com/khaosans/mcp-server.git
cd mcp-server
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: .\venv\Scripts\activate
  1. 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 directory
  • GET /files/{filename}: Read a specific file
  • POST /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

๐Ÿ‘ค Author

khaosans