Skip to content

MCP integration (developers)

Connect Cursor or other MCP clients to translate content via the secured /mcp endpoint.

Prerequisites

  1. Plugin activated with Post name permalinks
  2. At least one non-default language enabled under Languages
  3. An OAuth client from MCP Clients (Client ID + Client Secret), or a legacy bearer token from OAuth Settings

Endpoint

text
POST https://your-site.example/mcp
Authorization: Bearer <your-token>
Content-Type: application/json

Discovery metadata:

  • /.well-known/oauth-authorization-server
  • /.well-known/oauth-protected-resource

Available tools

ToolScopePurpose
get_site_inforead:siteSite name, URL, languages
get_languagesread:siteLanguage config
get_translation_statsread:contentTranslation progress (total / translated / untranslated)
list_stringsread:contentList registry items with filters and pagination
sync_post_contentread:contentRegister Gutenberg/classic strings from a post
update_stringswrite:translationsSave translations in bulk

Typical workflow (single post)

  1. sync_post_content with { "post_id": 42 }
  2. list_strings with { "language": "en", "post_id": 42, "item_type": "block" }
  3. update_strings with translated values:
json
{
  "language": "en",
  "status": "published",
  "items": [
    { "item_key": "block:42:0:innerHTML", "value": "Welcome to our clinic" }
  ]
}
  1. Preview the page at /en/your-page/

Bulk workflow (untranslated items)

Use this to work through the backlog in AI-sized batches.

1. Check progress

json
{ "language": "en" }

Call get_translation_stats. Response includes total, translated, untranslated, and by_type (per block, meta, url, etc.).

2. Fetch the next batch

json
{
  "language": "en",
  "translation_status": "untranslated",
  "minimal": true,
  "limit": 50,
  "offset": 0
}

Call list_strings. Each response includes:

FieldMeaning
pagination.totalMatching rows across all pages
pagination.has_moreMore pages available
pagination.next_offsetPass as offset for the next batch
stringsSource text to translate (item_key, source_value, …)

Optional filters: item_type, post_id, search.

Recommended batch size: 25–75 items per call (limit). Default is 50 when translation_status is untranslated.

3. Save translations

Pass translated values to update_strings (same as single-post workflow).

4. Repeat

Increment offset using pagination.next_offset until has_more is false, or re-run get_translation_stats to confirm progress.

Cursor configuration

  1. WP Clinic Translator → MCP Clients → Create OAuth client — copy Client ID and Client Secret.
  2. Add a remote MCP server in Cursor pointing to https://your-site.example/mcp.
  3. Use OAuth connect with the discovery URL https://your-site.example/.well-known/oauth-authorization-server, your Client ID, and Client Secret.

For quick local testing you can still use OAuth Settings → Generate MCP access token (legacy bearer token).

ChatGPT configuration

ChatGPT connectors use Client ID Metadata Documents (CIMD) — no manual OAuth client is required when CIMD is enabled (default).

  1. In ChatGPT, add a connector with:
    • MCP Server URL: https://your-site.example/mcp
    • Authentication: OAuth (CIMD or manual client)
  2. ChatGPT redirects to https://chatgpt.com/connector_platform_oauth_redirect (or a connector-specific URL shown in the app settings). These callbacks are allowed by default.
  3. Sign in as a WordPress administrator and approve the requested scopes on the consent screen.

Optional manual client (DCR or pre-registered):

  1. MCP Clients → Create OAuth client with redirect URI https://chatgpt.com/connector_platform_oauth_redirect
  2. Enter Client ID and Client Secret in ChatGPT if not using CIMD.

Discovery metadata advertises client_id_metadata_document_supported: true and accepts none (PKCE) and private_key_jwt token authentication for CIMD clients.

Audit log

Every MCP tool call is stored in the plugin audit log table for security review.

WP Clinic Translator