Deepseek R1 MCP server

Integrates with Deepseek R1 model for text generation and analysis tasks, enabling content creation and AI-assisted decision-making in various applications.
Back to servers
Setup instructions
Provider
Julien Martin
Release date
Feb 06, 2025
Language
TypeScript
Stats
64 stars

Deepseek R1 MCP Server is an implementation of the Model Context Protocol for the Deepseek R1 language model. This server enables you to integrate the powerful reasoning capabilities of Deepseek R1, which features an 8192-token context window, with applications like Claude Desktop.

Quick Start

Installation

# 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

Before using the Deepseek R1 MCP Server, you'll need:

  • Node.js (v18 or higher)
  • npm
  • Claude Desktop
  • Deepseek API key

Model Selection

By default, this server uses the deepseek-R1 model, but you can also use DeepSeek-V3 by modifying the model name:

// For DeepSeek-R1 (default)
model: "deepseek-reasoner"

// For DeepSeek-V3
model: "deepseek-chat"

Configuration

Setting Up Environment

  1. Create a .env file with your API key:
DEEPSEEK_API_KEY=your-api-key-here

Configuring Claude Desktop

Add the following to your Claude Desktop configuration:

{
  "mcpServers": {
    "deepseek_r1": {
      "command": "node",
      "args": ["/path/to/deepseek-r1-mcp/build/index.js"],
      "env": {
        "DEEPSEEK_API_KEY": "your-api-key"
      }
    }
  }
}

Using the API

The API accepts the following parameters:

{
  "name": "deepseek_r1",
  "arguments": {
    "prompt": "Your prompt here",
    "max_tokens": 8192,    // Maximum tokens to generate
    "temperature": 0.2     // Controls randomness
  }
}

Temperature Settings

The default temperature is 0.2. Deepseek recommends different settings based on your use case:

  • Coding/Math (0.0): For code generation and mathematical calculations
  • Data Cleaning/Analysis (1.0): For data processing tasks
  • General Conversation (1.3): For chat and dialogue
  • Translation (1.3): For language translation
  • Creative Writing/Poetry (1.5): For story writing and poetry generation

Error Handling

The server provides detailed error messages for common issues including:

  • API authentication errors
  • Invalid parameters
  • Rate limiting
  • Network issues

You can use these error messages to troubleshoot any problems that arise during usage.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "deepseek_r1" '{"command":"node","args":["/path/to/deepseek-r1-mcp/build/index.js"],"env":{"DEEPSEEK_API_KEY":"your-api-key"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "deepseek_r1": {
            "command": "node",
            "args": [
                "/path/to/deepseek-r1-mcp/build/index.js"
            ],
            "env": {
                "DEEPSEEK_API_KEY": "your-api-key"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "deepseek_r1": {
            "command": "node",
            "args": [
                "/path/to/deepseek-r1-mcp/build/index.js"
            ],
            "env": {
                "DEEPSEEK_API_KEY": "your-api-key"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later