MCP integration (developers)
Connect Cursor or other MCP clients to translate content via the secured /mcp endpoint.
Prerequisites
- Plugin activated with Post name permalinks
- At least one non-default language enabled under Languages
- An OAuth client from MCP Clients (Client ID + Client Secret), or a legacy bearer token from OAuth Settings
Endpoint
POST https://your-site.example/mcp
Authorization: Bearer <your-token>
Content-Type: application/jsonDiscovery metadata:
/.well-known/oauth-authorization-server/.well-known/oauth-protected-resource
Available tools
| Tool | Scope | Purpose |
|---|---|---|
get_site_info | read:site | Site name, URL, languages |
get_languages | read:site | Language config |
get_translation_stats | read:content | Translation progress (total / translated / untranslated) |
list_strings | read:content | List registry items with filters and pagination |
sync_post_content | read:content | Register Gutenberg/classic strings from a post |
update_strings | write:translations | Save translations in bulk |
Typical workflow (single post)
sync_post_contentwith{ "post_id": 42 }list_stringswith{ "language": "en", "post_id": 42, "item_type": "block" }update_stringswith translated values:
{
"language": "en",
"status": "published",
"items": [
{ "item_key": "block:42:0:innerHTML", "value": "Welcome to our clinic" }
]
}- 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
{ "language": "en" }Call get_translation_stats. Response includes total, translated, untranslated, and by_type (per block, meta, url, etc.).
2. Fetch the next batch
{
"language": "en",
"translation_status": "untranslated",
"minimal": true,
"limit": 50,
"offset": 0
}Call list_strings. Each response includes:
| Field | Meaning |
|---|---|
pagination.total | Matching rows across all pages |
pagination.has_more | More pages available |
pagination.next_offset | Pass as offset for the next batch |
strings | Source 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
- WP Clinic Translator → MCP Clients → Create OAuth client — copy Client ID and Client Secret.
- Add a remote MCP server in Cursor pointing to
https://your-site.example/mcp. - 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).
- In ChatGPT, add a connector with:
- MCP Server URL:
https://your-site.example/mcp - Authentication: OAuth (CIMD or manual client)
- MCP Server URL:
- 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. - Sign in as a WordPress administrator and approve the requested scopes on the consent screen.
Optional manual client (DCR or pre-registered):
- MCP Clients → Create OAuth client with redirect URI
https://chatgpt.com/connector_platform_oauth_redirect - 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.