
The DeepSeek MCP Server provides integration with DeepSeek's API, exposing tools for chat completions, model information retrieval, and account balance checking through the Model Context Protocol. It supports both remote hosted endpoints and local deployment options, with authentication via bearer tokens, enabling AI assistants like Claude, Cursor, and Codex to interact with DeepSeek's language models. The server solves the problem of connecting MCP-compatible applications to DeepSeek's services without direct API management.
Public tool metadata for what this MCP can expose to an agent.
deepseek_chatChat with DeepSeek AI models (Chat + Reasoner). Supports function calling, thinking mode, JSON output, cost tracking.9 paramsChat with DeepSeek AI models (Chat + Reasoner). Supports function calling, thinking mode, JSON output, cost tracking.
json_modebooleanmax_tokensnumbermessagesarraymodelstringdeepseek-chat · deepseek-reasonerdefault: deepseek-chatstreambooleantemperaturenumberthinkingobjecttool_choicevaluetoolsarrayAn MCP server for DeepSeek's current V4.1 Flash API: text and visual chat, the Responses API, FIM completion, Files API lifecycle operations, model discovery, balance checks, and bounded in-memory conversations.
Version 1.0.1 uses the stable MCP TypeScript SDK v2 and serves both the 2026-07-28 protocol and stateless legacy clients.
As of September 10, 2026:
deepseek-flash, currently DeepSeek V4.1 Flash.deepseek-v4-flash and deepseek-v4-flash-vision-exp are temporary aliases
for deepseek-flash.deepseek-v4-pro will begin serving V4.1 Flash on
September 14 until V4.1 Pro is released.deepseek-flash.“Multimodal” here means image understanding. This server does not generate images, video, or audio.
The server exposes eleven tools:
chat_completion: text or visual Chat Completions, thinking controls,
function tools, JSON output, streaming aggregation, and optional
conversation_id memory.create_response: stateless Responses API calls with text/images, reasoning
controls, function/custom tools, web search, structured output, and semantic
streaming aggregation.completion: FIM completion through /beta/completions.list_models: live model discovery.get_user_balance: account availability and balances.upload_file: upload base64 JPEG, PNG, GIF, or WebP data and receive a
reusable DeepSeek file_id.list_files: list uploaded files with cursor, order, and purpose filters.retrieve_file: retrieve metadata for one file_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.
Node.js 20 or newer is required.
Run directly over stdio:
DEEPSEEK_API_KEY="REPLACE_WITH_DEEPSEEK_KEY" npx -y deepseek-mcp-server@1
Codex CLI:
codex mcp add deepseek --env DEEPSEEK_API_KEY="REPLACE_WITH_DEEPSEEK_KEY" -- npx -y deepseek-mcp-server@1
Claude Code:
claude mcp add deepseek --env DEEPSEEK_API_KEY="REPLACE_WITH_DEEPSEEK_KEY" -- npx -y deepseek-mcp-server@1
Example MCP client configuration:
{
"mcpServers": {
"deepseek": {
"command": "npx",
"args": ["-y", "deepseek-mcp-server@1"],
"env": {
"DEEPSEEK_API_KEY": "REPLACE_WITH_DEEPSEEK_KEY"
}
}
}
}
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.
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.
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@1
The 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:3000
Requests that include an Origin header are rejected with 403 unless the
origin is allowlisted. Native clients that omit Origin are unaffected.
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.
Required:
DEEPSEEK_API_KEY=your-api-key
Optional:
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
CONVERSATION_MAX_MESSAGES=200
CONVERSATION_MAX_MESSAGES bounds the total messages retained in the
process-local conversation store. Restarting the process clears this store.
@modelcontextprotocol/server, @modelcontextprotocol/node, and
@modelcontextprotocol/client 2.0.conversation_id memory is application state and works independently
of transport session state.deepseek-v4-flash to deepseek-flash.MCP_HTTP_STATEFUL_SESSION was removed. HTTP protocol handling is now
per-request/stateless; use conversation_id for retained chat context.include_raw_response behavior remain compatible.npm ci
npm run build
npm test
npm pack --dry-run
Credentialed smoke tests:
DEEPSEEK_API_KEY="REPLACE_WITH_DEEPSEEK_KEY" npm run test:live
DEEPSEEK_MCP_AUTH_TOKEN="REPLACE_WITH_TOKEN" npm run test:remote
The live smoke covers model listing, balance, text chat, thinking streaming, Responses, FIM, visual input, and a Files upload/retrieve/list/delete lifecycle with cleanup.
io.github.DMontgomery40/deepseekdeepseek-mcp-server@1.0.1docker.io/dmontgomery40/deepseek-mcp-server:0.5.0 is the last
published image and does not contain the 1.0.1 feature set.MIT
DEEPSEEK_API_KEY*secretDeepSeek API key used for upstream DeepSeek requests