System administrators

Page tree

TODO verify: translate5 version this feature is available from.

The MCP server lets AI apps like ChatGPT and Claude work with translate5 for a user: translate texts and files, create projects, read status and statistics. This page is for administrators: how to activate it, how AI apps log in, and which options and rights exist. How users work with it is described on the user page AI apps: work with translate5 from ChatGPT, Claude and other AI apps (MCP).

Paid plug-in

The MCP server is the plug-in “Mcp”. It is not part of the open source core of translate5.

Requirements and activation

  • translate5 is reachable over HTTPS. The apps of ChatGPT and Claude connect from the servers of their provider, so the address must be reachable from the internet.
  • The address of the instance is set correctly in runtimeOptions.server.name.
  • The plug-in is active.
Activate the plug-in
t5 plugin:enable Mcp

Server address

AI apps connect to https://<address of translate5>/editor/mcp. Administrators find the address ready to copy in “Preferences” > “AI apps” > “Start”.

  • The MCP server only answers on the main address of the instance and on the domains set for clients (“Clients” > “General” > “Website address (domain only)”). A request with any other host name gets the answer 403 “Invalid Host header”.
  • An AI app stays on the address it connected to: the login, the token renewal and the uploads use the same address.

How AI apps log in

AI apps log in with the translate5 login of the user (OAuth 2.1 with PKCE). No password or token is typed into the AI app.

  1. The user adds the server address in the AI app.
  2. The app opens a browser page of translate5. The user logs in there with the normal translate5 login, or with the single sign-on of the client (see below).
  3. The page “Connect <app> to translate5” names the app and the user. The user clicks “Allow”.
  4. The app gets an access token that is valid for one hour and renews it in the background.

  • Allowed apps. Only the apps listed in runtimeOptions.plugins.Mcp.oauthAllowedClients can log in. Each app is given by the URL of its client metadata document. ChatGPT and Claude (web, desktop and coding apps) are allowed by default. Remove an entry to block an app, its connections end at their next renewal.
  • Rights. The AI app works as the user. Every action runs with the rights and the client restrictions of this user, the same as in the translate5 UI and the REST API.
  • Every renewal confirms the user. translate5 checks at each renewal that the user still exists and may use the MCP server. A deleted user loses the connection at once.
  • Lifetime. A confirmed connection goes on and ends when the app does not use it for 30 days (oauthConnectionIdleDays).

Single sign-on

If a client logs in with OpenID Connect, its users connect the AI app with the domain of the client as server address. The login of the AI app then goes to the identity provider of this client, the same way as the translate5 login. A user who is already signed in at the company only clicks “Allow”.

Add the redirect URI at the identity provider

The identity provider must accept an additional redirect URI for the login of AI apps: https://<domain of the client>/editor/mcp/oauth/sso. You find it ready to copy in “Clients” > “OpenID Connect” > “Redirect URI for AI apps”. Add it to the app registration of the identity provider, next to the one of the translate5 login. Without it the login of the AI app stops at the identity provider with a redirect URI error.

Situation

What happens

The user is still valid at the identity provider

translate5 asks the identity provider at every token renewal (about once per hour of use) and updates the roles and clients of the user like on a login. The connection goes on, the user does not log in again.

The user was disabled at the identity provider, or the roles sent no longer allow a translate5 login

The connection ends at the next renewal. Event E1851 is written to the system log.

The identity provider cannot be asked: it is not reachable, hands out no lasting refresh token, or asking is turned off

The connection goes on for at most 24 hours (oauthConnectionLifetimeHours), then the user connects again.

  • To ask the identity provider, the login of the AI app requests the scope offline_access. The identity provider must allow this scope for translate5.
  • If the identity provider refuses the login because of the scope, turn off runtimeOptions.plugins.Mcp.oauthAskIdentityProvider. Connections then end after the 24 hours named above.
  • The single sign-on of AI apps only works over HTTPS and on the domain of the client. On the main address of the instance the translate5 login is used, unless the main address has a single sign-on itself.

TODO verify: test run against Microsoft Entra ID (redirect URI, scope offline_access, disabled user) before this section is published.

Agents with an application token

Scripts and agents that cannot do the browser login can use an application token of translate5 instead. They send it with every request to the MCP server in the header Translate5AuthToken. The same rights apply as for the user the token belongs to.

Configuration options

Option (name in the UI)

Default

Can be set for

Description

runtimeOptions.plugins.Mcp.oauthAllowedClients (MCP: AI apps allowed to log in)

ChatGPT and Claude

instance

AI apps that may connect with the translate5 login, each given by the URL of its client metadata document. Remove an entry to block the app.

runtimeOptions.plugins.Mcp.oauthConnectionIdleDays (MCP: AI app login ends when unused (days))

30

instance

Days after which a connection ends when the app does not use it. As long as the app is used and the user is confirmed, the connection goes on.

runtimeOptions.plugins.Mcp.oauthAskIdentityProvider (MCP: ask the identity provider whether the user is still valid)

enabled

instance

For connections made with single sign-on: translate5 asks the identity provider at every token renewal and updates the roles of the user. Needs the scope offline_access.

runtimeOptions.plugins.Mcp.oauthConnectionLifetimeHours (MCP: AI app login lifetime without confirmation (hours))

24

instance

Hours a connection goes on when the identity provider cannot be asked. After that the user logs in again in the AI app.

runtimeOptions.plugins.Mcp.logRetentionDays (MCP: log retention (days))

365

instance

Days the entries of the activity log are kept.

runtimeOptions.plugins.Mcp.uploadMaxSizeMb (MCP: maximum upload size (MB))

50

system

Maximum size of a file uploaded for AI apps. The PHP upload limits of the server apply additionally.

runtimeOptions.plugins.Mcp.uploadTtlHours (MCP: upload lifetime (hours))

24

system

Hours an uploaded file is kept before it is deleted, if no project used it.

Options of the instance are changed in “Preferences” > “System configuration”, search for MCP:. Options of the system are not shown there, change them on the command line:

Change a system option
t5 config runtimeOptions.plugins.Mcp.uploadMaxSizeMb 100

Access rights

What

Right

Default roles

Connect an AI app and use the MCP server

editor_plugins_mcp_mcp / index

Every user (basic)

See the area “AI apps” in the preferences

frontend / pluginMcpAiApps

admin

Edit the playbook

editor_plugins_mcp_playbook

admin

Read the activity log

editor_plugins_mcp_log

admin

List and end connections through the REST API (own connections, administrators all)

editor_plugins_mcp_oauth / connections

admin, pm, clientpm, api

To keep a group of users away from the MCP server, remove the right editor_plugins_mcp_mcp / index from their role. This is a change in the database of the installation.

Actions (tools) and the roles that get them

The MCP server offers an AI app only the actions the connected user has the translate5 rights for. The table shows the default roles.

Action

What it does

Changes data

Default roles

list_customers

Lists the clients the user may see, with their descriptions and the playbook for all clients.

NO

Every user

get_instructions

Returns the playbook and the process of one client.

NO

Every user

upload_files

Opens the upload window in the chat (only in apps that show windows).

NO

Every user

get_upload_url

Returns an address an agent uploads a file to.

NO

Every user

list_uploaded_files

Lists the files the user uploaded.

NO

Every user

read_document

Returns the beginning of the text of a document.

NO

Every user

translate_text

Translates a text with the language resources of a client.

NO

InstantTranslate

translate_file

Translates a file with the language resources of a client.

YES

InstantTranslate

list_file_translations

Lists the file translations of the user and their status.

NO

InstantTranslate

get_file_translation

Returns a translated file as download link.

NO

InstantTranslate

save_translation_to_tm

Saves a translation to the translation memory.

YES

InstantTranslate write to TM

get_revision_quote

Returns price and date of a revision by a person.

NO

InstantTranslate human revision allowed

send_to_human_revision

Orders the revision of a file translation.

YES

InstantTranslate human revision allowed

create_project

Creates a project with its tasks and starts the import.

YES

PM, PM (selected clients), Admin

list_projects

Lists projects.

NO

PM, PM (selected clients), Admin

get_project_status

Returns the status of a project and its tasks.

NO

PM, PM (selected clients), Admin

get_project_files

Returns the translated files of a project as download links.

NO

PM, PM (selected clients), Admin

list_open_jobs

Lists open jobs of users.

NO

PM, PM (selected clients), Admin

list_resource_types

Lists the kinds of language resources that can be created.

NO

PM, PM (selected clients), Admin

list_language_resources

Lists language resources.

NO

PM, PM (selected clients), Admin

create_language_resource

Creates a language resource.

YES

PM, PM (selected clients), Admin

set_customer_defaults

Sets the default clients of a language resource.

YES

PM, PM (selected clients), Admin

get_translation_statistics

Returns post-editing statistics of finished tasks.

NO

PM, PM (selected clients), Admin

summarize_logs, search_logs, get_log_entry

Read the event log of tasks, and the system log for users who may see it.

NO

PM, PM (selected clients), Admin

Secrets in logs

The log actions hand log entries to the AI app, and with it to the provider of the AI. Passwords, tokens and other credentials in the entries are masked before. Names and e-mail addresses of users are not masked.

Playbook, connections and activity log

Administrators steer and watch the AI apps in “Preferences” > “AI apps”. The user page AI apps: work with translate5 from ChatGPT, Claude and other AI apps (MCP) describes the tabs “Playbook”, “Connected apps” and “Activity”.

Connections can also be listed and ended on the command line:

Connections on the command line
t5 mcp:connections:list
t5 mcp:connections:list --user <login>
t5 mcp:connections:revoke <id>

Addresses

Address

Used for

/editor/mcp

The MCP server (Streamable HTTP). Without a token it answers with the login challenge for AI apps.

/.well-known/oauth-protected-resource/editor/mcp, /.well-known/oauth-authorization-server

Discovery of the login for AI apps.

/editor/mcp/oauth/authorize

Browser page of the login and of the “Allow” button.

/editor/mcp/oauth/sso

Return address of the identity provider after the single sign-on of an AI app login.

/editor/mcp/oauth/token

Token exchange and renewal by the AI app.

/editor/mcp/upload

Upload of files for AI apps, with an upload ticket or a token.

/editor/mcp/download

Download of translated files with a single use ticket.

Good to know

  • Files uploaded for AI apps are kept in data/McpUploads and deleted by the periodical cron job after the upload lifetime.
  • Upload addresses and download links work once and for 15 minutes.
  • A document dropped into the chat of an AI app is processed by the provider of the AI before translate5 is involved. The same is true for everything the actions return to the app, for example segments, names of projects and log entries.
  • The playbook guides the AI, it does not enforce anything. Binding rules belong into the workflow and the defaults of the client.

Code

Meaning

E1807

The upload directory could not be created. Check that the data directory exists and is writable.

E1808

An uploaded file could not be moved into the upload directory. Check write permissions and free disk space.

E1809

PHP rejected a file upload for a server side reason, the message names it.

E1850

A replaced refresh token was used again, the connection of the AI app was ended. The token may have been copied. The user connects the app again.

E1851

The identity provider does not confirm the user any longer, the connection was ended. If this happens to all users of a client, check its OpenID settings and the scope offline_access.

Troubleshooting

Problem

What to do

The AI app cannot connect, the server answers 403 “Invalid Host header”

The app uses an address that is neither the main address (runtimeOptions.server.name) nor the domain of a client. Use one of these addresses.

The login of the AI app stops at the identity provider with a redirect URI error

Add the “Redirect URI for AI apps” of the client to the app registration of the identity provider.

The login page says that the AI app is not allowed

Add the client metadata URL of the app to oauthAllowedClients.

Users of a client with single sign-on have to connect again every day

The identity provider hands out no lasting refresh token or does not allow the scope offline_access. Allow it for translate5 at the identity provider.

An AI app does not offer an action

The connected user lacks the rights for it, see the table of actions above.

  • No labels