KonstantinSKY/rag-mcp-server
If you are the rightful owner of rag-mcp-server 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.
A minimal Model Context Protocol (MCP) server built in Rust using the Rocket framework, designed for search functionality and extendable with RAG capabilities.
RAG MCP Server
A minimal Model Context Protocol (MCP) server built in Rust using the Rocket framework. This server provides a simple HTTP API for search functionality and is designed to be extended with RAG (Retrieval-Augmented Generation) capabilities.
Features
- HTTP API: Simple REST endpoint for search queries
- Rocket Framework: Built using Rust's Rocket web framework
- JSON Support: Accepts and returns JSON payloads
- Console Logging: Prints received queries to console for debugging
- Minimal Design: Clean, focused implementation ready for extension
API Endpoints
POST /search
Accepts a JSON payload with a search query and returns a simple response.
Request:
{
"query": "your search query here"
}
Response:
{
"result": "ok"
}
Quick Start
Prerequisites
- Rust 1.70+ and Cargo
- No additional dependencies required
Installation & Running
-
Clone the repository:
git clone https://github.com/KonstantinSKY/rag-mcp-server.git cd rag-mcp-server
-
Build and run the server:
cargo run
The server will start on
http://127.0.0.1:8000
-
Test the server:
curl -X POST http://localhost:8000/search \ -H "Content-Type: application/json" \ -d '{"query": "test search query"}'
Expected response:
{"result":"ok"}
Console output:
Received query: test search query
Project Structure
rag_mcp_server/
āāā src/
ā āāā main.rs # Main server implementation
āāā promts/
ā āāā p1.md # Project specification
āāā Cargo.toml # Dependencies and project config
āāā README.md # This file
Dependencies
- rocket: Web framework with JSON support
- serde: Serialization/deserialization
- serde_json: JSON handling
- tokio: Async runtime
Development
Building
cargo build
Testing
# Start the server
cargo run
# In another terminal, test the endpoint
curl -X POST http://localhost:8000/search \
-H "Content-Type: application/json" \
-d '{"query": "hello world"}'
Future Enhancements
This minimal server is designed to be extended with:
- RAG Functionality: Vector embeddings and similarity search
- Document Storage: Integration with vector databases
- AI Model Integration: Connection to language models
- Authentication: API key or token-based auth
- Rate Limiting: Request throttling and abuse protection
- Model Context Protocol: Full MCP specification compliance
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Created by KonstantinSKY
Links
- Repository: https://github.com/KonstantinSKY/rag-mcp-server
- Issues: https://github.com/KonstantinSKY/rag-mcp-server/issues
- Rocket Framework: https://rocket.rs/
- Model Context Protocol: https://modelcontextprotocol.io/