rag-mcp-server

KonstantinSKY/rag-mcp-server

3.2

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

  1. Clone the repository:

    git clone https://github.com/KonstantinSKY/rag-mcp-server.git
    cd rag-mcp-server
    
  2. Build and run the server:

    cargo run
    

    The server will start on http://127.0.0.1:8000

  3. 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

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Created by KonstantinSKY

Links