Prem MCP服务器
](https://smithery.ai/server/@ucalyptus/prem-mcp-server)
一种模型上下文协议(MCP)服务器实现 通过 AI,实现与Claude和其他MCP兼容客户端的无缝集成。该服务器通过MCP接口提供对Prem AI强大功能的访问。
特性
- 🤖 聊天完成:与Prem AI的语言模型交互
- 📚 RAG支持:检索增强生成与文档存储库集成
- 📝 文档管理:上传和管理存储库中的文档
- 🎭 模板系统:使用预定义的提示模板进行专门的输出
- ⚡ 流媒体响应:模型输出的实时流式传输
- 🛡️ 错误处理:强大的错误处理和日志记录
先决条件
- Node.js(v16或更高版本)
- 具有API密钥的Prem AI帐户
- Prem项目ID
安装
通过Smithery安装
通过以下方式自动为Claude Desktop安装prem-mcp服务器 史密瑟里:
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_here2.光标配置
要将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 Desktop用户,请将以下内容添加到您的 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示例提示
- 基本聊天
Let's have a conversation about artificial intelligence.- RAG与文件
Based on the documents in repository XYZ, what are the key points about [topic]?- 使用模板
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:提示模板的IDparams:模板特定参数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故障排除
常见问题
- 找不到服务器
- 验证中的服务器路径 claude_desktop_config.json - 检查服务器是否正在运行
- API密钥无效
- 确保您的Prem AI API密钥有效 - 检查API密钥是否具有所需的权限
- 文档上传失败
- 验证是否支持文件格式 - 检查文件权限 - 确保存储库ID正确
贡献
欢迎投稿!请随时提交拉取请求。
许可证
MIT许可证-请参阅 许可证 文件以获取详细信息。
致谢
支持
有关问题和功能请求,请使用GitHub问题页面。

