MCP RAG
Provides HTML documentation hosted on GitHub Pages with complete setup guides, configuration instructions, and API reference for the MCP RAG server
Uses Hugging Face's sentence transformers API to generate embeddings for semantic search in the RAG system, specifically leveraging the sentence-transformers/all-MiniLM-L6-v2 model for document and memory vectorization
Click on "Deploy 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., "@MCP RAG search for information about vector databases in my uploaded documents"
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.
MCP RAG
Um servidor MCP (Model Context Protocol) completo para RAG (Retrieval-Augmented Generation) com gerenciamento de arquivos e memória vetorial para agentes.
🚀 Características
📄 Gerenciamento de Arquivos: Adicione, remova e pesquise documentos em diversos formatos (PDF, DOCX, TXT, MD, CSV, JSON)
🧠 Memória Vetorial: Sistema separado para que agentes armazenem informações importantes para uso futuro
🔍 Busca Semântica: Utiliza embeddings do Hugging Face para busca semântica avançada
💾 Banco Vetorial Local: ChromaDB local para armazenamento eficiente de vetores e metadados
🛠️ Script de Manutenção: CLI completo para gerenciamento e manutenção do sistema
📚 Documentação Completa: HTML para GitHub Pages com guias de configuração
Related MCP server: ragi
📋 Pré-requisitos
Node.js 18+
npm ou yarn
Chave da API do Hugging Face
🛠️ Instalação
Clone o repositório
git clone https://github.com/seu-usuario/mcp-rag.git cd mcp-ragInstale as dependências
npm installConfigure as variáveis de ambiente
cp .env.example .envEdite o arquivo
.enve configure sua chave da API do Hugging Face:HUGGINGFACE_API_KEY=sua_chave_aquiCompile o projeto
npm run build
🔧 Configuração
Cursor
Adicione a seguinte configuração no arquivo de configurações do MCP:
{
"mcpServers": {
"mcp-rag": {
"command": "node",
"args": ["dist/index.js"],
"cwd": "/caminho/para/mcp-rag"
}
}
}Claude Desktop
Adicione a configuração no arquivo claude_desktop_config.json:
{
"mcpServers": {
"mcp-rag": {
"command": "node",
"args": ["dist/index.js"],
"cwd": "/caminho/para/mcp-rag"
}
}
}VS Code
Configure no settings.json:
{
"mcp.servers": {
"mcp-rag": {
"command": "node",
"args": ["dist/index.js"],
"cwd": "/caminho/para/mcp-rag"
}
}
}🛠️ Script de Manutenção
O projeto inclui um CLI completo para manutenção:
# Adicionar arquivo
npm run maintenance add-file /caminho/para/arquivo.pdf
# Adicionar diretório
npm run maintenance add-dir /caminho/para/diretorio
# Buscar arquivos
npm run maintenance search-files "sua consulta"
# Listar arquivos
npm run maintenance list-files
# Gerenciar memória
npm run maintenance add-memory "conteúdo" "agent-id" "session-id"
npm run maintenance search-memory "sua consulta"
# Ver estatísticas
npm run maintenance stats
# Limpar dados
npm run maintenance clear all🔍 Ferramentas MCP Disponíveis
Gerenciamento de Arquivos
add_file: Adiciona um arquivo ao sistema RAGsearch_files: Busca documentos relevantesremove_file: Remove um arquivo do sistemalist_files: Lista todos os arquivos no sistema
Gerenciamento de Memória
add_memory: Adiciona informação à memória do agentesearch_memory: Busca na memória do agenteremove_memory: Remove uma entrada da memóriaget_memory_by_agent: Obtém toda a memória de um agente
Utilitários
get_stats: Obtém estatísticas do sistemaclear_data: Limpa dados do sistematest_connection: Testa a conexão com o serviço de embeddings
📊 Formatos Suportados
PDF: Documentos PDF com texto extraível
DOCX: Documentos do Microsoft Word
TXT: Arquivos de texto simples
MD: Arquivos Markdown
CSV: Arquivos de dados separados por vírgula
JSON: Arquivos de dados JSON
⚙️ Configurações
Variáveis de Ambiente
# MCP Configuration
MCP_SERVER_NAME=mcp-rag
MCP_SERVER_VERSION=1.0.0
# Hugging Face Configuration
HUGGINGFACE_API_KEY=your_huggingface_api_key_here
HUGGINGFACE_MODEL=sentence-transformers/all-MiniLM-L6-v2
# ChromaDB Configuration
CHROMA_PERSIST_DIRECTORY=./data/chroma
CHROMA_COLLECTION_FILES=rag_files
CHROMA_COLLECTION_MEMORY=agent_memory
# File Processing Configuration
MAX_FILE_SIZE_MB=50
SUPPORTED_EXTENSIONS=.pdf,.docx,.txt,.md,.csv,.json
# Vector Configuration
CHUNK_SIZE=1000
CHUNK_OVERLAP=200
EMBEDDING_DIMENSION=384
# Logging
LOG_LEVEL=info🚀 Uso
Iniciando o Servidor
npm startDesenvolvimento
npm run devTestes
npm test📚 Documentação
A documentação completa está disponível em HTML para GitHub Pages em docs/index.html. Ela inclui:
Guias de instalação e configuração
Instruções para Cursor, Claude Desktop e VS Code
Exemplos de uso
Solução de problemas
Referência completa das ferramentas
🤝 Contribuição
Fork o projeto
Crie uma branch para sua feature (
git checkout -b feature/AmazingFeature)Commit suas mudanças (
git commit -m 'Add some AmazingFeature')Push para a branch (
git push origin feature/AmazingFeature)Abra um Pull Request
📄 Licença
Este projeto está licenciado sob a Licença MIT - veja o arquivo LICENSE para detalhes.
🙏 Agradecimentos
Model Context Protocol - Protocolo base
Hugging Face - Serviço de embeddings
ChromaDB - Banco de dados vetorial
Anthropic - Claude e MCP
📞 Suporte
Se você encontrar problemas ou tiver dúvidas:
Verifique a documentação HTML
Abra uma issue
Consulte a seção de solução de problemas na documentação
Desenvolvido com ❤️ para a comunidade de IA
Available Tools
11 toolsadd_fileC
Add a file to the RAG system for document retrieval
Inputs: filePath (required).
add_memoryC
Add information to the agent memory system
Inputs: agentId (required), content (required), sessionId (required), category, +2 more.
clear_dataC
Clear data from the RAG system
Inputs: type (required).
get_memory_by_agentC
Get all memory entries for a specific agent
Inputs: agentId (required).
get_statsC
Get statistics about the RAG system
Inputs: no named parameters.
list_filesB
List all files in the RAG system
Inputs: no named parameters.
remove_fileC
Remove a file from the RAG system
Inputs: filePath (required).
remove_memoryC
Remove a memory entry from the agent memory system
Inputs: memoryId (required).
search_filesC
Search for relevant documents in the RAG system
Inputs: query (required), limit, threshold.
search_memoryC
Search for relevant information in agent memory
Inputs: query (required), agentId, limit, threshold.
test_connectionB
Test the connection to the embedding service
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Most tools have distinct purposes, but there is some overlap between 'add_file' and 'add_memory' as both involve adding data, though to different systems (RAG vs. memory). Similarly, 'search_files' and 'search_memory' are distinct but conceptually similar operations. The descriptions help clarify the boundaries, but an agent might occasionally confuse these pairs.
All tool names follow a consistent verb_noun pattern with snake_case, such as 'add_file', 'clear_data', 'get_stats', and 'search_memory'. This uniformity makes the set predictable and easy to understand, with no deviations in style or convention.
With 11 tools, the count is well-scoped for a RAG and memory management system. It covers core operations like adding, removing, listing, and searching for both files and memory, along with utility functions like clearing data and testing connections, without being excessive or sparse.
The tool set provides comprehensive coverage for RAG and memory operations, including CRUD-like actions for files and memory entries, search capabilities, and system management. A minor gap is the lack of tools for updating existing files or memory entries, which might require workarounds, but core workflows are well-supported.
Maintenance
Related MCP Connectors
MCP server for agentverse documentation, generated by doc2mcp.
One MCP server for the services your AI needs: memory, files, Microsoft 365, kanban and more.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server implementation that provides tools for retrieving and processing documentation through vector search, enabling AI assistants to augment their responses with relevant documentation context. Uses Ollama or OpenAI to generate embeddings. Docker files included34 npm30MIT
- AlicenseAqualityDmaintenanceLocal-first RAG indexing and semantic search MCP server. Enables document retrieval and context-aware queries using local embedding models.315 npmMIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that indexes documents and serves relevant context to LLMs via Retrieval Augmented Generation (RAG).36MIT
- FlicenseNot gradedqualityDmaintenanceMCP server that enables semantic search over PDF documents using RAG with ChromaDB and OpenAI embeddings.-