Chalee MCP RAG
About
A Retrieval-Augmented Generation (RAG) server for document processing, vector storage, and intelligent Q&A, powered by the Model Context Protocol.
Details
- Author
- prettyking
- Categories
- Developer Tools, Knowledge Base, Other, AI
Jump to
Setup
Install Chalee MCP RAG in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/prettyking/chalee-mcp-rag
Follow the installation instructions in the repository README, then restart your MCP client.
一个基于Model Context Protocol (MCP)的 RAG(检索增强生成)服务器,提供文档处理、向量存储和智能问答功能。
- 🔧标准化 MCP 协议:遵循 Anthropic MCP 标准,可与 Claude Desktop 等客户端集成
- 📚智能文档处理:自动分块、向量化存储
- 🔍语义检索:基于余弦相似度的相关文档检索
- 💬智能问答:结合检索上下文的准确回答生成
- 🛡️安全可靠:内置错误处理和参数验证
- 🚀生产就绪:完整的配置和部署支持
git clone https://github.com/PrettyKing/chalee-mcp-rag.git cd chalee-mcp-rag
cp .env.example .env # 编辑 .env 文件,设置你的 OpenAI API 密钥
chalee-mcp-rag/ ├── rag-agent.js # RAG Agent 核心实现 ├── mcp-rag-server.js # MCP 服务器 ├── mcp-client.js # MCP 客户端示例 ├── test.js # RAG Agent 测试 ├── package.json # 项目配置 ├── .env.example # 环境变量示例 └── README.md # 说明文档
要在 Claude Desktop 中使用此 MCP 服务器,请在 Claude 配置文件中添加:
编辑~/Library/Application Support/Claude/claude_desktop_config.json:
{ "mcpServers": { "chalee-rag-server": { "command": "node", "args": ["/path/to/your/chalee-mcp-rag/mcp-rag-server.js"], "env": { "OPENAI_API_KEY": "your_openai_api_key_here" } } } }
编辑%APPDATA%\\Claude\\claude_desktop_config.json:
{ "mcpServers": { "chalee-rag-server": { "command": "node", "args": ["C:\\path\\to\\your\\chalee-mcp-rag\\mcp-rag-server.js"], "env": { "OPENAI_API_KEY": "your_openai_api_key_here" } } } }
const MCPRAGClient = require('./mcp-client'); async function example() { const client = new MCPRAGClient(); // 连接服务器 await client.connect(); // 初始化 RAG await client.initializeRAG('your-openai-api-key'); // 添加文档 await client.addDocument('这是一个示例文档...', { category: '示例', source: 'demo' }); // 提问 const answer = await client.askQuestion('这个文档讲了什么?'); console.log(answer.answer); // 断开连接 await client.disconnect(); }
// 自定义 RAG 配置 await client.initializeRAG('your-api-key', { chunkSize: 800, // 文档分块大小 chunkOverlap: 100, // 分块重叠大小 maxRetrievedDocs: 5 // 最大检索文档数 });
# 运行 RAG Agent 测试 npm test # 运行 MCP 客户端演示 npm run mcp-client
FROM node:16-alpine WORKDIR /app COPY package*.json ./ RUN npm install COPY . . EXPOSE 3000 CMD ["npm", "run", "mcp-server"]
# 使用 PM2 管理进程 npm install -g pm2 pm2 start mcp-rag-server.js --name "mcp-rag-server" pm2 monitor
- 确保 Node.js 版本 >= 16
- 检查依赖是否正确安装
- 验证 API 密钥是否有效
- 确保先调用initialize_rag
- 检查参数格式是否正确
- 查看服务器日志获取详细错误信息
- 减少chunkSize或maxRetrievedDocs
- 优化文档大小和数量
- 考虑使用外部向量数据库
// PDF 支持 const pdfParse = require('pdf-parse'); async function loadPDF(filePath) { const dataBuffer = fs.readFileSync(filePath); const data = await pdfParse(dataBuffer); return await agent.addDocument(data.text, { type: 'pdf', source: filePath }); }
// 使用 Pinecone 向量数据库 const { PineconeStore } = require('langchain/vectorstores/pinecone'); class PersistentRAGAgent extends RAGAgent { async initializePinecone() { this.vectorStore = await PineconeStore.fromExistingIndex( new OpenAIEmbeddings(), { pineconeIndex: this.index } ); } }
interface InitializeRAGParams { apiKey: string; config?: { chunkSize?: number; chunkOverlap?: number; maxRetrievedDocs?: number; }; }
interface AddDocumentParams { content: string; metadata?: Record<string, any>; }
interface AskQuestionParams { question: string; } interface AskQuestionResponse { question: string; answer: string; sources?: Array<{ content: string; similarity: number; metadata: Record<string, any>; }>; timestamp: string; }
- Fork 项目
- 创建功能分支 (git checkout -b feature/AmazingFeature)
- 提交更改 (git commit -m 'Add some AmazingFeature')
- 推送到分支 (git push origin feature/AmazingFeature)
- 打开 Pull Request
- Anthropic- MCP 协议开发者
- OpenAI- GPT 和 Embedding API
- LangChain- 文本处理工具
- 📧 Email:your-email@example.com
- 🐛 Issues:GitHub Issues
- 💬 Discussions:GitHub Discussions
This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.
A RAG-based Q&A server using a vector store built from Gemini CLI documentation.
A local MCP server implementing Retrieval-Augmented Generation (RAG) with sentence window retrieval and support for multiple file types.
Integrates LLM applications with RAG data sources and tools using the Model Context Protocol.
A powerful Model Context Protocol (MCP) server using gemini embedding 3 that transforms any local directory into an ultrafast, visually-aware spatial search engine for AI agents.
Privacy-first local RAG server for semantic document search without external APIs
A knowledge base server that processes local documents (PDF, DOCX, TXT, HTML) and answers questions based on their content using similarity search.
A server for RAG-based document search and management using Qdrant vector database with Ollama or OpenAI embeddings.
Index your docs, files, and websites into a vector store and give your AI agent live semantic search with auto-syncs on changes, zero code required.
Access technical documentation for libraries and frameworks, formatted in clean markdown for LLM consumption.
Local code analysis MCP server with 25+ tools: semantic search, call graph tracing, dependency analysis, and symbol navigation. Built with Tree-sitter and CozoDB. Supports Go, Python, JS, TS.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





