Back to MCP directory
publicPublicdnsLocal runtime

ragie-mcp-server

Ragie模型上下文协议服务器,提供知识库检索能力

article

README

🚀 Ragie 模型上下文协议服务器

Ragie 模型上下文协议服务器实现了模型上下文协议 (MCP),为 AI 模型提供访问 Ragie 知识库检索功能的能力,助力模型从知识库中获取所需信息。

🚀 快速开始

Ragie 模型上下文协议服务器实现了 Model Context Protocol,让 AI 模型能够从 Ragie 知识库中检索信息。它仅提供一个名为 "retrieve" 的工具,用于查询知识库以获取相关信息。

✨ 主要特性

此工具返回一个包含匹配文本片段的数组,这些片段来自知识库。

📦 安装指南

先决条件

  • Node.js >= 18
  • Ragie API 密钥

环境变量与安装命令

服务器需要以下环境变量:

  • 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 "搜索公司知识库中的信息"

# 指定分区
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 "搜索公司知识库中的信息" --partition your_partition_id

💻 使用示例

光标配置

方法一:创建 mcp.json 文件

在项目根目录下创建一个 mcp.json 文件,并添加以下内容:

{
  "servers": [
    {
      "name": "ragie-mcp-server",
      "url": "http://localhost:3000"
    }
  ]
}

方法二:编写 Shell 脚本

创建一个 shell 脚本(例如 start_mcp_server.sh),并添加以下内容:

#!/bin/bash
RAGIE_API_KEY=your_api_key npx @ragieai/mcp-server --partition your_partition_id

然后赋予脚本执行权限:

chmod +x start_mcp_server.sh

运行脚本以启动服务器。

Claude 桌面配置

要在 Claude 桌面中添加此服务器,请找到以下路径并编辑对应的配置文件:

  • WindowsC:\Users\<YourUsername>\.claudius\config\mcp.json
  • macOS/Linux~/.claudius/config/mcp.json

在文件中添加以下内容:

{
  "servers": [
    {
      "name": "ragie-mcp-server",
      "url": "http://localhost:3000"
    }
  ]
}

替换 <YourUsername>your_api_key 为您的实际信息,并可选地添加 --partition your_partition_id 参数。

🔧 技术细节

项目使用 TypeScript 编写,并依赖以下主要包:

  • @modelcontextprotocol/sdk:用于实现 MCP 服务器
  • ragie:用于与 Ragie API 交互
  • zod:用于运行时类型验证

开发设置

在开发模式下运行服务器:

RAGIE_API_KEY=your_api_key npm run dev -- --partition optional_partition_id

构建项目:

npm run build

📄 许可证

本项目采用 MIT License,详情请参阅 LICENSE.txt 文件。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client