dstools
Augments DeepSeek-V4 with image understanding and deep research capabilities via MCP, enabling vision and web research tools.
README
dstools — DeepSeek-V4 MCP Toolkit
Give DeepSeek-V4 models eyes and a research desk.
An MCP (Model Context Protocol) server that augments DeepSeek's text models with two capabilities they don't have natively:
- Image content understanding — DeepSeek-V4 is a text-only model.
dstoolsadds a vision tool that turns any image into rich, structured text the V4 model can reason over (leveraging its 1M-token context and world-class reasoning).- Deep Research — a multi-step, citation-backed research pipeline that uses V4 as the planning + synthesis brain over live web search and page extraction.
dstools is a productizable, installable Python package. It speaks MCP over stdio and
Streamable HTTP, so any MCP-capable host (Claude Code, Claude Desktop, Cherry Studio, a
custom agent, …) can connect a DeepSeek-V4 backend to it and immediately call these tools.
Why this exists
DeepSeek-V4 (deepseek-v4-flash / deepseek-v4-pro, released 2026-04-24) is an outstanding
text model with 1M context, strong agentic/tool-calling ability, and an automatic context
cache — but the official chat API is text-only (no multimodal vision). dstools closes
exactly that gap:
| DeepSeek-V4 strength | What's missing | What dstools adds |
|---|---|---|
| 1M context, top reasoning | Can't see images | analyze_image → vision-to-text |
| Agentic, tool-calling | No live web access | web_search, fetch_page, deep_research |
| Automatic prompt caching | — | Stable-prefix prompts to maximise cache hits |
Thinking mode (thinking={"type":"enabled"}) |
— | Used selectively for hard synthesis steps |
The toolkit is deeply adapted to V4: it defaults to deepseek-v4-pro for synthesis and
deepseek-v4-flash for cheap sub-steps, toggles V4's native thinking mode per call, structures
prompts for cache hits, and uses V4's JSON-output mode for structured extraction.
Tools exposed
| Tool | Description | Needs a key? |
|---|---|---|
analyze_image |
Describe/understand an image (path, URL, or base64). Returns structured text. | Vision provider key (or local model) |
ocr_image |
Extract text from an image (OCR). | Optional pytesseract |
web_search |
Run a web search, return ranked results (title, url, snippet). | No (DuckDuckGo, keyless) |
fetch_page |
Fetch a URL and return clean, readable Markdown. | No |
deep_research |
Full pipeline: plan → search → fetch → select → synthesize, with citations. | DeepSeek API key |
Granular tools (web_search, fetch_page, analyze_image) let the host agent run its own
agentic loop; deep_research is a one-shot orchestrator for when you just want a cited report.
Quick start
# 1. Install (Python 3.10+)
uv sync # or: pip install -e .
# 2. Configure
cp .env.example .env # then edit: set DEEPSEEK_API_KEY and a vision provider
# 3. Run the MCP server (stdio — for local hosts like Claude Code/Desktop)
uv run dstools serve
# …or over Streamable HTTP (for remote hosts)
uv run dstools serve --transport http --port 8000
Connect from Claude Code:
claude mcp add --transport stdio dstools -- uv run --directory /path/to/dstools dstools serve
A ready-made examples/claude_desktop_config.json is included for Claude Desktop.
Configuration
All settings are environment variables (.env supported). Sensible defaults mean the
keyless parts (search + fetch) work out of the box.
| Variable | Default | Purpose |
|---|---|---|
DEEPSEEK_API_KEY |
— | DeepSeek API key (required for deep_research) |
DEEPSEEK_BASE_URL |
https://api.deepseek.com |
OpenAI-compatible endpoint |
DEEPSEEK_MODEL |
deepseek-v4-pro |
Synthesis / heavy model |
DEEPSEEK_FAST_MODEL |
deepseek-v4-flash |
Cheap sub-step model |
DEEPSEEK_THINKING |
auto |
auto/on/off — V4 thinking mode for hard steps |
DEEPSEEK_REASONING_EFFORT |
high |
low/medium/high |
VISION_BASE_URL |
— | OpenAI-compatible vision endpoint (any multimodal model) |
VISION_API_KEY |
— | Key for the vision endpoint |
VISION_MODEL |
— | e.g. gpt-4o, qwen-vl-max, glm-4v, a local qwen2.5-vl via Ollama |
SEARCH_PROVIDER |
duckduckgo |
duckduckgo (keyless) / brave / tavily |
TAVILY_API_KEY |
— | Required if SEARCH_PROVIDER=tavily |
BRAVE_API_KEY |
— | Required if SEARCH_PROVIDER=brave (free 2k/mo, more reliable) |
SEARCH_RETRY_ATTEMPTS |
3 |
Retries with backoff when keyless DDG rate-limits |
RESEARCH_BREADTH |
3 |
Sub-queries generated per round |
RESEARCH_DEPTH |
2 |
Research rounds (rounds >1 trigger query refinement) |
RESEARCH_MAX_SOURCES |
8 |
Pages fetched, reranked & synthesised |
RESEARCH_{PLAN,REFINE,RERANK,SYNTH}_MODEL |
"" |
Per-step model override (empty = flash for light steps, pro for synth) |
LOG_LEVEL |
INFO |
Logging verbosity |
deep_research pipeline (v0.2)
deep_research is a smart, multi-round pipeline (DeepSeek-V4 as the brain):
- Plan (V4-flash, JSON) →
breadthsearch queries. - Round loop (
depthrounds): search → fetch → refine — V4-flash reads findings-so-far and generates next-round queries for uncovered facets. - Rerank — V4-flash extracts the passages most relevant to the question from each page (always-on; quality over raw stuffing).
- Synthesize (V4-pro + thinking) → cited markdown report.
Per-step models are tunable; set all RESEARCH_*_MODEL to deepseek-v4-flash
for the cheapest runs. dstools doctor prints a per-research cost estimate.
Vision providers (for analyze_image)
Since DeepSeek-V4 can't see images, point VISION_* at any OpenAI-compatible multimodal model:
- OpenAI:
VISION_BASE_URL=https://api.openai.com/v1,VISION_MODEL=gpt-4o/gpt-4o-mini - Alibaba Qwen-VL (DashScope, OpenAI-compat):
VISION_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1,VISION_MODEL=qwen-vl-max - Zhipu GLM-4V:
VISION_BASE_URL=https://open.bigmodel.cn/api/paas/v4,VISION_MODEL=glm-4v - Local (Ollama):
VISION_BASE_URL=http://localhost:11434/v1,VISION_MODEL=qwen2.5-vl(no key needed)
Without a vision provider, analyze_image degrades to image metadata + OCR (if pytesseract
is installed) and returns a clear note — it never crashes.
Development
uv sync --extra dev
make lint # ruff
make typecheck # mypy
make test # pytest
make serve # run the server (stdio)
Project layout
src/dstools/
server.py # FastMCP server + tool registration
cli.py # `dstools` CLI (serve / inspect / doctor)
config.py # pydantic-settings config
llm/ # DeepSeek (OpenAI-compat) + vision clients, V4 thinking-aware
search/ # pluggable search providers (DuckDuckGo default, Tavily optional)
web/ # async page fetcher + HTML→Markdown extraction
tools/ # image / search / fetch / research tools
utils/ # image I/O & encoding, text chunking
tests/ # pytest suite (network & LLM mocked)
examples/ # claude_desktop_config.json, mcp client demo
License
MIT.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。