Integrate Deepseek R1 for Code Generation
An MCP server for DeepSeek R1 - reasoning-optimized text generation with an 8192-token context window in Claude Desktop.
Maintainer of this project? Claim this page to edit the listing.
1.0.0Add to Favorites
Why it matters
Leverage the Deepseek R1 language model via an MCP server to enhance code generation, translation, summarization, and conversational AI tasks. This asset provides a robust implementation for integrating advanced LLM capabilities into your applications.
Outcomes
What it gets done
Implement Deepseek R1 for advanced code generation.
Utilize the 8192 token context window for complex reasoning.
Configure customizable parameters like temperature for diverse tasks.
Integrate seamlessly with Claude Desktop for enhanced user experience.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-deepseek-r1 | bash Capabilities
Tools your agent gets
Generate text using DeepSeek R1 or V3 models with customizable parameters like max_tokens and temperature.
Overview
Deepseek_R1 MCP Server
This MCP server exposes a deepseek_r1 tool for DeepSeek R1 (or DeepSeek-V3) text generation in Claude Desktop, with configurable temperature/max_tokens and detailed error handling. Use it when Claude Desktop needs DeepSeek R1 reasoning-heavy text generation. Requires a DeepSeek API key. Tune temperature by task type per DeepSeek's guidance.
What it does
An MCP server implementation for the DeepSeek R1 language model, a reasoning-optimized model with an 8192-token context window, built in Node.js/TypeScript for stable MCP integration, with better type safety and error handling than the implementation team found in alternative approaches. It exposes a single deepseek_r1 tool taking a prompt plus configurable max_tokens and temperature parameters. By default it targets the deepseek-reasoner model (DeepSeek-R1); switching the model string in src/index.ts from deepseek-reasoner to deepseek-chat targets DeepSeek-V3 instead, without any other code changes required. It provides robust error handling with detailed messages covering API authentication errors, invalid parameters, rate limiting, and network issues, so failures surface with enough context to diagnose them rather than a generic error.
When to use - and when NOT to
Use it when Claude Desktop needs to call DeepSeek R1 (or, with a one-line code change, DeepSeek-V3) for reasoning-heavy text generation. It requires Node.js 18+, npm, Claude Desktop, and a DeepSeek API key set as DEEPSEEK_API_KEY. The temperature parameter should be tuned to the task, per DeepSeek's own published guidance: 0.0 for coding and math (code generation, mathematical calculations), 1.0 for data cleaning and data analysis tasks, 1.3 for general conversation and chat dialogue, 1.3 for language translation, and 1.5 for creative writing and poetry generation - the server's own default is 0.2, distinct from all of those recommended values.
Capabilities
The tool's JSON call shape is fixed: {"name": "deepseek_r1", "arguments": {"prompt": "...", "max_tokens": 8192, "temperature": 0.2}} - only prompt is required; the documented example sets max_tokens to the full 8192-token ceiling and temperature to the server's 0.2 default, both of which a caller can override per request to trade off response length and creativity.
How to install
git clone https://github.com/66julienmartin/MCP-server-Deepseek_R1.git
cd deepseek-r1-mcp
npm install
cp .env.example .env # add DEEPSEEK_API_KEY
npm run build
Claude Desktop configuration points node at the built build/index.js file with DEEPSEEK_API_KEY set in the env block. npm run dev runs the server in watch mode during development, rebuilding automatically as source files change. The project structure keeps the entire server implementation in a single src/index.ts file, compiled into build/index.js.
Who it's for
Developers who want Claude Desktop to call DeepSeek R1 (or DeepSeek-V3) for reasoning tasks, with task-appropriate temperature tuning and clear, diagnosable error messages when something goes wrong. Distributed under the MIT License, and open to community contributions via pull request.
Source README
Deepseek R1 MCP Server
A Model Context Protocol (MCP) server implementation for the Deepseek R1 language model. Deepseek R1 is a powerful language model optimized for reasoning tasks with a context window of 8192 tokens.
Why Node.js?
This implementation uses Node.js/TypeScript as it provides the most stable integration with MCP servers. The Node.js SDK offers better type safety, error handling, and compatibility with Claude Desktop.
Quick Start
Installing manually
# 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
Prerequisites
- Node.js (v18 or higher)
- npm
- Claude Desktop
- Deepseek API key
Model Selection
By default, this server uses the deepseek-R1 model. If you want to use DeepSeek-V3 instead, modify the model name in src/index.ts:
// For DeepSeek-R1 (default)
model: "deepseek-reasoner"
// For DeepSeek-V3
model: "deepseek-chat"
Project Structure
deepseek-r1-mcp/
├── src/
│ ├── index.ts # Main server implementation
├── build/ # Compiled files
│ ├── index.js
├── LICENSE
├── README.md
├── package.json
├── package-lock.json
└── tsconfig.json
Configuration
- Create a
.envfile:
DEEPSEEK_API_KEY=your-api-key-here
- Update Claude Desktop configuration:
{
"mcpServers": {
"deepseek_r1": {
"command": "node",
"args": ["/path/to/deepseek-r1-mcp/build/index.js"],
"env": {
"DEEPSEEK_API_KEY": "your-api-key"
}
}
}
}
Development
npm run dev # Watch mode
npm run build # Build for production
Features
- Advanced text generation with Deepseek R1 (8192 token context window)
- Configurable parameters (max_tokens, temperature)
- Robust error handling with detailed error messages
- Full MCP protocol support
- Claude Desktop integration
- Support for both DeepSeek-R1 and DeepSeek-V3 models
API Usage
{
"name": "deepseek_r1",
"arguments": {
"prompt": "Your prompt here",
"max_tokens": 8192, // Maximum tokens to generate
"temperature": 0.2 // Controls randomness
}
}
The Temperature Parameter
The default value of temperature is 0.2.
Deepseek recommends setting the temperature according to your specific use case:
| USE CASE | TEMPERATURE | EXAMPLE |
|---|---|---|
| Coding / Math | 0.0 | Code generation, mathematical calculations |
| Data Cleaning / Data Analysis | 1.0 | Data processing tasks |
| General Conversation | 1.3 | Chat and dialogue |
| Translation | 1.3 | Language translation |
| Creative Writing / Poetry | 1.5 | Story writing, poetry generation |
Error Handling
The server provides detailed error messages for common issues:
- API authentication errors
- Invalid parameters
- Rate limiting
- Network issues
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.
