](https://mseep.ai/app/66julienmartin-mcp-server-deepseek-r1)
Deepseek R1 MCP服务器
Deepseek R1语言模型的模型上下文协议(MCP)服务器实现。Deepseek R1是一个强大的语言模型,针对推理任务进行了优化,其上下文窗口为8192个令牌。
为什么选择Node.js? 此实现使用Node.js/TypeScript,因为它提供了与MCP服务器最稳定的集成。Node.js SDK提供了更好的类型安全性、错误处理和与Claude Desktop的兼容性。
快速开始
手动安装
# Clone and install
git clone https://github.com/66julienmartin/MCP-server-Deepseek_R1.git
cd deepseek-r1-mcp
npm install
# Set up environment
cp .env.example .env # Then add your API key
# Build and run
npm run build先决条件
- Node.js(v18或更高版本)
- npm
- 克劳德桌面
- 深度搜索API密钥
模型选择
默认情况下,此服务器使用 deepseek-R1 模型。如果你想使用 DeepSeek-V3 相反,请在中修改模型名称 src/index.ts:
// For DeepSeek-R1 (default)
model: "deepseek-reasoner"
// For DeepSeek-V3
model: "deepseek-chat"项目结构
deepseek-r1-mcp/
├── src/
│ ├── index.ts # Main server implementation
├── build/ # Compiled files
│ ├── index.js
├── LICENSE
├── README.md
├── package.json
├── package-lock.json
└── tsconfig.json配置
- 创建一个
.env文件:
DEEPSEEK_API_KEY=your-api-key-here- 更新Claude桌面配置:
{
"mcpServers": {
"deepseek_r1": {
"command": "node",
"args": ["/path/to/deepseek-r1-mcp/build/index.js"],
"env": {
"DEEPSEEK_API_KEY": "your-api-key"
}
}
}
}发展
npm run dev # Watch mode
npm run build # Build for production特性
- 使用Deepseek R1进行高级文本生成(8192令牌上下文窗口)
- 可配置参数(max_tokens、温度)
- 具有详细错误消息的稳健错误处理
- 完全支持MCP协议
- Claude桌面集成
- 支持DeepSeek-R1和DeepSeek-V3型号
API使用
{
"name": "deepseek_r1",
"arguments": {
"prompt": "Your prompt here",
"max_tokens": 8192, // Maximum tokens to generate
"temperature": 0.2 // Controls randomness
}
}温度参数
默认值为 temperature 为0.2。
Deepseek建议设置 temperature 根据您的具体用例:
| 用例 | 温度 | 示例 |
|---|---|---|
| 编码/数学 | 0.0 | 代码生成、数学计算 |
| 数据清理/数据分析 | 1.0 | 数据处理任务 |
| 一般对话 | 1.3 | 聊天和对话 |
| 翻译 | 1.3 | 语言翻译 |
| 创意写作/诗歌 | 1.5 | 故事写作、诗歌创作 |
错误处理
服务器为常见问题提供详细的错误消息:
- API身份验证错误
- 无效参数
- 速率限制
- 网络问题
贡献
欢迎投稿!请随时提交拉取请求。
许可证
麻省理工学院

