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.1.0.tar.gz (37.6 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for dhcckb_ctext_mcp_server-1.1.0.tar.gz
Algorithm Hash digest
SHA256 9c4f1280de183853a4bb53e129ac8a58074add9bdb16456339b53441d76c1a9d
MD5 0b566477077403635f60d96f115503a0
BLAKE2b-256 0735052d72dd0e778c046f48da713529cddb4e1baac69ea8a6bfc5af983788a9

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