Black Friday20% off ProPlans →
Back to docs
Step 9 of 13Pro

Connect an AI agent (MCP)

DocxToWP Pro 1.6.0 includes an MCP server. Connect Claude Code, Claude Desktop or Cursor, ask it to write a post, and the post arrives on your site as a properly formatted draft that you review and publish.

What an AI agent can and cannot do

The agent works through four tools, listed below, and every import goes through the same converter as the upload screen: real editor blocks, tables, footnotes, images in the Media Library, categories, tags, Yoast SEO or Rank Math fields, and an Elementor layout if you ask for one.

  • It can create drafts, and check the drafts it created.
  • It cannot publish, schedule, edit, replace or delete any post, read existing posts, or change settings, users, plugins or themes.
  • Nothing goes through docxtowp.com. Your AI app sends the post straight to your own site.
  • No AI credits. You use the Claude or Cursor subscription you already have.

1. Switch the connection on

In WordPress, open DocxToWP Pro → AI Agents (administrators only). On the Connection tab, turn on Allow AI agents with a key to create drafts on this site and click Save changes. It is off until you do, and turning it off again disconnects every app at once.

The same tab shows your Server URL, usually https://your-site.com/wp-json/docxtowp/v1/mcp. Copy it from there: on a site with plain permalinks it looks different.

2. Create a key

On the Keys tab, give the key a name such as “Claude Code on my laptop” and click Create key. The key starts with dwpk_ and is shown once: copy it then.

  • A key acts as you. Drafts it creates are yours, and it can only do what your account can.
  • Make one key per app or computer, so you can revoke one without the others.
  • Revoke stops a key at once. The Keys tab also shows when each key was last used.
  • Treat a key like a password. It is stored on your site only as a fingerprint, so a lost key cannot be shown again: revoke it and make a new one.

3. Connect your app

The Connect apps tab has the set-up for each app with your Server URL and new key filled in. Step by step:

Not supported yet: Claude on the web (claude.ai) and ChatGPT. They connect from their own servers and need a different sign-in, planned for a later version.

4. Ask for a post

The Prompt library tab has six ready-made prompts: SEO Blog Writer, Existing Post Optimizer, DOCX Importer, Markdown Publisher, Product Description Writer and FAQ Content Creator. Replace each [BRACKET] with your own words, copy the prompt, and paste it into your AI app. Each one has the AI check the site first and stop at a draft.

When the AI finishes, it gives you an edit link and a preview link. Open the edit link, check the post, and click Publish when you are happy with it.

The tools

ToolWhat it does
docxtowp_site_infoReads which post types and categories the key's user may use, whether Yoast SEO or Rank Math and Elementor are active, and the size limit. Prompts tell the AI to call this first.
docxtowp_import_markdownTurns a Markdown document into a draft. Options: title, slug, excerpt, post type, categories, tags, SEO title, meta description, focus keyphrase, featured image by link, Elementor layout, the document's own date.
docxtowp_import_docxTurns a Word file into a draft: from a public https link, a Google Docs link shared as “Anyone with the link”, or the file itself sent as base64. Same options. Pictures go to the Media Library.
docxtowp_get_draftThe status, edit link and preview link of a draft the same key created.

A few details that answer most questions:

  • Categories: the AI uses names or ids that already exist. An unknown name is reported, not created, unless the prompt asks for it and your account may create categories.
  • SEO fields are saved only when Yoast SEO or Rank Math is active.
  • Images inside Markdown stay as links, as with a Markdown upload. A featured image by link is downloaded into the Media Library, optimised, and reused if the same picture is already there. A link that cannot be used never stops the import: the draft is created with a warning.
  • Elementor: only for post types Elementor is enabled for; otherwise the draft uses the normal editor and the AI is told why.

Limits and security

  • Each key: 60 requests a minute and 30 imports an hour.
  • Documents and images: your Max File Size setting.
  • Links: public https:// only, on the standard port. Your own server, your private network and cloud metadata addresses are refused, before and after any redirect.
  • Every request re-checks the key, your Pro licence and the user’s DocxToWP permission (Settings → Permissions).
  • On a site without https, keys travel unencrypted: fine on a local test site, not on a live one.

Where to see what happened

  • Posts → Drafts: every import, ready for review.
  • DocxToWP Pro → Activity Log: each AI import is marked “AI agent” with the key name and the kind of document. The document text and links are never stored.

If it does not connect

MessageWhat to do
“A valid DocxToWP connection key is required”Check the key. If it is right, your server is dropping the Authorization header: send the key as X-API-Key: dwpk_… instead.
“The AI agent connection is turned off”Turn it on in DocxToWP Pro → AI Agents → Connection.
“not allowed to use DocxToWP”Add the key owner’s role under DocxToWP Pro → Settings → Permissions.
“DocxToWP Pro is not activated on this site”Activate your licence: see Activate DocxToWP Pro.
“Too many requests”Wait a minute. For imports, the limit is 30 an hour per key.

Still stuck? Email support@docxtowp.com and we will walk you through it.