Skip to main content

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

dhcckb_ctext_mcp_server-1.0.0.tar.gz (19.0 kB view details)

Uploaded Source

File details

Details for the file dhcckb_ctext_mcp_server-1.0.0.tar.gz.

File metadata

File hashes

Hashes for dhcckb_ctext_mcp_server-1.0.0.tar.gz
Algorithm Hash digest
SHA256 fcbe49d0081ce37bcb24453521e1b53aa3c4d638c54011362a5a1f57faca7fe0
MD5 d13f591bcedf9d3f0310ff21b144fa50
BLAKE2b-256 d33fa392e87dce5b2a8839d5e50e5f0b22e19a38cd57bebb5c12bbe14bf05188

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 Sentry Error logging StatusPage Status page