DeepSeek MCP Server
DeepSeek MCP Server exposes DeepSeek text/visual chat, Responses, FIM, model/balance lookup, Files API management, and in-memory conversations as MCP tools.
Run text or image-based chat completions with thinking controls, function tools, JSON output, streaming aggregation, and optional conversation memory.
Create stateless Responses API calls with text/images, reasoning controls, function tools, apply_patch custom tools, structured output, and optional server-side web search on Pro models.
Generate fill-in-the-middle completions via the beta
/beta/completionsendpoint.Discover available models and their limits/modalities/capabilities, and check account balance and availability.
Upload, list, retrieve, and delete reusable image files through DeepSeek's Files API.
Reset or list local in-memory conversation IDs for debugging retained chat context.
Use either stdio or Streamable HTTP transport, with optional bearer-token auth, origin allowlisting, and tool rate limiting.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@DeepSeek MCP Server start a conversation with deepseek-chat and set temperature to 0.7 for creative responses"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
DeepSeek MCP Server
An MCP server for DeepSeek V4.1 Flash and V4 Pro APIs: text and visual chat, the Responses API, FIM completion, Files API lifecycle operations, model discovery, balance checks, and bounded in-memory conversations.
Version 1.4.1 uses the stable MCP TypeScript SDK v2 and serves both the 2026-07-28 protocol and stateless legacy clients.
What's current
Checked against the official API docs on October 19, 2026:
The canonical fast model is
deepseek-flash, now served by DeepSeek-V4.1-Flash-1017. The October 17 model update did not change its API calling method or model-token pricing.deepseek-v4-flashanddeepseek-v4-flash-vision-expare temporary aliases fordeepseek-flash.deepseek-v4-procontinues serving V4 Pro 0813. DeepSeek reversed its announced September rerouting plan; Pro remains available with unchanged billing.V4.1 Flash accepts visual input through Chat Completions and Responses. V4 Pro accepts text input. Use
list_modelsto check your account's live availability.The Files API supports upload, list, retrieve, and delete for reusable image inputs.
DeepSeek documents a 1M-token context window and up to 384K output tokens for
deepseek-flash.
“Multimodal” here means image understanding. This server does not generate images, video, or audio.
Related MCP server: Deepseek MCP Server
Tools
The server exposes eleven tools:
chat_completion: text or visual Chat Completions, thinking controls, function tools, JSON output, streaming aggregation, and optionalconversation_idmemory.create_response: stateless Responses API calls with text/images, reasoning controls, function tools, theapply_patchcustom tool, structured output, and semantic streaming aggregation.completion: FIM completion through/beta/completions.list_models: live model discovery, including display names, context/output limits, input/output modalities, effort levels, and API capabilities.get_user_balance: account availability and balances.upload_file: upload base64 JPEG, PNG, GIF, or WebP data and receive a reusable DeepSeekfile_id.list_files: list uploaded files with cursor, order, and purpose filters.retrieve_file: retrieve metadata for onefile_id.delete_file: delete one uploaded file.reset_conversation: clear one local in-memory conversation.list_conversations: list local in-memory conversation IDs.
Every tool declares an MCP output schema and behavior annotations. Full
provider payloads remain opt-in through include_raw_response=true.
API behavior
Thinking is enabled by default. Canonical reasoning efforts are
none,low,high, andmax. Compatibility aliases are accepted:minimalmaps tolow;mediumandxhighmap tohigh; the thinking guide also acceptsultraas an alias formax.Chat
stream_optionsrequiresstream=true. Chat forced tool choices (requiredor a named function) require thinking to be disabled.Chat prefix completion (
prefix=true) and strict function tools (strict=true) automatically use/beta/chat/completions. Configured/v1and/betabases are normalized for beta requests.Frequency and presence penalties remain accepted for compatibility, but DeepSeek ignores them.
Responses calls are stateless: send full input history.
web_searchruns server-side withdeepseek-v4-pro; DeepSeek ignores it withdeepseek-flash. Other built-in tool types such asfile_search,code_interpreter, andmcpare ignored. The supported custom tool is{ "type": "custom", "name": "apply_patch" }. Returned calls appear incustom_tool_calls; the client is responsible for executing them and sendingcustom_tool_call_outputhistory.output_itemspreserves complete returned reasoning, message, and tool-call items for replay without enabling the full raw provider response.FIM is beta and non-thinking. It supports streaming usage options;
echo=truecannot accompanysuffixorlogprobs. Its guide documents a 4K output limit, so do not assume the Chat output ceiling applies.DEEPSEEK_REQUEST_TIMEOUT_MSapplies to the complete request, including reading the response body and streaming output. Streams are aggregated into one MCP result; partial tokens are not forwarded as MCP notifications.
Search and Fetch billing notice
DeepSeek opened separate Search and Fetch APIs on October 17, 2026. Each costs $0.75 per 1,000 successful requests, billed by request rather than tokens or result count. A request is billable only if it returns HTTP 200 with a non-empty Search result or Fetch page content. These charges are separate from model-token charges.
DeepSeek says Search and Fetch calls made through server-side tools in DeepSeek Harness, Claude Code, and Codex are temporarily free for DeepSeek API users; per-request billing starts October 31, 2026 at 16:00 UTC (November 1 at 00:00 Beijing time). This announced waiver names those clients; do not assume it covers other integrations. Check DeepSeek's current pricing before enabling search in an agent.
This MCP server does not expose standalone Search or Fetch tools. Its
create_response tool already accepts web_search for Pro, which DeepSeek
runs on its server; Flash ignores it. The new raw JSON endpoints are
POST /v1/tools/search and POST /v1/tools/fetch. The server's
MCP_TOOL_RATE_LIMIT limits MCP invocations, not DeepSeek spending.
Install
Node.js 20 or newer is required.
Run directly over stdio:
DEEPSEEK_API_KEY="REPLACE_WITH_DEEPSEEK_KEY" npx -y deepseek-mcp-server@1Codex CLI:
codex mcp add deepseek --env DEEPSEEK_API_KEY="REPLACE_WITH_DEEPSEEK_KEY" -- npx -y deepseek-mcp-server@1Claude Code:
claude mcp add deepseek --env DEEPSEEK_API_KEY="REPLACE_WITH_DEEPSEEK_KEY" -- npx -y deepseek-mcp-server@1Example MCP client configuration:
{
"mcpServers": {
"deepseek": {
"command": "npx",
"args": ["-y", "deepseek-mcp-server@1"],
"env": {
"DEEPSEEK_API_KEY": "REPLACE_WITH_DEEPSEEK_KEY"
}
}
}
}Visual input
chat_completion accepts image URLs:
{
"message": [
{ "type": "text", "text": "Describe this image." },
{
"type": "image_url",
"image_url": {
"url": "https://example.com/photo.png",
"detail": "high"
}
}
]
}It also accepts a supported base64 data URL without first uploading it:
{
"message": [
{ "type": "text", "text": "What is shown here?" },
{
"type": "file",
"file_data": "data:image/png;base64,iVBORw0KGgo...",
"filename": "image.png"
}
]
}For reuse, call upload_file, then pass its returned ID:
{
"filename": "diagram.png",
"file_data": "iVBORw0KGgo...",
"expires_after_seconds": 86400
}{
"message": [
{ "type": "text", "text": "Explain this diagram." },
{ "type": "file", "file_id": "file-api-..." }
]
}The same uploaded file can be used with create_response:
{
"input": [
{
"role": "user",
"content": [
{ "type": "input_text", "text": "Read the image." },
{ "type": "input_image", "file_id": "file-api-..." }
]
}
]
}Supported image formats are JPEG, PNG, GIF, and WebP. Detail may be low,
high, original, or auto.
Image limits
Inline images are limited to 32 MiB each, uploaded Files to 64 MiB, JSON request bodies to 48 MiB, and requests to 600 images. Local validation checks known inline sizes, image counts, and serialized UTF-8 body size. DeepSeek checks remote/downloaded and uploaded-file dimensions and aggregate sizes: 64 MiB total without file references, or 200 MiB including them. Dimensions are limited to 8192 pixels per side, dropping to 4096 when there are at least 15 images. External downloads must complete within 60 seconds.
The server does not fetch image URLs or read file metadata just to preflight these provider-side limits. Use the Files API for large or reused images.
Upload safety boundary
upload_file accepts raw base64 or a supported image data URL. It deliberately
does not accept local file paths and does not fetch arbitrary URLs on the
server. Decoded uploads are limited to 64 MiB, and the bytes are
signature-checked before upload. Uploaded data is stored by DeepSeek under your
account; use an expiry or delete_file when it should not persist. Expiry must
be between 3,600 and 2,592,000 seconds. DeepSeek storage is limited to 25 GiB
and 10,000 files per user. Its upload deadline is ten minutes; increase
DEEPSEEK_REQUEST_TIMEOUT_MS for large uploads when needed.
Streamable HTTP
Run a local HTTP endpoint:
DEEPSEEK_API_KEY="REPLACE_WITH_DEEPSEEK_KEY" \
MCP_TRANSPORT=streamable-http \
MCP_HTTP_HOST=127.0.0.1 \
MCP_HTTP_PORT=3001 \
npx -y deepseek-mcp-server@1The endpoint defaults to http://127.0.0.1:3001/mcp.
For browser clients, set an exact comma-separated origin allowlist:
MCP_HTTP_ALLOWED_ORIGINS=https://app.example.com,http://localhost:3000Requests that include an Origin header are rejected with 403 unless the
origin is allowlisted. Native clients that omit Origin are unaffected.
HTTP authentication and admission limits
Local HTTP binds to loopback by default. To protect it with a shared bearer
token, set MCP_HTTP_AUTH_TOKEN; callers then send Authorization: Bearer <token>.
This is shared-token access control, not an OAuth authorization server.
Non-loopback binds now require either MCP_HTTP_AUTH_TOKEN or
MCP_HTTP_TRUST_AUTH_GATEWAY=true. Use gateway mode only when a reverse proxy
authenticates every MCP request and prevents direct access to the backend.
A browser origin allowlist is independent of authentication. Hosted installations
upgrading from 1.0.1 must explicitly configure one of these authentication paths.
MCP_TOOL_RATE_LIMIT defaults to 120 invocations per 60-second window, shared
across all tools and stateless HTTP request instances using the same provider
client. Rate-limit responses are MCP tool errors with error_type=tool_rate_limit
and retryable=true; denied calls do not reach DeepSeek or alter conversations.
MCP cancellation reaches the provider request. Cancelled replies are not saved
to conversation history. Reading a missing conversation resource returns the
protocol's -32602 error. Resource list-change notifications are not advertised.
Hosted endpoint
A separately deployed endpoint is available at
https://deepseek-mcp.ragweld.com/mcp using
Authorization: Bearer <token>. The hosted deployment has its own release
cycle and may lag the npm/GitHub release; inspect tools/list before relying
on a newly added tool.
Environment
Required:
DEEPSEEK_API_KEY=your-api-keyOptional:
DEEPSEEK_BASE_URL=https://api.deepseek.com
DEEPSEEK_REQUEST_TIMEOUT_MS=120000
DEEPSEEK_DEFAULT_MODEL=deepseek-flash
MCP_TRANSPORT=stdio
MCP_HTTP_HOST=127.0.0.1
MCP_HTTP_PORT=3001
MCP_HTTP_PATH=/mcp
MCP_HTTP_ALLOWED_ORIGINS=https://app.example.com,http://localhost:3000
MCP_HTTP_AUTH_TOKEN=
MCP_HTTP_TRUST_AUTH_GATEWAY=false
MCP_TOOL_RATE_LIMIT=120
CONVERSATION_MAX_MESSAGES=200CONVERSATION_MAX_MESSAGES bounds the messages retained per conversation in
the process-local store. Restarting the process clears this store.
MCP compatibility
Built on
@modelcontextprotocol/serverand@modelcontextprotocol/client2.3.1, with@modelcontextprotocol/node2.1.1.Modern MCP 2026-07-28 is stateless: discovery uses
server/discover, requests carry protocol version and client capabilities in_meta, and completed results carryresultTypeand required caching fields. The SDK validates the corresponding HTTP headers. Stateless 2025-era handling remains available for older clients.Stdio chooses the protocol era from the opening exchange and pins one server instance for that connection.
Static discovery/list results carry one-hour public cache hints; dynamic resource lists, runtime data, live account data, and conversations remain private and short-lived or uncached.
Explicit
conversation_idmemory is application state and works independently of transport session state.
Migrating from 0.6.0
The default model changed from
deepseek-v4-flashtodeepseek-flash.The MCP SDK moved from the monolithic v1 package to the split v2 packages.
MCP_HTTP_STATEFUL_SESSIONwas removed. HTTP protocol handling is now per-request/stateless; useconversation_idfor retained chat context.Four Files API tools and visual inputs were added.
Existing tool names and
include_raw_responsebehavior remain compatible.
Release 1.4.1
Preserves leading system instructions and removes orphaned tool results when
conversation history reaches its configured cap. Refreshes the MCP Node adapter
and locks @hono/node-server to 2.1.5 to clear GHSA-rmxm-3fg6-px4f. This server
does not use the affected serveStatic helper. HTTP startup supplies Node's Web
Crypto only when the global is missing. Node >=20 support is unchanged.
Release 1.4.0
This release refreshes MCP dependencies, corrects Pro availability and Responses
capabilities, adds apply_patch custom-tool results and FIM usage options, and
fixes beta routing, end-to-end request deadlines, split CRLF SSE boundaries,
stream error handling, and non-JSON provider errors. Existing tool names and
opt-in raw responses are preserved. The complete API/MCP audit also adds
vision request limits, complete Responses history, cancellation propagation,
truthful capabilities, missing-resource errors, tool admission limits,
reflected-credential redaction, and explicit remote HTTP authentication.
DEEPSEEK_DEFAULT_MODEL is now honored by all three generation tools.
Earlier 1.1.0–1.3.0 version identifiers were historically published and removed; npm cannot reuse them. The next available minor release is 1.4.0.
Development and verification
npm ci
npm run build
npm test
npm pack --dry-runCredentialed smoke tests:
DEEPSEEK_API_KEY="REPLACE_WITH_DEEPSEEK_KEY" npm run test:live
DEEPSEEK_MCP_AUTH_TOKEN="REPLACE_WITH_TOKEN" npm run test:remoteThe live smoke covers model listing, balance, text chat, thinking streaming,
Responses, strict beta function calling, apply_patch custom-tool calls, FIM,
visual input, and a Files upload/retrieve/list/delete lifecycle with cleanup.
Registry identity
MCP Registry:
io.github.DMontgomery40/deepseeknpm:
deepseek-mcp-server@1.4.1OCI:
docker.io/dmontgomery40/deepseek-mcp-server:0.5.0is the last published image and does not contain the current npm feature set.
Documentation audit
The release audit covers every supported DeepSeek endpoint reference and its current guides, plus all 31 pages and the authoritative schema of MCP 2026-07-28. Findings, coverage, source conflicts, optional capabilities, and verification limits are recorded in the API audit and the MCP audit. Anthropic-format provider APIs were read for context; this server exposes the OpenAI-compatible Chat, Responses, FIM, Files, model, and balance routes.
Official references
License
MIT
Available Tools
11 toolschat_completionA
Primary DeepSeek V4.1 chat tool for text, images, and multi-turn generation. Defaults to deepseek-flash. Provide either message (a text string or text/image/file content parts) or messages (full chat history); if both are provided, messages is used. Images may use an HTTP(S) URL, supported base64 data URL, or Files API file_id. Thinking is enabled by default; use reasoning_effort for current effort controls. Use conversation_id for explicit in-memory context. Set include_raw_response=true only for provider-payload debugging.
Inputs: stop, model, tools, top_p, +19 more. Returns: model, usage, status, message, +10 more
completionA
DeepSeek FIM completion tool for prompt/suffix fill-in-the-middle workflows. Defaults to deepseek-flash in non-thinking mode. Use this when you need raw completion text instead of chat message formatting. Set include_raw_response=true only when you need the full provider payload for debugging.
Inputs: prompt (required), echo, stop, model, +10 more. Returns: text, model, usage, status, +7 more
create_responseA
Create a stateless DeepSeek V4.1 response using the OpenAI-compatible Responses API. Defaults to deepseek-flash and accepts text, image URLs, base64 images, and Files API file_id inputs. Use reasoning.effort for thinking control, tools for function or server-side web-search tools, and stream=true for semantic SSE aggregation. Send full input history for multi-turn work. Set include_raw_response=true only for provider-payload debugging.
Inputs: text, user, input, model, +11 more. Returns: error, model, usage, status, +10 more
delete_fileBDestructiveIdempotent
Delete one uploaded DeepSeek image by file_id. This permanently removes that provider-side file reference.
Inputs: file_id (required). Returns: id, object, status, deleted, +4 more
get_user_balanceARead-onlyIdempotent
Return the current DeepSeek account balance and availability status. This tool takes no parameters and is read-only. Use it for account health checks when diagnosing provider-side failures.
Inputs: no named parameters. Returns: status, message, retryable, error_type, +3 more
list_conversationsARead-onlyIdempotent
List all conversation IDs currently stored in this MCP process memory. This tool takes no parameters and does not call the DeepSeek API. Useful for debugging conversation persistence behavior.
Inputs: no named parameters. Returns: count, status, message, retryable, +3 more
list_filesARead-onlyIdempotent
List images uploaded to the DeepSeek Files API. Supports cursor pagination, creation-time order, and the user_data purpose filter.
Inputs: after, limit, order, purpose. Returns: data, object, status, last_id, +6 more
list_modelsARead-onlyIdempotent
List available DeepSeek models for model selection and validation. This tool takes no parameters. Use it before passing an explicit model ID to generation tools.
Inputs: no named parameters. Returns: data, object, status, message, +3 more
reset_conversationADestructiveIdempotent
Delete stored in-memory chat history for a conversation_id. Use this when you want to keep the same ID but start a fresh thread. This only affects server-side memory in the current MCP process.
Inputs: conversation_id (required). Returns: status, message, removed, retryable, +3 more
retrieve_fileBRead-onlyIdempotent
Retrieve metadata for one DeepSeek Files API image by file_id.
Inputs: file_id (required). Returns: id, bytes, object, status, +8 more
upload_fileA
Upload a JPEG, PNG, GIF, or WebP image to DeepSeek and return a reusable file_id. Supply base64 image data directly; server-local file paths are intentionally not accepted. Optional expiry is 3,600 to 2,592,000 seconds.
Inputs: filename (required), file_data (required), expires_after_seconds. Returns: id, bytes, object, status, +8 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
The three generation tools (chat_completion, completion, create_response) have overlapping capabilities like text/image input and multi-turn support, which could cause confusion. However, their descriptions clearly differentiate use cases (chat vs FIM vs stateless Responses API), and all other tools target distinct resources or actions.
Nine of eleven tools follow a consistent verb_noun pattern (e.g., list_models, upload_file, delete_file). The two exceptions (chat_completion and completion) are noun-only names, but they are conventional and readable, making the set mostly predictable.
The server provides 11 tools, which is well within the ideal 3–15 range. Each tool covers a distinct aspect of the DeepSeek API (generation, file management, account info, conversation memory), with no obvious redundancy or bloat.
The surface covers core generation, file CRUD (upload/list/retrieve/delete), model listing, balance check, and conversation memory management. Minor gaps include no explicit update or detailed inspection of conversations, but these are not critical for typical workflows.
Maintenance
Related MCP Connectors
Chat, image, video, and audio models from many vendors behind one remote MCP server and one key.
Connect MCP clients to 2,000+ AI models without managing provider API keys.
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
MCP server for AI dialogue using various LLM models via AceDataCloud
Related MCP Servers
- AlicenseDqualityDmaintenanceAllows seamless integration of DeepSeek's language models with MCP-compatible applications like Claude Desktop, supporting features such as model selection, temperature control, and multi-turn conversations with automatic model fallback.2573 npm2MIT
- AlicenseAqualityAmaintenanceMCP server for DeepSeek AI models (Chat + Reasoner). Supports multi-turn sessions, model fallback with circuit breaker, function calling, thinking mode, JSON output, multimodal input, and cost tracking.3555 npm26MIT
- AlicenseAqualityBmaintenanceBridges MCP clients to the DeepSeek API for chat completions and model discovery, with an optional locked-down bridge that delegates prompts to local CLI harnesses like Claude, Codex, or opencode.446 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables MCP-compatible applications to interact with local and cloud-hosted LLM models for model management, text generation, chat, embeddings, and web search/fetch.812 npmAGPL 3.0