deepseek-mcp-server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| DEEPSEEK_API_KEY | Yes | Required. DeepSeek API key. Can also be set as the apiKey key in ~/.deepseek-mcp/config.json. | |
| DEEPSEEK_ALLOW_FS | No | Whether local file reads are allowed. Set to 0 to block all local file reads. | true |
| DEEPSEEK_BASE_URL | No | Base URL for the DeepSeek or any OpenAI-compatible API. | https://api.deepseek.com |
| DEEPSEEK_FS_ROOTS | No | Directories to confine file reads to. Empty means unrestricted. | |
| DEEPSEEK_LOG_FILE | No | Log file path. Rotates at 5 MB. | ~/.deepseek-mcp/deepseek-mcp.log |
| DEEPSEEK_LOG_LEVEL | No | Log level: silent, error, warn, info, debug, or trace. | info |
| DEEPSEEK_CHAT_MODEL | No | Model used for chat completions. | deepseek-chat |
| DEEPSEEK_MAX_TOKENS | No | Default max_tokens value. 0 means send no max_tokens and let the API use its own maximum. | 0 |
| DEEPSEEK_TIMEOUT_MS | No | Request timeout in milliseconds. Default is 15 minutes for long reasoning runs. | 900000 |
| DEEPSEEK_LOG_TO_FILE | No | Whether logging to a file is enabled. | true |
| DEEPSEEK_MAX_RETRIES | No | Maximum number of retries with exponential backoff. Honours Retry-After. | 4 |
| DEEPSEEK_BETA_BASE_URL | No | Beta base URL used by fill-in-the-middle and prefix completion. | <baseUrl>/beta |
| DEEPSEEK_REASONER_MODEL | No | Model used for reasoning completions. | deepseek-reasoner |
| DEEPSEEK_MAX_BYTES_TOTAL | No | Maximum total bytes read. 0 means unlimited. | 8000000 |
| DEEPSEEK_MAX_OUTPUT_CHARS | No | Maximum output characters for tool results. 0 means never truncate. | 0 |
| DEEPSEEK_PERSIST_SESSIONS | No | Whether multi-turn sessions are persisted to disk. | true |
| DEEPSEEK_MAX_BYTES_PER_FILE | No | Maximum bytes read per file. 0 means unlimited. | 2000000 |
| DEEPSEEK_SESSION_MAX_MESSAGES | No | Maximum messages retained in a session. Oldest turns are dropped past this. | 200 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
DeepSeek MCP server. deepseek_chat for fast general work, deepseek_reason for hard multi-step problems (returns its chain of thought), deepseek_code for task-oriented coding help, deepseek_fim for fill-in-the-middle code completion, deepseek_prefix to force a reply's opening text, deepseek_analyze_files to read local files or whole trees and ask about them, deepseek_session for multi-turn memory, and deepseek_raw_request to reach any endpoint or parameter not modelled by the typed tools. Run deepseek_status with test_connection first if anything misbehaves.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {} |
| prompts | {} |
| resources | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| deepseek_chatA | Send a prompt to deepseek-chat, DeepSeek's fast general-purpose model. Supports the full API surface: system prompts, multi-turn message arrays, sampling controls, stop sequences, JSON mode, function calling, logprobs, streaming, persistent sessions, and an |
| deepseek_reasonA | Send a prompt to deepseek-reasoner, which produces an explicit chain of thought before its answer. Best for hard maths, logic, debugging and multi-step planning. Returns the reasoning trace and the final answer separately. Sampling parameters are ignored by this model and are dropped automatically. |
| deepseek_codeA | Task-oriented coding helper. Pick a task (generate, review, refactor, explain, test, debug, document, optimize, convert) and pass code inline and/or as file paths. Routes to deepseek-reasoner for debug/review/optimize and deepseek-chat otherwise, unless you override |
| deepseek_fimA | Fill-in-the-middle completion against the DeepSeek beta endpoint. Give the code before the cursor as |
| deepseek_prefixA | Beta prefix completion: force the model's reply to begin with text you supply, then let it continue. Use it to pin output format (start with '```python' to guarantee a code block), to resume a truncated answer, or to steer a refusal-prone completion. The prefix is included in the returned text. |
| deepseek_analyze_filesA | Read local files, directories or globs and ask DeepSeek a question about them. Directories are walked recursively, skipping node_modules, .git, build output and binaries. Use this for codebase questions, cross-file review, config auditing, log analysis or document summarisation. Reads are enabled by default with no path restriction; set DEEPSEEK_FS_ROOTS to confine it or DEEPSEEK_ALLOW_FS=0 to disable reads entirely. |
| deepseek_sessionA | Inspect and manage the persistent conversations used by the |
| deepseek_modelsA | List the model ids available to your API key. Useful for discovering new models without updating this server. |
| deepseek_balanceA | Show the remaining credit on the DeepSeek account behind your API key, per currency. |
| deepseek_count_tokensA | Estimate the token count of some text using DeepSeek's published ratios (about 0.3 tokens per English character, 0.6 per CJK character). An estimate for budgeting, not an exact tokenizer. |
| deepseek_statusA | Show the resolved configuration (API key masked), request statistics for this process, and session count. Pass test_connection to make a live one-token call that verifies the key, base URL and network path end to end. Run this first whenever something is not working. |
| deepseek_raw_requestA | Call any DeepSeek API endpoint directly with a body you control, and get the unmodified JSON back. This is the unrestricted escape hatch: it covers endpoints and parameters that the typed tools above do not model, including anything DeepSeek adds after this server was written. Authentication, retries, timeouts and base-URL resolution are still handled for you. Examples: path '/chat/completions' with your own body, path '/models' with method GET, path '/completions' with beta true. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| deepseek-code-review | Ask DeepSeek for a severity-ordered review of a block of code: correctness, security, performance. |
| deepseek-debug | Give DeepSeek code plus an error and get a root-cause diagnosis and fix. |
| deepseek-explain | Get a clear walkthrough of what a piece of code does and why. |
| deepseek-write-tests | Produce a thorough runnable test suite for some code. |
| deepseek-optimize | Find the real bottleneck and get optimised code with the trade-offs named. |
| deepseek-reason | Send a maths, logic or planning problem to the reasoning model. |
| deepseek-translate | Translate text, preserving tone and formatting. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| Resolved configuration | The configuration this server is actually running with, API key masked. |
| Available models | Live model list from the DeepSeek API for your key. |
| Conversation sessions | Index of stored multi-turn sessions. |
| Request statistics | Request, retry, failure and token counters for this process. |
| Server log tail | The last 200 lines of the server log. |
TDQS
Scored across 12 tools
Most tools have clearly distinct purposes: chat, reason, FIM, prefix, file analysis, session management, account status, and raw API access are easy to tell apart. There is some overlap between deepseek_chat, deepseek_reason, and deepseek_code, since deepseek_code is a task wrapper that routes to the other models, and deepseek_raw_request can technically replicate any typed tool. Descriptions largely resolve this, but the boundaries are not perfectly crisp.
Every tool uses the same deepseek_ prefix followed by a lowercase snake_case descriptor, producing a highly predictable namespace. The suffixes mix resource names (models, balance, session, status) and actions (chat, reason, analyze_files), but the overall convention is consistent and readable.
Twelve tools is well within a reasonable range for a model-provider wrapper that exposes chat, reasoning, coding, completion, file analysis, session, account, diagnostics, and raw API surfaces. Each tool appears to earn its place rather than being redundant filler.
The surface covers the major DeepSeek workflows: general chat, reasoning, coding tasks, FIM and prefix completion, model discovery, balance, file-based analysis, session lifecycle, token estimation, diagnostics, and an unrestricted raw-request escape hatch. The raw tool ensures any unmodelled endpoint or future API addition remains reachable, so there are no obvious dead ends.