MCP server for translating Markdown to Chinese via DeepSeek
Project description
deepseek-translate MCP Server
将 Markdown 文本翻译为中文的 MCP server,基于 DeepSeek API。
安装
uv sync
运行
uv run deepseek-translate-server
# 或安装后
uvx deepseek-translate-server
环境变量
DEEPSEEK_API_KEY:必需,DeepSeek API key。
uvx启动时不会自动加载 pdf2md 目录下的.env。需要在 MCP host 配置里通过env传入,或在启动 server 的 shell 环境中 export。
工具
translate_md
翻译单段 Markdown 文本或单个文件。
参数:
text: Markdown 文本(与file_path二选一)file_path: 本地 Markdown 文件路径(与text二选一)model: DeepSeek 模型,默认deepseek-v4-flashtemperature: 采样温度,默认0.3thinking: 是否开启 reasoning,默认Falsemax_chunk_chars: 大文本自动分块阈值,默认8000concurrency: 分块翻译最大并发数,默认100
超过阈值的大文本会自动分块翻译,优先按 PaddleOCR full.md 中的页面分隔符切分,避免单次请求超时。
返回:翻译后的 Markdown 文本。
translate_md_dir
并发翻译目录下所有 Markdown 文件。短目录可直接使用;大批量目录建议用 translate_md_dir_start,避免 MCP Host 前台调用超时。
参数:
dir_path: 目录路径pattern: 文件匹配模式,默认*.mdmodel: DeepSeek 模型,默认deepseek-v4-flashtemperature: 采样温度,默认0.3thinking: 是否开启 reasoning,默认Falseconcurrency: 最大并发数,默认100max_chunk_chars: 单个文件内大文本自动分块阈值,默认8000
行为:
- 优先翻译
dir_path/pages/下的文件;若不存在则翻译dir_path根目录文件 - 对每个匹配文件生成
{stem}_trans.md,放在与源文件相同目录 - 按文件名排序合并为
dir_path/full_trans.md - 返回合并后的文件路径
translate_md_dir_start
启动后台目录翻译任务,立即返回任务状态,适合大文件或多文件翻译。参数与 translate_md_dir 相同。
返回字段包括:
job_id: 后续查询任务状态使用的 IDstatus:queued/running/succeeded/failedtotal: 需要翻译的源文件数completed: 已完成文件数completed_files: 已完成文件名merged_path: 成功后生成的合并译文路径error: 失败原因
translate_job_status
查询 translate_md_dir_start 启动的后台任务。
参数:
job_id: 后台翻译任务 ID
接入 MCP Host
{
"mcpServers": {
"deepseek-translate": {
"command": "uvx",
"args": ["deepseek-translate-server"],
"env": {
"DEEPSEEK_API_KEY": "your-api-key"
}
}
}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file deepseek_translate_server-0.1.8.tar.gz.
File metadata
- Download URL: deepseek_translate_server-0.1.8.tar.gz
- Upload date:
- Size: 65.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62f419c5ea7f604c112ae371870e5589c64374ed12f2166ee3fb43583e7a346a
|
|
| MD5 |
ff267df4a49933e4b7a426218788c2fe
|
|
| BLAKE2b-256 |
c587cb47b6aa469fe45088d47568295dfdd9782960c95bf2b765d033ed62952e
|
File details
Details for the file deepseek_translate_server-0.1.8-py3-none-any.whl.
File metadata
- Download URL: deepseek_translate_server-0.1.8-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7cad55ee1b071864eb426dd22984d9015a6e884a8e22a77a6f64a5cc396d429
|
|
| MD5 |
95577bd4fb38ae9bef57144ba755421e
|
|
| BLAKE2b-256 |
75cb934efaa30a3bf075143d3017665637528035756ac6386ec19b2c33410a5e
|