DeepSeek MCP server

Integrates DeepSeek's language models, enabling AI-powered chat completions with customizable parameters for tasks like writing assistance and code generation.
Back to servers
Provider
DMontgomery40
Release date
Jan 22, 2025
Language
TypeScript
Package
Stats
3.7K downloads
240 stars

The DeepSeek MCP Server enables seamless integration of DeepSeek's powerful language models with MCP-compatible applications like Claude Desktop. It acts as a bridge between DeepSeek's API and any application that supports the Model Context Protocol.

Installation Options

Using Smithery (Recommended)

For automatic installation with Claude Desktop:

npx -y @smithery/cli install @dmontgomery40/deepseek-mcp-server --client claude

Manual Installation

Install the server globally via npm:

npm install -g deepseek-mcp-server

Configuration with Claude Desktop

Add the server configuration to your claude_desktop_config.json file:

{
  "mcpServers": {
    "deepseek": {
      "command": "npx",
      "args": [
        "-y",
        "deepseek-mcp-server"
      ],
      "env": {
        "DEEPSEEK_API_KEY": "your-api-key"
      }
    }
  }
}

Natural Language Configuration

The server responds to natural language requests to change settings:

  • "What models are available?"
  • "What configuration options do I have?"
  • "What is the current temperature setting?"
  • "Start a multi-turn conversation with deepseek-chat, make it not too creative, and allow 8000 tokens."

Available Features

Automatic Model Fallback

If the primary model (deepseek-reasoner, R1) is unavailable, the server automatically falls back to deepseek-chat (v3).

  • Switch models anytime with commands like "use deepseek-reasoner" or "use deepseek-chat"
  • v3 is recommended for general use
  • R1 is better for technical/complex queries

Customizable Configuration Options

  • Model selection
  • Temperature (0.0 - 2.0)
  • Max tokens limit
  • Top P sampling (0.0 - 1.0)
  • Presence penalty (-2.0 - 2.0)
  • Frequency penalty (-2.0 - 2.0)

Multi-turn Conversation Support

The server maintains complete message history and context throughout conversations, which is especially useful for:

  • Training and fine-tuning custom models
  • Complex multi-step reasoning
  • Technical troubleshooting sessions
  • Detailed discussions requiring context from earlier messages

Fill-in-the-Middle (FIM) Completion Tool

The FIM tool helps with code completion, refactoring, and filling in missing code blocks.

Limitations

  • 4,096 token (4k) context window
  • Best for code and structured text, not general conversation

Using the FIM Tool

The tool accepts these parameters:

  • prefix (required): Text before the missing section
  • suffix (required): Text after the missing section
  • model (optional, default: deepseek-fim)
  • temperature (optional, default: 0.7)
  • max_tokens (optional, default: 1024)
  • top_p (optional, default: 1.0)
  • frequency_penalty (optional, default: 0.1)
  • presence_penalty (optional, default: 0)
  • stream (optional, default: false)

Example FIM Usage

{
  "tool": "fim_completion",
  "params": {
    "prefix": "def add(a, b):\n    return a + b\n\ndef multiply(a, b):\n    ",
    "suffix": "\n    return result\n",
    "temperature": 0.2,
    "max_tokens": 64
  }
}

Testing with MCP Inspector

To test the server locally:

  1. Build the server:

    npm run build
    
  2. Run with MCP Inspector:

    npx @modelcontextprotocol/inspector node ./build/index.js
    

The inspector interface allows you to test chat completions, view available tools, debug responses, and monitor performance.

How to add this MCP server to 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 > MCP and click "Add new global MCP server".

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

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

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