M

MCP服务器

@ucalyptus/prem-mcp-server
0 Stars 223 次浏览 ucalyptus 更新于 2026-08-23

一种模型上下文协议(MCP)服务器实现,能够与Claude以及其他兼容MCP的客户端无缝集成,从而访问Prem AI的语言模型、RAG功能和文档管理特性。

MCP 服务配置

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

{
  "mcpServers": {
    "PremAI": {
      "args": [
        "prem-mcp-server",
        "--stdio"
      ],
      "command": "npx",
      "env": {
        "PREM_API_KEY": "your_api_key_here",
        "PREM_PROJECT_ID": "your_project_id_here"
      }
    }
  }
}

该服务需要配置环境变量:PREM_API_KEY、PREM_PROJECT_ID

服务介绍

Prem MCP 服务器

smithery 徽章

这是为 Prem AI 实现的一个模型上下文协议(MCP)服务器,能够与 Claude 和其他兼容 MCP 的客户端无缝集成。此服务器通过 MCP 接口提供对 Prem AI 强大功能的访问。

特性

  • 🤖 聊天补全:与 Prem AI 的语言模型进行交互
  • 📚 RAG 支持:与文档库集成的检索增强生成
  • 📝 文档管理:在仓库中上传和管理文档
  • 🎭 模板系统:使用预定义的提示模板以获得专门的输出
  • 流式响应:实时流式传输模型输出
  • 🛡️ 错误处理:强大的错误处理和日志记录

前提条件

  • Node.js (v16 或更高版本)
  • 一个带有 API 密钥的 Prem AI 账户
  • 一个 Prem 项目 ID

安装

通过 Smithery 安装

要通过 Smithery 自动为 Claude Desktop 安装 prem-mcp-server:

npx -y @smithery/cli install @ucalyptus/prem-mcp-server --client claude

手动安装

# Using npm
npm install prem-mcp-server

# Using yarn
yarn add prem-mcp-server

# Using pnpm
pnpm add prem-mcp-server

配置

1. 环境变量

在你的项目根目录创建一个 .env 文件:

PREM_API_KEY=your_api_key_here
PREM_PROJECT_ID=your_project_id_here

2. Cursor 配置

若要使用 Prem MCP 服务器与 Cursor,请将以下内容添加到你的 ~/.cursor/mcp.json 中:

{
  "mcpServers": {
    "PremAI": {
      "command": "node",
      "args": ["/path/to/your/prem-mcp/build/index.js", "--stdio"],
      "env": {
        "PREM_API_KEY": "your_api_key_here",
        "PREM_PROJECT_ID": "your_project_id_here"
      }
    }
  }
}

/path/to/your/prem-mcp 替换为实际的项目目录路径。

3. Claude 桌面版配置

对于 Claude 桌面版用户,请将以下内容添加到你的 claude_desktop_config.json 中:

{
  "mcpServers": {
    "PremAI": {
      "command": "npx",
      "args": ["prem-mcp-server", "--stdio"],
      "env": {
        "PREM_API_KEY": "your_api_key_here",
        "PREM_PROJECT_ID": "your_project_id_here"
      }
    }
  }
}

使用方法

启动服务器

npx prem-mcp-server

示例提示

  1. 基本聊天
Let's have a conversation about artificial intelligence.
  1. 带文档的 RAG
Based on the documents in repository XYZ, what are the key points about [topic]?
  1. 使用模板
Use template ABC to generate [specific type of content].

文档上传

服务器支持将文档上传到 Prem AI 仓库以执行 RAG 操作。支持的格式包括:

  • .txt
  • .pdf
  • .docx

API 参考

聊天补全参数

  • query:输入文本
  • system_prompt:自定义系统提示
  • model:模型标识符
  • temperature:响应随机性 (0-1)
  • max_tokens:最大响应长度
  • repository_ids:用于 RAG 的仓库 ID 数组
  • similarity_threshold:文档相似度阈值
  • limit:最大文档片段数

模板参数

  • template_id:提示模板 ID
  • params:模板特定参数
  • temperature:响应随机性 (0-1)
  • max_tokens:最大响应长度

开发

# Clone the repository
git clone https://github.com/yourusername/prem-mcp-server.git

# Install dependencies
npm install

# Build the project
npm run build

# Run tests
npm test

故障排除

常见问题

  1. 找不到服务器

    • 核实 claude_desktop_config.json 中的服务器路径
    • 检查服务器是否正在运行
  2. API 密钥无效

    • 确保您的 Prem AI API 密钥有效
    • 检查 API 密钥是否有必要的权限
  3. 文档上传失败

    • 核实文件格式是否受支持
    • 检查文件权限
    • 确保存储库 ID 正确

贡献

欢迎贡献!请随时提交 Pull Request。

许可证

MIT 许可证 - 详情请参阅 LICENSE 文件。

致谢

支持

对于问题和功能请求,请使用 GitHub Issues 页面。

相关 MCP 服务