MCP server for RAG, an open-source platform for Retrieval-Augmented Generation. Designed for developers who want to build intelligent, document-based applications quickly and efficiently.
npm install rag-mcp-selfhostedMCP server for RAG, an open-source platform for Retrieval-Augmented Generation. Designed for developers who want to build intelligent, document-based applications quickly and efficiently.
[![npm version][npm-badge]][npm]
[![License][license-badge]][license]
[![Build Status][build-badge]][build]
[![Downloads][downloads-badge]][npm]
[![Size][size-badge]][npm]
using npm:
``sh`
RAG_API_KEY=your-api-key npx @rag/mcp --ns your-namespace-id
using yarn:
`sh`
RAG_API_KEY=your-api-key yarn dlx @rag/mcp --ns your-namespace-id
using pnpm:
`sh`
RAG_API_KEY=your-api-key pnpm dlx @rag/mcp --ns your-namespace-id
`json`
{
"mcpServers": {
"rag": {
"command": "npx",
"args": ["-y", "@rag/mcp@latest"],
"env": {
"RAG_API_KEY": "rag_xxx",
"RAG_NAMESPACE_ID": "ns_xxx"
}
}
}
}
Passing namespace id as an environment variable
`sh`
RAG_API_KEY=your-api-key RAG_NAMESPACE_ID=your-namespace-id npx @rag/mcp
Passing a custom tool description
`sh`
RAG_API_KEY=your-api-key npx @rag/mcp --ns your-namespace-id -d "Your custom tool description"
Passing a tenant id:
`sh`
RAG_API_KEY=your-api-key npx @rag/mcp --ns your-namespace-id -t your-tenant-id
If you're running a self-hosted RAG deployment, you can use this package which includes support for custom base URLs and insecure TLS (for self-signed certificates).
Installation:
`sh`
npx rag-mcp-selfhosted@latest
Usage with CLI flags:
`sh`
RAG_API_KEY=rag_xxx npx rag-mcp-selfhosted \
--ns ns_xxx \
--base-url https://rag.your-company.com \
--insecure # only if using self-signed certs
Usage with environment variables:
`sh`
RAG_API_KEY=rag_xxx \
RAG_NAMESPACE_ID=ns_xxx \
RAG_BASE_URL=https://rag.your-company.com \
RAG_INSECURE_TLS=true \
npx rag-mcp-selfhosted
In Claude Desktop configuration:
`json`
{
"mcpServers": {
"rag": {
"command": "npx",
"args": ["-y", "rag-mcp-selfhosted@latest"],
"env": {
"RAG_API_KEY": "rag_xxx",
"RAG_NAMESPACE_ID": "ns_xxx",
"RAG_BASE_URL": "https://rag.your-company.com",
"RAG_INSECURE_TLS": "true"
}
}
}
}
⚠️ Security Note: --insecure/RAG_INSECURE_TLS` disables TLS certificate verification and should only be used with trusted endpoints (e.g., local dev with self-signed certs).
Package Info:
- npm: https://www.npmjs.com/package/rag-mcp-selfhosted
- Adds support for custom RAG base URLs
- Handles self-signed certificates for local/private deployments
Visit the full documentation for more details.
[docs]: https://docs.rag.ai/
[build-badge]: https://github.com/rag-ai/mcp-server/actions/workflows/release.yml/badge.svg
[build]: https://github.com/rag-ai/mcp-server/actions/workflows/release.yml
[license-badge]: https://badgen.net/github/license/rag-ai/mcp-server
[license]: https://github.com/rag-ai/mcp-server/blob/main/LICENSE
[npm]: https://www.npmjs.com/package/@rag/mcp
[npm-badge]: https://badgen.net/npm/v/@rag/mcp
[downloads-badge]: https://img.shields.io/npm/dm/@rag/mcp.svg
[size-badge]: https://badgen.net/packagephobia/publish/@rag/mcp