Skip to main content

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-flash
  • temperature: 采样温度,默认 0.3
  • thinking: 是否开启 reasoning,默认 False
  • max_chunk_chars: 大文本自动分块阈值,默认 8000
  • concurrency: 分块翻译最大并发数,默认 100

超过阈值的大文本会自动分块翻译,优先按 PaddleOCR full.md 中的页面分隔符切分,避免单次请求超时。

返回:翻译后的 Markdown 文本。

translate_md_dir

并发翻译目录下所有 Markdown 文件。

参数:

  • dir_path: 目录路径
  • pattern: 文件匹配模式,默认 *.md
  • model: DeepSeek 模型,默认 deepseek-v4-flash
  • temperature: 采样温度,默认 0.3
  • thinking: 是否开启 reasoning,默认 False
  • concurrency: 最大并发数,默认 100
  • max_chunk_chars: 单个文件内大文本自动分块阈值,默认 8000

行为:

  • 优先翻译 dir_path/pages/ 下的文件;若不存在则翻译 dir_path 根目录文件
  • 对每个匹配文件生成 {stem}_trans.md,放在与源文件相同目录
  • 按文件名排序合并为 dir_path/full_trans.md
  • 返回合并后的文件路径

接入 MCP Host

{
  "mcpServers": {
    "deepseek-translate": {
      "command": "uvx",
      "args": ["deepseek-translate-server"],
      "env": {
        "DEEPSEEK_API_KEY": "your-api-key"
      }
    }
  }
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deepseek_translate_server-0.1.4.tar.gz (63.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deepseek_translate_server-0.1.4-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file deepseek_translate_server-0.1.4.tar.gz.

File metadata

  • Download URL: deepseek_translate_server-0.1.4.tar.gz
  • Upload date:
  • Size: 63.2 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

Hashes for deepseek_translate_server-0.1.4.tar.gz
Algorithm Hash digest
SHA256 1fd3e5f9e4a8e6d31d8932e2b621876712251915cf82b86d50f2d333a34da16b
MD5 e65fdf8b8a9e56bfe3233da8b89d3a05
BLAKE2b-256 17cdc71f6dcedabd98573cc2e03fc19c9cd809820d460bb483307958ce4d33d9

See more details on using hashes here.

File details

Details for the file deepseek_translate_server-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: deepseek_translate_server-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 6.2 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

Hashes for deepseek_translate_server-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3ac195561815d5e85c28e60f2be0fa51a08025ac6d82e748e1b0d783ab6ddd3c
MD5 4023dc895b10281ff79f831eda133bbc
BLAKE2b-256 15444724a6349b3a5f607105f9bf2a167674f86e6c4112b25df0a32d7b0cdc7c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page