A modular implementation of a Retrieval Augmented Generation server using the Model Control Protocol (MCP).
- Vector database integration with ChromaDB
- PDF document loading and processing
- Semantic search over document contents
- Specialized prompts for document analysis
- MCP server implementation with tools, resources, and prompts
- Clone the repository:
git clone https://github.com/yourusername/rag-mcp.git
cd rag-mcp- Install the package:
pip install -e .- Create a
.envfile based on the example:
cp .env.example .env- Edit the
.envfile with your API key and other settings:
API_KEY=your_api_key_here
CHROMA_DB_PATH=./chromadb
PDF_DIRECTORY=./testing
python -m rag_mcp.serverrag_mcp/: Main packagedatabase/: ChromaDB client and vector database operationstools/: MCP tools implementationresources/: Document resource handlersprompts/: Specialized prompts for document analysis
tests/: Unit tests
python -m unittest discover- Create a new file in the
toolsdirectory - Implement your tool function
- Update the
TOOL_HANDLERSandTOOL_DEFINITIONSintools/__init__.py
- Add your prompt implementation in
prompts/analysis_prompts.py - Update the
PROMPT_HANDLERSandPROMPT_DEFINITIONS
MIT