
Ragie Model Context Protocol Server

2025.03.21
9
JavaScript知识库检索AI增强开发效率
Ragie Model Context Protocol Server 是一个实现模型上下文协议(MCP)的服务器,提供对Ragie知识库检索能力的访问。它通过单一的'retrieve'工具,使AI模型能够从Ragie知识库中检索相关信息。
View on GitHub
Overview
基本能力
产品定位
Ragie MCP Server 是一个知识库检索服务,专为AI模型设计,用于从Ragie知识库中检索相关信息。
核心功能
- 检索工具:提供
retrieve
工具,支持通过查询字符串从知识库中检索信息。 - 参数:
query
:搜索查询字符串topK
:返回结果的最大数量(默认8)rerank
:是否仅返回最相关信息(默认true)recencyBias
:是否偏向于更近期的信息(默认false)
- 返回:匹配的知识库文本内容数组
适用场景
- AI模型需要从知识库中检索信息以增强回答准确性
- 开发者在构建AI应用时需要集成知识检索功能
工具列表
- retrieve:用于从Ragie知识库中检索信息,支持多种参数调整检索行为。
常见问题解答
- 无特定常见问题解答提供。
使用教程
使用依赖
- Node.js >= 18
- Ragie API key
安装教程
- 设置环境变量
RAGIE_API_KEY
为您的Ragie API认证密钥。 - 使用npx安装并运行服务器:
RAGIE_API_KEY=your_api_key npx @ragieai/mcp-server
命令行选项
--description, -d <text>
:覆盖默认工具描述--partition, -p <id>
:指定要查询的Ragie分区ID
示例:
# 使用自定义描述
RAGIE_API_KEY=your_api_key npx @ragieai/mcp-server --description "Search the company knowledge base for information"
# 指定分区
RAGIE_API_KEY=your_api_key npx @ragieai/mcp-server --partition your_partition_id
# 同时使用两个选项
RAGIE_API_KEY=your_api_key npx @ragieai/mcp-server --description "Search the company knowledge base" --partition your_partition_id
调试方式
- 开发模式运行:
RAGIE_API_KEY=your_api_key npm run dev -- --partition optional_partition_id
- 构建项目:
npm run build
配置指南
Cursor配置
- 创建
mcp.json
配置文件 - 项目特定:
.cursor/mcp.json
- 全局:
~/.cursor/mcp.json
示例配置:
{
"mcpServers": {
"ragie": {
"command": "npx",
"args": [
"-y",
"@ragieai/mcp-server",
"--partition",
"optional_partition_id"
],
"env": {
"RAGIE_API_KEY": "your_api_key"
}
}
}
}
Claude Desktop配置
- 创建
claude_desktop_config.json
- MacOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%/Claude/claude_desktop_config.json
示例配置:
{
"mcpServers": {
"ragie": {
"command": "npx",
"args": [
"-y",
"@ragieai/mcp-server",
"--partition",
"optional_partition_id"
],
"env": {
"RAGIE_API_KEY": "your_api_key"
}
}
}
}
- 重启Claude desktop使更改生效。