ctext-mcp-server
MCP Server for querying standardized English translations of Chinese classical texts via the ctext.org translation corpus.
Features
- search_passage: Multi-stage matching (exact → normalized → fuzzy) of Chinese classical text passages to English translations
- get_translation: Direct lookup by work ID and chapter reference
- list_works: Browse the catalog of available translated works with filtering
- Fuzzy matching engine: Normalizes variant characters, punctuation differences, and missing/extra characters using edit distance + TF-IDF hybrid strategy
- SQLite caching: Local cache with configurable TTL (default 30 days) to reduce API calls
- Multi-translator support: Returns available translators list with default selection
- Dual transport: stdio (Claude Desktop / Claude Code) and streamable HTTP modes
Installation
pip install ctext-mcp-server
Prerequisites
Set your ctext.org API key as an environment variable:
export CTEXT_API_KEY="your_api_key_here"
Optional configuration:
# Custom cache directory (default: ~/.cache/ctext-mcp/)
export CTEXT_CACHE_DIR="/path/to/cache"
# Cache TTL in days (default: 30, set to 0 to disable)
export CTEXT_CACHE_TTL_DAYS=30
Usage
Claude Desktop / Claude Code
Add to your MCP configuration:
{
"mcpServers": {
"ctext": {
"command": "uvx",
"args": ["ctext-mcp-server"],
"env": {
"CTEXT_API_KEY": "your_api_key_here"
}
}
}
}
Standalone HTTP Server
python -m ctext_mcp_server --transport streamable-http --port 8000
Tools
search_passage
Search for English translations of a Chinese classical text passage using multi-stage matching.
get_translation
Retrieve English translation and metadata by work ID and chapter reference.
list_works
List all available Chinese classical works in the ctext.org translation corpus.
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file dhcckb_ctext_mcp_server-2.0.0.tar.gz.
File metadata
- Download URL: dhcckb_ctext_mcp_server-2.0.0.tar.gz
- Upload date:
- Size: 35.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Bun/1.3.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a2ca07de2206004b1647de59f4d689ae88b373e7804fe49f11b8c6625114be0
|
|
| MD5 |
ec932d29fd7d08d917201898d8d9b079
|
|
| BLAKE2b-256 |
fce8d47f6b5ee92ecce316d8ec1fb6777b3f2866b632e54fd94a95e17ece5d2b
|