mcp-ragchat
An MCP server that enables RAG-powered AI chat integration for websites by crawling content, building local vector stores, and generating embeddable chat widgets. It simplifies the setup of local chat servers with support for various LLM and embedding providers.
README
<p align="center"> <h1 align="center">mcp-ragchat</h1> <p align="center"> An MCP server that adds RAG-powered AI chat to any website. One command from Claude Code. </p> </p>
<p align="center"> <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a> <a href="https://nodejs.org/"><img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen.svg" alt="Node.js 20+"></a> <a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-5.0-blue.svg" alt="TypeScript"></a> <a href="https://modelcontextprotocol.io/"><img src="https://img.shields.io/badge/MCP-compatible-8A2BE2.svg" alt="MCP"></a> <a href="https://www.npmjs.com/package/mcp-ragchat"><img src="https://img.shields.io/npm/v/mcp-ragchat.svg" alt="npm"></a> </p>
Tell Claude Code "add AI chat to mysite.com" and it will crawl your content, build a local vector store, spin up a chat server, and hand you an embed snippet. No cloud infra. No database. Just one API key.
Demo
You: "Set up AI chat for mybakery.com using this FAQ and menu content"
Claude: I'll set up RAG-powered chat for mybakery.com.
[1/4] ragchat_setup
Splitting content into sections...
Generating embeddings for 12 documents...
Domain "mybakery.com" configured with 12 documents.
[2/4] ragchat_test
Query: "What are your hours?"
Reply: "We're open Monday-Saturday 7am-6pm, and Sunday 8am-2pm."
RAG Sources: mybakery.com-3 (0.91), mybakery.com-7 (0.84)
Latency: 340ms
[3/4] ragchat_serve
Chat server running at http://localhost:3456
POST /chat ready.
[4/4] ragchat_widget
Generated embed code. Paste this into your HTML:
<script src="http://localhost:3456/widget.js"></script>
You: Done. Live chat on my site in under 60 seconds.
Quick Start
1. Clone and build
git clone https://github.com/gogabrielordonez/mcp-ragchat
cd mcp-ragchat
npm install && npm run build
2. Configure Claude Code (~/.claude/mcp.json)
{
"mcpServers": {
"ragchat": {
"command": "node",
"args": ["/absolute/path/to/mcp-ragchat/dist/mcp-server.js"],
"env": {
"OPENAI_API_KEY": "sk-..."
}
}
}
}
3. Use it
Open Claude Code and say:
"Add AI chat to mysite.com. Here's the content: [paste your markdown]"
Claude handles the rest.
Tools
| Tool | What it does |
|---|---|
ragchat_setup |
Seed a knowledge base from markdown content. Each ## section becomes a searchable document with vector embeddings. |
ragchat_test |
Send a test message to verify RAG retrieval and LLM response quality. |
ragchat_serve |
Start a local HTTP chat server with CORS and input sanitization. |
ragchat_widget |
Generate a self-contained <script> tag -- a floating chat bubble, no dependencies. |
ragchat_status |
List all configured domains with document counts and config details. |
How It Works
+------------------+
| Your Markdown |
+--------+---------+
|
ragchat_setup
|
+------------v-------------+
| Local Vector Store |
| ~/.mcp-ragchat/domains/ |
| vectors.json |
| config.json |
+------------+-------------+
|
User Question |
| |
+------v------+ +------v------+
| Embedding | | Cosine |
| Provider +->+ Similarity |
+-------------+ +------+------+
|
Top 3 chunks
|
+----------v-----------+
| System Prompt |
| + RAG Context |
| + User Message |
+----------+-----------+
|
+----------v-----------+
| LLM Provider |
+----------+-----------+
|
Reply
Everything runs locally. No cloud infrastructure. Bring your own API key.
Supported Providers
LLM (chat completions)
| Provider | Env Var | Default Model |
|---|---|---|
| OpenAI | OPENAI_API_KEY |
gpt-4o-mini |
| Anthropic | ANTHROPIC_API_KEY |
claude-sonnet-4-5-20250929 |
| Google Gemini | GEMINI_API_KEY |
gemini-2.0-flash |
Embeddings (vector search)
| Provider | Env Var | Default Model |
|---|---|---|
| OpenAI | OPENAI_API_KEY |
text-embedding-3-small |
| Google Gemini | GEMINI_API_KEY |
text-embedding-004 |
| AWS Bedrock | AWS_REGION + IAM |
amazon.titan-embed-text-v2:0 |
Override defaults with LLM_MODEL and EMBEDDING_MODEL environment variables.
Architecture
~/.mcp-ragchat/domains/
mysite.com/
config.json -- system prompt, settings
vectors.json -- documents + embedding vectors
- Vector store -- Local JSON files with cosine similarity search. Zero external dependencies.
- Chat server -- Node.js HTTP server with CORS and input sanitization.
- Widget -- Self-contained
<script>tag. No frameworks, no build step.
Contributing
Issues and pull requests are welcome.
- Found a bug? Open an issue
- Want to add a feature? Fork, branch, PR.
- Questions? Start a discussion
Star History
Enterprise
Need multi-tenancy, security guardrails, audit trails, and managed infrastructure? Check out Supersonic -- the enterprise AI platform built on the same RAG pipeline.
MIT License -- Gabriel Ordonez
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。