RAG MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@RAG MCP Serversearch our knowledge base for machine learning basics"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
RAG MCP Server
A simple Model Context Protocol (MCP) server that provides RAG (Retrieval-Augmented Generation) capabilities to Claude Desktop. This allows Claude to search through your custom knowledge base!
🤔 What is MCP?
Model Context Protocol (MCP) is an open standard created by Anthropic that allows AI assistants like Claude to securely connect to external data sources and tools. Think of it as a way to give Claude superpowers by connecting it to your own data and APIs.
Related MCP server: lake-of-vectors
🎯 What Does This Server Do?
This MCP server exposes a search_rag tool that Claude Desktop can use to search through a knowledge base. In this example, it returns test data, but you can easily customize it to:
Query your own vector database
Search through your documents
Connect to your RAG API
Access any custom data source
🚀 Quick Start
New to this? Check out QUICKSTART.md for a simplified step-by-step guide!
Prerequisites
Python 3.10 or higher (Download Python)
Claude Desktop (Download here)
Basic familiarity with command line
Step 1: Clone or Download This Repository
git clone https://github.com/torkian/rag-mcp-server.git
cd rag-mcp-serverStep 2: Install Dependencies
pip install -r requirements.txtStep 3: Test the Server
Make sure the server runs correctly:
python server.pyYou should see the server start. Press Ctrl+C to stop it.
Step 4: Configure Claude Desktop
Find your Claude Desktop configuration file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Open the file and add this configuration (replace /path/to/ with your actual path):
{
"mcpServers": {
"rag-server": {
"command": "python3",
"args": ["/absolute/path/to/rag-mcp-server/server.py"]
}
}
}Important: Use the absolute path to server.py!
Finding Your Python Path
If python3 doesn't work, find your Python path:
# macOS/Linux
which python3
# Windows (Command Prompt)
where pythonUse the full path in your config, for example:
{
"mcpServers": {
"rag-server": {
"command": "/usr/local/bin/python3",
"args": ["/Users/yourname/rag-mcp-server/server.py"]
}
}
}Step 5: Restart Claude Desktop
Completely quit Claude Desktop (don't just close the window)
macOS: Press
Cmd+Qor go to Claude → QuitWindows: Right-click the system tray icon and select Quit
Reopen Claude Desktop
Look for the 🔌 icon at the bottom of the chat window - this means your MCP server is connected!
Step 6: Test It!
In Claude Desktop, try asking:
Use the search_rag tool to find information about PythonYou should see Claude call your tool and return the test message!
📝 How to Customize
Option 1: Add Your Own Hardcoded Data
Edit server.py and modify the KNOWLEDGE_BASE list (lines 11-39):
KNOWLEDGE_BASE = [
{
"id": 1,
"title": "Your Document Title",
"content": "Your document content here..."
},
# Add more documents...
]Then update the search_knowledge_base() function (line 45) to implement real search logic.
Option 2: Connect to Your API
Modify the search_knowledge_base() function to call your existing RAG API:
import httpx
def search_knowledge_base(query: str) -> list:
# Call your API
response = httpx.get(f"https://your-api.com/search?q={query}")
return response.json()Option 3: Connect to a Vector Database
Install a vector database client and query it:
# Example with Pinecone
import pinecone
def search_knowledge_base(query: str) -> list:
# Query your vector database
results = index.query(query, top_k=5)
return results🛠️ Project Structure
rag-mcp-server/
├── server.py # Main MCP server implementation
├── requirements.txt # Python dependencies
├── README.md # Full documentation (you are here!)
├── QUICKSTART.md # Simplified quick start guide
├── CONTRIBUTING.md # Contribution guidelines
├── LICENSE # MIT License
├── claude_desktop_config.example.json # Example config (copy and modify)
└── .gitignore # Git ignore patterns🔧 Troubleshooting
The 🔌 icon doesn't appear
Check the config file path - make sure you edited the correct file
Verify absolute paths - use full paths, not relative paths like
./server.pyCheck Python path - run
which python3(macOS/Linux) orwhere python(Windows)View logs - Claude Desktop logs errors to:
macOS:
~/Library/Logs/Claude/mcp*.logWindows:
%APPDATA%\Claude\Logs\mcp*.log
Server shows as connected but tool doesn't work
Restart Claude Desktop completely after any code changes
Test the server manually:
python server.pyIt should start without errors
Permission errors
Make the server executable:
chmod +x server.pyImport errors
Make sure dependencies are installed:
pip install -r requirements.txtIf using virtual environments, activate it first:
# Create virtual environment
python -m venv venv
# Activate it
# macOS/Linux:
source venv/bin/activate
# Windows:
venv\Scripts\activate
# Install dependencies
pip install -r requirements.txtThen update your Claude Desktop config to use the virtual environment's Python:
{
"mcpServers": {
"rag-server": {
"command": "/absolute/path/to/venv/bin/python",
"args": ["/absolute/path/to/server.py"]
}
}
}📚 Learn More
🤝 Contributing
Contributions are welcome! Feel free to:
Open issues for bugs or feature requests
Submit pull requests
Share your customizations
📄 License
MIT License - feel free to use this in your own projects!
💡 Example Use Cases
Personal knowledge base: Search your notes, documents, or research
Company documentation: Give Claude access to internal wikis or docs
Database queries: Connect to SQL/NoSQL databases
API integration: Bridge Claude with your existing APIs
Custom tools: Add any functionality you need!
🎓 How It Works
Server starts: The Python server runs and waits for messages via stdin/stdout
Claude connects: Claude Desktop reads the config and connects to your server
Tool registration: The server tells Claude about the
search_ragtoolUser asks: When you ask Claude to search, it calls the tool
Server responds: Your server processes the request and returns results
Claude uses results: Claude incorporates the results into its response
Built with ❤️ using the Model Context Protocol
Questions? Open an issue or check the MCP documentation!
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/torkian/rag-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server