220d8cfae8482e158c41a777e4340d4da3fbebeb
translate-mcp
Per-tenant translation MCP. Routes translations to gemini-2.5-flash via LiteLLM,
augmented with per-tenant translation memory, glossary, and tone profile stored in
the shared SmartTranslate Postgres (pgvector).
- Epic: CF-3122
- Scaffold: CF-3123 (this repo)
- Schema migration: CF-3124 (see
sql/001_schema.sql) - Gateway registration: CF-3125
- Claude routing (CLAUDE.md + PreToolUse hook): CF-3126
- Tenant profile seeding from memory: CF-3127
Tools
| Tool | Purpose |
|---|---|
translate(text, tenant, target_lang, source_lang?) |
Main translation call; uses TM + glossary + tone. |
search_tm(query, tenant, target_lang, ...) |
Vector TM lookup. |
upsert_glossary(...) |
Manage per-tenant glossary. |
record_correction(tm_id, corrected_target, tenant) |
Human-in-the-loop correction. |
list_tenants() / get_tenant_profile(tenant) |
Inspect profiles. |
Environment
TRANSLATE_DB_DSN=postgresql://translate_mcp_rw:***@postgres.agiliton.internal:5432/smarttranslate
LITELLM_URL=http://llm:4000
LITELLM_API_KEY=sk-litellm-master-key
TRANSLATE_MODEL=gemini-2.5-flash # override for cost tests
TRANSLATE_EMBED_MODEL=mxbai-embed-large
SENTRY_DSN=... # optional
Run locally (dev)
uv pip install -e .
export TRANSLATE_DB_DSN=postgresql://...
python -m src.server
Deploy
Via LiteLLM MCP gateway: add block in Infrastructure/litellm/config.yaml
(see CF-3125) and agiliton-deploy litellm.
Description
Languages
JavaScript
71.5%
PLpgSQL
27.7%
Dockerfile
0.8%