Ragie 检索服务器

@ragieai/ragie-mcp-server
Hosted
0 Stars 1.1k 次浏览 ragieai 更新于 2026-08-23

一个MCP服务器,它使AI模型能够通过简单的“检索”工具从Ragie的知识库中获取信息。

MCP 服务配置

复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用

{
  "mcpServers": {
    "ragie": {
      "args": [
        "-y",
        "@ragieai/mcp-server",
        "--partition",
        "optional_partition_id"
      ],
      "command": "npx",
      "env": {
        "RAGIE_API_KEY": "your_api_key"
      }
    }
  }
}

该服务需要配置环境变量:RAGIE_API_KEY、RAGIE_PARTITION

可用工具 (1 个)

该服务在 MCP 协议中暴露的工具,AI 可按需调用

retrieve 1 个参数 需填 1 项

Look up information in the Knowledge Base. Use this tool when you need to: - Find relevant documents or information on specific topics - Retrieve company policies, procedures, or guidelines - Access product specifications or technical documentation - Get contextual information to answer company-specific questions - Find historical data or information about projects

必填参数:query

服务介绍

image

Ragie 模型上下文协议服务器

一个模型上下文协议(MCP)服务器,提供访问Ragie知识库检索功能的接口。

说明

该服务器实现了模型上下文协议,使AI模型能够从Ragie知识库中检索信息。它提供了一个名为“retrieve”的工具,允许查询知识库以获取相关信息。

先决条件

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

安装

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

  • RAGIE_API_KEY (必需): 您的Ragie API认证密钥

服务器将启动并在标准输入输出上监听MCP协议消息。

使用npx安装并运行服务器:

RAGIE_API_KEY=your_api_key npx @ragieai/mcp-server

命令行选项

该服务器支持以下命令行选项:

  • --description, -d <text>: 使用自定义文本覆盖默认工具描述
  • --partition, -p <id>: 指定要查询的Ragie分区ID

示例:

# With custom description
RAGIE_API_KEY=your_api_key npx @ragieai/mcp-server --description "Search the company knowledge base for information"

# With partition specified
RAGIE_API_KEY=your_api_key npx @ragieai/mcp-server --partition your_partition_id

# Using both options
RAGIE_API_KEY=your_api_key npx @ragieai/mcp-server --description "Search the company knowledge base" --partition your_partition_id

Cursor 配置

为了与Cursor一起使用此MCP服务器:

选项1:创建MCP配置文件

  1. 保存名为mcp.json的文件
  • 对于特定于项目的工具,在您的项目目录中创建一个.cursor/mcp.json文件。这允许您定义仅在该项目内可用的MCP服务器。
  • 对于希望跨所有项目使用的工具,在您的主目录中创建一个~/.cursor/mcp.json文件。这样可以让MCP服务器在所有的Cursor工作空间中都可用。

示例mcp.json

{
  "mcpServers": {
    "ragie": {
      "command": "npx",
      "args": [
        "-y",
        "@ragieai/mcp-server",
        "--partition",
        "optional_partition_id"
      ],
      "env": {
        "RAGIE_API_KEY": "your_api_key"
      }
    }
  }
}

选项2:使用shell脚本

  1. 在系统上保存名为ragie-mcp.sh的文件:
#!/usr/bin/env bash

export RAGIE_API_KEY="your_api_key"

npx -y @ragieai/mcp-server --partition optional_partition_id
  1. 给文件执行权限:chmod +x ragie-mcp.sh

  2. 通过进入Cursor UI中的设置 -> Cursor设置 -> MCP服务器来添加MCP服务器脚本。

your_api_key替换为您的实际Ragie API密钥,并根据需要设置分区ID(如果需要的话)。

Claude 桌面配置

为了与Claude桌面版一起使用此MCP服务器:

  1. 创建MCP配置文件claude_desktop_config.json
  • 对于MacOS: 使用~/Library/Application Support/Claude/claude_desktop_config.json
  • 对于Windows: 使用%APPDATA%/Claude/claude_desktop_config.json

示例claude_desktop_config.json

{
  "mcpServers": {
    "ragie": {
      "command": "npx",
      "args": [
        "-y",
        "@ragieai/mcp-server",
        "--partition",
        "optional_partition_id"
      ],
      "env": {
        "RAGIE_API_KEY": "your_api_key"
      }
    }
  }
}

your_api_key替换为您的实际Ragie API密钥,并根据需要设置分区ID(如果需要的话)。

  1. 重启Claude桌面版以使更改生效。

现在,您可以在Claude桌面对话中使用Ragie检索工具了。

功能

检索工具

服务器提供了一个retrieve工具,可用于搜索知识库。它接受以下参数:

  • query (字符串): 要查找相关信息的搜索查询

该工具返回:

  • 包含来自知识库匹配文本的内容块数组

开发

该项目用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.txt。

相关 MCP 服务