rag-knowledge-mcp
Connects RAG knowledge bases to Claude Desktop and Claude Code, allowing retrieval-augmented generation from ingested documents.
README
RAG Knowledge Base MCP Server
This is an MCP server I use to connect a RAG knowledge base to Claude Desktop, Claude Code, and other things.
Setup
uv sync --extra dev # installs pytest tests
Ingesting Documents
The Chroma backend does embedding and retrieval (you can use any sort of embedding/retrieval by implementing AbstractRagBackend)
Default configuration assumes the docs will be in knowledge-base in the project root.
Anything with that name is git-ignored, so one can create a symlink named knowledge-base pointing elsewhere.
The directory can also be configured by copying example.env to .env and...
RAG_KNOWLEDGE_DIR=./knowledge-base # <--- changing this to something else
What my directory looks like (more or less):
knowledge-base
├── companies
│ └── frobozz-co.md
│ └── acme.md
├── developers
│ └── wesley-hinkle.md
└── projects
| ├── magic-api-gateway.md
| ├── zork-legacy-cms.md
| ├── torch-saas.md
| ├── grue-detector.md
| ├── zorkmid-sdk.md
| ├── hello-footpad.md
| ├── anvil.md
└── skills-mapping.md
Once the documents are in place:
uv run python ingest.py
or just
make embeddings
Client Configuration
Claude Desktop
Add to Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"rag-knowledge": {
"command": "/absolute/path/to/uv",
"args": [
"run",
"--directory",
"/absolute/path/to/this/project",
"python",
"rag_knowledge_mcp.py"
],
"env": {
"LOG_LEVEL": "INFO"
}
}
}
}
Note: Claude Desktop did not seem to have uv in its path so I used the
absolute path returned from which uv
Claude Code
https://code.claude.com/docs/en/mcp
Installs with --scope local by default (claude in CWD)
claude mcp add rag-knowledge -- uv run --directory /absolute/path/to/this/project python rag_knowledge_mcp.py
Add --scope user for claude in any directory:
claude mcp add --scope user rag-knowledge -- uv run --directory /absolute/path/to/this/project python rag_knowledge_mcp.py
Before I managed to work out the syntax above I created a wrapper script:
claude mcp add --transport stdio rag-knowledge ~/.bin/rag-knowledge-mcp
The contents of wrapper-example.sh can be copied and modified
#!/usr/bin/env bash
set -euo pipefail
PROJECT_DIR="$HOME/path/to/this/project"
UV="$(which uv)"
echo "$PROJECT_DIR"
echo "$UV"
export LOG_LEVEL="${LOG_LEVEL:-INFO}"
cd "$PROJECT_DIR"
exec "$UV" run python rag_knowledge_mcp.py
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.