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

Metadata

Release files for dhcckb-ctext-mcp-server 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dhcckb-ctext-mcp-server 2.1.0
File Size Uploaded
dhcckb_ctext_mcp_server-2.1.0.tar.gz 32.1 kB Details

Release files / dhcckb_ctext_mcp_server-2.1.0.tar.gz

Download URL dhcckb_ctext_mcp_server-2.1.0.tar.gz
Size 32.1 kB
Tags Source
SHA-256 checksum
How to use checksums
07e2c2a8a3927ffa6047c0d164051a7aded51c10ce6e3d49dcb52534c04a6749
BLAKE2b-256 checksum
How to use checksums
0464428c9832614bb456a8ab5fdf4dfda9a1910534a2226f854b250c1c1c0f9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Bun/1.3.13

Release history Release notifications | RSS feed

This release

2.1.0 This release

1 release file

2.0.0

1 release file

1.1.0

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page