Deepseek R1 语言模型的 Model Context Protocol (MCP) 服务器实现。Deepseek R1 是一个强大的语言模型,针对推理任务进行了优化,并具有 8192 个标记的上下文窗口。
为什么选择 Node.js? 此实现使用 Node.js/TypeScript,因为它提供了与 MCP 服务器最稳定的集成。Node.js SDK 提供了更好的类型安全、错误处理以及与 Claude Desktop 的兼容性。
<a href="https://glama.ai/mcp/servers/qui5thpyvu"><img width="380" height="200" src="https://gips1.baidu.com/it/u=2057008375,2397528074&fm=3081&app=3081&f=PNG?w=760&h=400" alt="Deepseek R1 服务器 MCP 服务器" /></a>
# 克隆并安装
git clone https://github.com/66julienmartin/MCP-server-Deepseek_R1.git
cd deepseek-r1-mcp
npm install
# 设置环境
cp .env.example .env # 然后添加你的 API 密钥
# 构建并运行
npm run build
默认情况下,此服务器使用 deepseek-R1 模型。如果您想使用 DeepSeek-V3,请在 src/index.ts 中修改模型名称:
// 对于 DeepSeek-R1(默认)
model: "deepseek-reasoner"
// 对于 DeepSeek-V3
model: "deepseek-chat"
deepseek-r1-mcp/
├── src/
│ ├── index.ts # 主服务器实现
├── build/ # 编译文件
│ ├── index.js
├── LICENSE
├── README.md
├── package.json
├── package-lock.json
└── tsconfig.json
.env 文件:DEEPSEEK_API_KEY=your-api-key-here
{
"mcpServers": {
"deepseek_r1": {
"command": "node",
"args": ["/path/to/deepseek-r1-mcp/build/index.js"],
"env": {
"DEEPSEEK_API_KEY": "your-api-key"
}
}
}
}
npm run dev # 监控模式
npm run build # 生产构建
{
"name": "deepseek_r1",
"arguments": {
"prompt": "您的提示在这里",
"max_tokens": 8192, // 最大生成标记数
"temperature": 0.2 // 控制随机性
}
}
temperature 的默认值是 0.2。
Deepseek 建议根据具体用途设置 temperature:
| 使用场景 | 温度 | 示例 |
|---|---|---|
| 编码 / 数学 | 0.0 | 代码生成,数学计算 |
| 数据清洗 / 数据分析 | 1.0 | 数据处理任务 |
| 通用对话 | 1.3 | 聊天和对话 |
| 翻译 | 1.3 | 语言翻译 |
| 创意写作 / 诗歌 | 1.5 | 故事创作,诗歌生成 |
服务器提供常见问题的详细错误消息:
欢迎贡献!请随时提交 Pull Request。
MIT