Skip to main content
Glama
README.md
# Trados MCP (`trados-mcp`) — `v0.1.0-rc.1`

[![Python Tests](https://github.com/rasitnarcicek/trados-mcp/actions/workflows/python-tests.yml/badge.svg)](https://github.com/rasitnarcicek/trados-mcp/actions/workflows/python-tests.yml)
[![Inventory Validation](https://github.com/rasitnarcicek/trados-mcp/actions/workflows/inventory-validation.yml/badge.svg)](https://github.com/rasitnarcicek/trados-mcp/actions/workflows/inventory-validation.yml)
[![Security Scan](https://github.com/rasitnarcicek/trados-mcp/actions/workflows/security-scan.yml/badge.svg)](https://github.com/rasitnarcicek/trados-mcp/actions/workflows/security-scan.yml)
[![Pre-release](https://img.shields.io/github/v/release/rasitnarcicek/trados-mcp?include_prereleases&label=pre-release)](https://github.com/rasitnarcicek/trados-mcp/releases/tag/v0.1.0-rc.1)
[![License: Apache-2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
[![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue.svg)](pyproject.toml)
[![Trados Studio 19](https://img.shields.io/badge/Trados%20Studio-19%20(verified)-0f766e.svg)](docs/LOCAL_BUILD.md)

Headless, clean-room Model Context Protocol (MCP) server and local Trados Studio C# bridge plugin (`TradosMcpBridge.sdlplugin`) enabling MCP clients (**Claude Desktop**, **Claude Code**, **OpenAI Codex CLI**, **Antigravity**, **Cursor**) to inspect and operate **Trados Studio** through official Trados Studio .NET APIs, alongside offline `.sdlxliff`, `.sdltb`/glossary, and optional mocked Cloud/GroupShare clients.

**Release Versions:** Git tag `v0.1.0-rc.1` | Python PEP 440 `0.1.0rc1` | C# Bridge Assembly `0.1.0.1` (`InformationalVersion: 0.1.0-rc.1`)

---

## RWS / Trados Independence Notice

This project is an independent open-source project licensed under **Apache License 2.0** (`Copyright 2026 MEHMET RAŞİT NARÇİÇEK`). It is **NOT** developed, supported, sponsored, or endorsed by **Trados** or **RWS Group**. Official Trados SDK DLLs, sample projects, termbases (`Printer.ttb`), and proprietary third-party plugin code/licensing systems are **not** included in this repository (see [`NOTICE`](NOTICE)).

---

## Purpose

`trados-mcp` bridges AI coding/translation assistants and an active **Trados Studio** session without brittle UI scripting or direct `.sdlxliff` disk corruption:
- **Default `core` profile = 32** live/unit-verified canonical tools.
- **`all` profile = 149** canonical non-alias tools (`10` duplicate legacy aliases are hidden in all profiles).
- **Pre-write QA protection** on both Python and C# layers prevents dropping placeholders, inline Trados tags, numbers, URLs, Windows paths, and `key=value` entries.

---

## Architecture

```
+-----------------------+       stdio JSON-RPC       +----------------------------+
| MCP Client            | <========================> | Python MCP Server          |
| (Claude/Codex/Cursor/ |   mcp==2.3.0 public API    | (src/trados_mcp/server.py) |
|  Antigravity)         |   Profile filter active    +-------------+--------------+
+-----------------------+                                          |
                                                HTTP 127.0.0.1 + Bearer Token
                                                                   v
+------------------------------------------------------------------+--------------+
| Trados Studio Process (SDLTradosStudio.exe)                                     |
|  - TradosMcpBridge.sdlplugin (ApplicationInitializer, headless, no UI panels)   |
|  - Loopback-only HttpListener (127.0.0.1:<ephemeral_port>)                      |
|  - Per-session 32-byte RNG Bearer token (fixed-time compare, rotates on restart)|
|  - Max request body: 10 MB (413), max concurrency: 4 (503), UI-thread marshal   |
|  - User-only NTFS ACLs: %LOCALAPPDATA%\TradosMcp\{bridge.json, instances\, log} |
+---------------------------------------------------------------------------------+
```

---

## Supported Trados Studio & Runtime Versions

| Component | Status / Requirement |
| :--- | :--- |
| **OS** | Windows 10 / Windows 11 |
| **Trados Studio** | Compiled and live-verified against **Trados Studio 19 (`19.0.1.3110`, API `19.0.0.0`)**. Build scripts detect Studio 17/18/19/20+, though execution outside Studio 19 is unverified. |
| **.NET Framework** | Built-in Windows **.NET Framework 4.8** + Roslyn `Microsoft.Net.Compilers.Toolset 4.11.0` (fetched locally to ignored `plugin/.tools/`) |
| **Python & MCP SDK** | **Python >= 3.10** (tested on `3.13.15`) with pinned **`mcp==2.3.0`** (verified identically in `pyproject.toml` and `requirements.txt`), `httpx>=0.27.0`, `pydantic>=2.0.0` |

### MCP SDK Technical Dependency (`mcp==2.3.0`)

`src/trados_mcp/server.py` avoids private internals (`_tool_manager._tools`) and registers/filters active tools exclusively via public `MCPServer` methods (`mcp.add_tool`, `mcp.remove_tool`, `mcp.list_tools`). At startup, `_verify_mcp_public_api()` enforces `EXPECTED_MCP_VERSION == "2.3.0"` and verifies those public methods are callable, raising an explicit `RuntimeError` with `pip install mcp==2.3.0` instructions on mismatch.

---

## Installation (Source Build Primary Strategy)

Because the C# bridge links against local Trados Studio DLLs and is **not Authenticode-signed**, compiling from source locally is the **primary recommended method** (see [`docs/LOCAL_BUILD.md`](docs/LOCAL_BUILD.md)):

```powershell
git clone <REPO_URL>
cd trados-mcp
python install.py
```

`install.py` (or `setup.bat`):
1. Creates `.venv` and installs exact dependencies from `requirements.txt` (`mcp==2.3.0`, etc.).
2. Compiles strong-named `TradosMcpBridge.dll` and packages `TradosMcpBridge.sdlplugin` + `TradosMcpBridge.sdlplugin.sha256`.
3. Installs into `%APPDATA%\Trados\Trados Studio\<ver>\Plugins\Packages` and `Unpacked\TradosMcpBridge`.
4. Configures detected MCP clients and creates `.bak` config backups.

---

## First Launch & Unsigned Plugin Notice

1. Close any running `SDLTradosStudio.exe` instance (Studio scans plugins only at startup).
2. Start **Trados Studio 19**.
3. On first startup, Studio may show an **Unsigned Third-Party Plug-in Found** confirmation dialog — review and choose **Yes / Allow** (never attempt to bypass Studio's security prompt).
4. Once Studio is open, run `verify_system` from your MCP client to confirm `ready: true`.

---

## MCP Client Configurations

See [`mcp_config.example.json`](mcp_config.example.json). Example for Antigravity / Claude / Cursor:

```json
{
  "mcpServers": {
    "trados-mcp": {
      "command": "C:\\path\\to\\trados-mcp\\.venv\\Scripts\\python.exe",
      "args": ["-m", "trados_mcp.server", "--profile", "core"],
      "env": {
        "PYTHONPATH": "C:\\path\\to\\trados-mcp\\src",
        "TRADOS_MCP_PROFILE": "core"
      }
    }
  }
}
```

---

## Profile System & Default `core` Profile

Precedence order: **CLI `--profile` > `TRADOS_MCP_PROFILE` > default `core`**. Empty/whitespace values fall back cleanly to `core`; case and whitespace are normalized (`CORE , TM, core` -> `core,tm`); unknown profiles raise `ValueError`.

| Profile | Tools | Description |
| :--- | ---: | :--- |
| **`core`** *(default)* | **32** | Verified safe Studio inspection, QA, single/guarded write, `batch_set_targets`, `find_and_replace`, `lookup_term`, comments |
| `editor` | 48 | All canonical editor, segment, filter, comment, revision, bilingual, and QA tools |
| `project` | 25 | Projects, files, `.sdlppx`/`.sdlrpx` packages, PerfectMatch, reports, `run_verification`, batch tasks |
| `tm` | 19 | `.sdltm` create/attach/remove, TMX import/export, TU CRUD, merge, filter search, alignment, `update_tm` |
| `termbase` | 5 | `lookup_term`, `list_terms`, `add_termbase`, `export_termbase_tsv`, `manage_local_glossary` |
| `offline` | 3 | Offline disk `.sdlxliff` read/update/statistics when Studio is closed |
| `cloud` | 26 | Language Cloud & Customer Portal REST tools (**off by default**, `MOCK_ONLY`) |
| `groupshare` | 14 | GroupShare REST (`8 MOCK_ONLY`) & Studio Server actions (`6 COMPILED_ONLY`, **off by default**) |
| `admin` | 10 | `setup_trados_mcp`, multi-instance PID switching, reconnect, diagnostics, `help`, notifications |
| `all` | 149 | All 149 canonical tools (`159` defined minus `10` hidden aliases) |

Full 32-tool list is maintained in [`CORE_TOOLS.md`](CORE_TOOLS.md); the complete 159-tool matrix and 10-alias migration table are in [`tool_inventory.md`](tool_inventory.md) and [`tool_inventory.json`](tool_inventory.json).

---

## Tool Risk Classes

- **`READ`:** Inspection only (`verify_system`, `get_segments`, `check_document`, `lookup_term`, `search_studio_tm`, etc.).
- **`WRITE`:** Modifies segments, comments, projects, or TMs with QA validation and undo metadata (`set_segment_target`, `open_project`, `save_document`, `export_target`, etc.).
- **`DESTRUCTIVE`:** Bulk/deletion tools defaulting to `dry_run=True` and requiring explicit `confirm=True` + `max_changes` caps (`batch_set_targets`, `find_and_replace`, `clear_target`, `delete_tu`, `remove_files`, etc.).

---

## Security Model & Signing Distinction

- **Network & Auth:** Loopback-only (`127.0.0.1`), `IsLocal` check, per-session 32-byte RNG Bearer token, `401` on invalid/missing token, tokens never printed by MCP tools, NTFS user-only ACLs on `%LOCALAPPDATA%\TradosMcp\`.
- **Strong Name vs. Authenticode:** `plugin/build_plugin.ps1` strong-names `TradosMcpBridge.dll` via a local `.snk` (`PublicKeyToken`) solely so Studio's `DefaultPluginTypeLoader` loads the assembly. **Strong naming is NOT a trusted-publisher proof.** Neither the DLL (`NotSigned`) nor `.sdlplugin` carries an X.509 Authenticode signature unless signed with your own certificate. Any binary release ships a `.sdlplugin.sha256` checksum file.

---

## Placeholder & Tag Protection

Segment writes (`set_segment_target`, `update_segments`, `batch_set_targets`, `insert_into_active_segment`, and `find_and_replace`) validate preservation in both Python (`qa_engine.py`) and C# (`TagHelper.cs`, `EditorHandlers.cs`) across `{0}`, `{name}`, `%s`, `%1$d`, `${name}`, `$(name)`, `[NAME]`, `<tag>`, Trados `<t id="..."/>` / `<tp id="...">`, `\n`/`\t`, `key=value`, numbers, URLs, and Windows file paths (verified live across 13+2 cases returning `HTTP 400 QA_VALIDATION_FAILED`).

---

## Test Status, Live Verified Scope & Mock/Compiled Scope

**Important Honesty Disclosure:** Claims that "all 149 tools are verified live" are **false**. Exact breakdown across all 159 defined tools (details in [`live_validation_summary.json`](live_validation_summary.json)):

- **Automated `pytest` suite:** `pytest -v` passes unit QA/offline/SQLite/security tests, dependency & inventory partition tests, stdio MCP E2E, `mcp==2.3.0` exact check, and `call_tool` profile enforcement.
- **Verified Live on Trados Studio 19 (`58` passed + `2` diagnosed):**
  - `REAL_TRADOS_PASSED` (`27`): `create_project`, `open_project`, `go_to_segment`, `set_segment_target`, `update_segments`, `batch_set_targets`, `set_segment_status`, `clear_target`, `save_document`, `find_and_replace`, `apply_display_filter`, `clear_display_filter`, `add_comment`, `update_comment`, `delete_comment`, `analyze_files`, `word_count`, `pretranslate`, `export_target` (`audit_export.html` disk artifact verified), `update_tm`, `update_translation_memory`, `create_tm`, `add_tm`, `add_tm_entry`, `export_tmx`, `remove_tm`, `add_termbase` *(with mapping caveat below)*.
  - `REAL_TRADOS_READ_PASSED` (`30`): Bridge diagnostics, project/file read tools, segment/stat inspection, QA checks, TM concordance, `lookup_term` (`mode='active_segment'` on `Sample Project` `Printer Termbase` -> `photo printer -> Fotodrucker`, `mode='query'` `Save -> Kaydet`).
  - `REAL_TRADOS_DRY_RUN_PASSED` (`1`): `find_replace` (legacy alias; dry-run preview verified).
- **Mock-Only / Compiled-Only / Untested Scope (Not Verified Live):**
  - **Cloud (`26`) & GroupShare (`14`):** Cloud (`26 cloud_*`) and GroupShare REST (`8 gs_*`) are **`MOCK_ONLY`** (`httpx.MockTransport`), and Studio Server actions (`6 server_*`) are **`COMPILED_ONLY`**. **None of the Cloud or GroupShare tools have been tested with real accounts/servers.**
  - Remaining untested C# bridge commands (`39`) are `COMPILED_ONLY`; untested Python helpers (`6`) are `NOT_TESTED`.

---

## Known Limitations

- **`add_termbase` `LanguageIndexMappings`:** `AddTermbaseToProject` attaches `.sdltb` paths without populating `LanguageIndexMappings`; custom newly attached termbases may yield 0 active recognition hits until mapped in Studio. Pre-mapped termbases (e.g., `Sample Project`) recognize terms cleanly.
- **`run_verification` `taskStatus="Failed"`:** `run_verification` lives in `project` / `all` (excluded from `core`). When Studio reports untranslated segments as `Error`-level QA violations, `taskStatus` is `"Failed"` even though the bridge call succeeded (`executionSucceeded: true`). This is a QA result, **not** an MCP connection failure, and returns structured `messages` (`provider`, `severity`, `segmentId`, `sourceText`, `message`) without raising an MCP error.
- **Authenticode Unsigned:** Expect an unsigned plugin prompt in Studio on first install unless you sign the package locally.
- **Studio Single-Instance Lock:** Always close and restart Studio after rebuilding the plugin.

---

## Troubleshooting

- **`verify_system` reports `ready: false`:** Run `.\.venv\Scripts\python.exe -m trados_mcp.installer --check`, verify Studio was restarted after `install.py`, and inspect `%LOCALAPPDATA%\TradosMcp\bridge.log`.
- **MCP fails at startup with `RuntimeError` mentioning `mcp==2.3.0`:** Run `pip install mcp==2.3.0` inside `.venv`.
- **Expected tools hidden in `tools/list`:** Remember default profile is `core` (`32` tools); pass `--profile core,tm,termbase` or `--profile all` in MCP `args` / `TRADOS_MCP_PROFILE`.

---

## Development & Building

- Full local C# plugin build guide: [`docs/LOCAL_BUILD.md`](docs/LOCAL_BUILD.md)
- Contribution & clean-room rules: [`CONTRIBUTING.md`](CONTRIBUTING.md)
- GitHub Actions runs Windows Python tests (`python-tests.yml`), inventory diff checks (`inventory-validation.yml`), and secret/binary scans (`security-scan.yml`). GitHub CI intentionally does **not** compile C# without Trados SDK DLLs.

---

## License & Citation

- **License:** Apache License 2.0 — see [`LICENSE`](LICENSE) and [`NOTICE`](NOTICE).
- **Citation:** See [`CITATION.cff`](CITATION.cff) (`MEHMET RAŞİT NARÇİÇEK`, `trados-mcp`, `v0.1.0-rc.1`).

TDQS

B3.2/5.0

Scored across 32 tools

Disambiguation4/5

Most tools target distinct resources or actions, but several read/QA tools overlap: get_active_segment vs get_segment_context, get_segments vs find_segments, and verify_system vs get_bridge_info/get_trados_version. Descriptions help clarify intended use, but an agent could still choose a redundant path.

Naming Consistency5/5

All tool names use snake_case with a verb_noun or verb_phrase pattern, such as get_active_segment, set_segment_target, check_document, and find_and_replace. Minor variation in prefixes like batch_set and go_to is still consistent and readable.

Tool Count2/5

With 32 tools, the server is well past the 25+ heavy threshold and includes many granular QA/read tools that could be consolidated. The broad Trados bridge scope justifies some breadth, but this surface feels over-scoped rather than tightly curated.

Completeness3/5

Core live-editing workflows are covered: project activation, file/segment access, target edits, QA checks, comments, TM/term lookup, and saving. However get_task_status references a run_task tool that is absent, and comment deletion/update plus bulk status changes are missing, leaving notable gaps.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues