How deepl/deepl-mcp-server works
deepl-mcp-server is a stdio MCP server that exposes DeepL translation, document translation, rephrasing, language discovery, glossary lookup, and style-rule lookup. An MCP client invokes registered tools; handlers normalize inputs, call the DeepL client or local language utilities, and format results as MCP text content. Document translation uses local file paths and returns the output path. The architecture is based on the README and sampled source; individual DeepL SDK internals are not shown.
Main entry points: handlers.mjs Tool handlers · index.mjs DeepL client · tools.mjs Tool registry · languages.mjs Language cache
Components 16
MCP runtime
- stdio transport
src/index.mjs - MCP server
src/index.mjs - Tool registry
src/tools.mjs
Translation operations
- Tool handlers
src/handlers.mjs - Text translation
src/handlers.mjs - Document translation
src/handlers.mjs - Text rephrasing
src/handlers.mjs - DeepL client
src/index.mjs
Language and resource lookup
- Language cache
src/languages.mjs - Language lists
src/languages.mjs - Glossary and style lookup
src/handlers.mjs
Shared utilities
- MCP text formatting
src/content.mjs - Writing options
src/writing.mjs
Other components
- MCP client
- DeepL API
- Local documents
Connections 18
- MCP client → stdio transport: sends requests
- stdio transport → MCP server: carries messages
- MCP server → Tool registry: routes tool calls
- MCP server → stdio transport: connects transport
- Tool registry → Tool handlers: registers callbacks
- Tool handlers → Text translation: handles requests
- Tool handlers → Document translation: handles requests
- Tool handlers → Text rephrasing: handles requests
- Tool handlers → Glossary and style lookup: handles requests
- Tool handlers → Language cache: gets languages
- Tool handlers → DeepL client: calls API methods
- DeepL client → DeepL API: sends API requests
- Tool handlers → Local documents: passes file paths
- DeepL client → Local documents: reads and writes
- Language cache → Language lists: creates and caches
- Language lists → DeepL client: fetches languages
- Tool handlers → MCP text formatting: formats responses
- Tool registry → Writing options: uses option enums