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

Uploaded Source

File details

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

File metadata

File hashes

Hashes for dhcckb_ctext_mcp_server-2.1.0.tar.gz
Algorithm Hash digest
SHA256 07e2c2a8a3927ffa6047c0d164051a7aded51c10ce6e3d49dcb52534c04a6749
MD5 c42e5dcc988df80bc7f6942e23709bd0
BLAKE2b-256 0464428c9832614bb456a8ab5fdf4dfda9a1910534a2226f854b250c1c1c0f9f

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