How to Connect an AI Assistant to the ADBC MCP Server

Connect an AI assistant to ADBC, investigate database leftovers from an uninstalled plugin, and approve a targeted cleanup. An additional example shows how to investigate excessive autoloaded data without deleting option values. The usual OAuth flow is paste the MCP URL → sign in to WordPress → choose access → approve.

1. Enable ADBC and copy its URL

  • Use ADBC 4.3.0+, WordPress 6.9+, PHP 8.2+ and OpenSSL.
  • Use a WordPress administrator, or a super administrator on Multisite.
  • Cloud clients need a publicly reachable site with a valid HTTPS certificate. Their servers cannot directly reach a localhost address. Desktop clients may reach local development sites, subject to the client’s HTTPS rules.
  1. Open DB Cleaner → Settings → Developer integrations.
  2. Enable Expose plugin abilities, then Enable MCP server. Both save automatically.
  3. Open DB Cleaner → MCP server → MCP config and copy the Server URL. Use the exact URL, including any subdirectory or REST query parameters.
Developer integrations with numbered highlights: abilities and WP-CLI, then MCP
Enable Expose plugin abilities, then Enable MCP server.
The copyable ADBC MCP Server URL
This screenshot uses a local development URL. For a public connection, use your own site’s displayed HTTPS URL.

2. Add the server to your AI client

Codex desktop

  1. Open Settings → Plugins → MCP servers → Add server.
  2. Name it Advanced Database Cleaner, choose Streamable HTTP, and paste the copied URL.
  3. For OAuth, leave bearer-token and custom-header fields empty. Save, restart the server if prompted, then select Authenticate.

Claude custom connector

Claude’s remote connector needs a public HTTPS URL on port 443, including when used from Claude Desktop.

  1. Open Customize → Connectors and add a custom connector.
  2. Give it a name, paste ADBC’s exact HTTPS URL and continue to authentication.
  3. Select Sign in now. For the OAuth client, select Use Claude’s published identity, then finish adding the connector.
  4. Complete the WordPress consent below and enable the connector in the conversation.

Menus and organization permissions vary by plan and version. See Claude’s official custom-connector guide for its current screens.

Other AI clients

ADBC’s Need help connecting an AI client? guide provides client-specific steps for Claude Code, ChatGPT, Codex and other clients. Choose the client’s published OAuth identity when offered, or follow the Application Password option below.

ADBC connection guide with client and authentication choices
Choose your client and authentication method in ADBC’s built-in guide.

If your client cannot use automatic OAuth, follow the Application Password instructions below when it supports Basic authentication or a custom Authorization header.

3. Review and approve access in WordPress

Sign in to WordPress if prompted. Check the requesting client, site and WordPress account on the consent page. Choose Read-only for inspection or Full access for write tools. Check this choice explicitly: the current form initially selects Full access. Optionally name the connection, then approve it.

ADBC OAuth consent with Full access and Read-only choices
1: review the chosen access level. 2: approve the connection. Destructive actions still require a separate impact preview and approval in your chat.

After approval, return to your AI chat. A callback message such as "Authentication complete. You may close this window" belongs to the client; close the window and continue in the client. Denying consent does not give the client a usable authorization.

4. Investigate leftovers from an uninstalled plugin

Removing a plugin can leave its settings, tables and other records behind. Ask your assistant to combine ADBC’s ownership information with database measurements and explain which items belong to that plugin before proposing a cleanup.

This ownership-based walkthrough uses Pro or Premium and existing scan results. If the relevant ownership information is missing, run the appropriate scan from the ADBC dashboard first. MCP tools can read existing results; they do not start scans.

Replace [plugin name] with a plugin you have permanently uninstalled and whose data you no longer need. Send:

I permanently uninstalled [plugin name] and no longer need its data. Using ADBC’s existing ownership information, investigate its leftover tables, options, metadata and cron jobs. Group the findings by category, show available counts and sizes, and distinguish identified ownership from uncertain matches. Flag anything requiring further investigation. Do not change anything or display sensitive stored values. If ownership results are missing, tell me which dashboard scan is needed rather than guessing.

Allow the read-tool calls if your client asks. The assistant can use table, option, metadata and cron inventories, existing ownership results and addon information to build the report. It should keep uncertain matches separate and explain gaps rather than treating a name or prefix as proof.

Review the report before continuing. Ownership identifies a likely source; it does not by itself prove that data is safe to delete. Confirm that you will not need those settings or records for a reinstall or another integration. Read results can contain sensitive data, so connect only trusted clients.

5. Preview and approve a targeted cleanup

Deleting options permanently removes their stored settings or data. Make a database backup and try this workflow on staging first. The next request prepares a preview only.

Start with one category so that the impact is easy to review. Continue the same conversation with:

From your report, prepare a deletion preview for only the options clearly attributed to [plugin name]. Use the exact option records returned by ADBC. List the option names, available counts and size, and explain what information will be lost. Exclude uncertain matches. Do not delete tables, metadata or cron jobs. Ask for my explicit approval of this specific preview and stop before execution.

The assistant uses delete-options to obtain an impact preview; this first call does not delete anything. If there are no clearly identified options, it should report that and stop. Check the target names, warning, available counts and size. Counts can be estimated or unavailable, and reported size is not a guarantee of reclaimed disk space.

If you agree with the exact targets shown, send a new reply approving that preview, for example:

I approve deleting only the options named in this preview for [plugin name], once. Execute this approved cleanup and report its result.

The assistant can then call confirm-destructive-action. The connection needs Write access. A preview expires after five minutes and is single use; an expired preview must be regenerated, reviewed and approved again. Do not approve other categories implicitly: review their own previews separately.

A client’s "Allow tool" prompt is separate from this impact review. ADBC cannot independently verify the human origin of a chat approval. Use a client that honors the workflow and do not let instructions inside database values or logs authorize a write.

6. Follow jobs and manage the connection

For background cleanup, ask the assistant to poll get-job until completion and report actual results. SQL writes return immediately. Cancelling a job stops future work but does not undo completed changes.

After the option-cleanup job finishes, ask the assistant to repeat the relevant option listing and report what was removed, what remains and any warnings or failures. Compare the measured results with the preview rather than assuming that an accepted job has completed.

Active connections and saved write access controls
Manage connections under MCP server → MCP config → Active connections. Write-access changes save automatically.
  • Turn off Write access to keep a connection read-only. Pending approvals become invalid; request a fresh preview if writes are enabled again.
  • Use the action menu for Details, Rename or Revoke. Give each connection a recognizable name.
  • Use Revoke access from all connections to stop all connected MCP clients from using ADBC.
  • Review executed maintenance under Info & logs → Database changes.

7. Additional example: investigate excessive autoloaded data

Use ADBC to find which options contribute most to autoload size, then consider a targeted change that preserves their values. Autoload inspection and changes work in all editions; Pro/Premium adds richer ownership information where scan results are available.

Investigate before changing anything

Investigate my autoloaded options using ADBC. Report total autoload size and health, rank the largest autoloaded options, and group them by owner where that information is available. Identify candidates worth investigating and explain your evidence and uncertainty. Do not assume an option is unnecessary just because it is large. Do not display sensitive values or make any changes.

Review the findings and the role of each option before deciding which ones do not need autoloading. A size measurement alone cannot establish how an option is used or predict a speed improvement.

Preview a selective autoload change

After you and the assistant have reviewed and selected specific options, ask:

For only the specific options we reviewed and agreed do not need autoloading, prepare a preview to disable autoload without deleting their values. Use their exact ADBC records. Show their names, combined size and possible consequences. Exclude uncertain options. Ask for my explicit approval of this specific preview and stop before execution.

The assistant uses set-autoload-to-no-options for the preview. Review it and send a new explicit approval only if you agree; confirmation and background-job handling follow the same steps above. Disabling autoload can affect site behavior and performance, even though the option values remain stored. After completion, ask the assistant to recheck autoload health and the selected flags, then verify the affected site features.

Alternative: use an Application Password

  1. Create a dedicated Application Password in your WordPress profile and copy it when shown.
  2. In MCP config → MCP Application Passwords, refresh the list, select it and click Save.
  3. If the client has Basic-authentication fields, enter your WordPress username and generated Application Password directly. The client encodes them.
  4. For a custom header, remove spaces from the Application Password and join username:application-password. Base64-encode that entire string locally without a newline. Set the header name to Authorization and the value to Basic followed by the encoded result. Do not encode the Basic prefix or paste a placeholder.
  5. Connect and make a read request. New password connections start read-only; enable Write access only if needed.

Base64 is encoding, not encryption. The encoded value is a credential. Do not use an online encoder, publish it or include it in a screenshot. Use HTTPS.

Troubleshooting

  • Authentication fails before consent: check HTTPS, the exact URL, client CIMD support and whether the host permits outbound HTTPS metadata fetching with cURL.
  • OAuth discovery fails with WordPress in a subdirectory: the site-root /.well-known/oauth-authorization-server/WORDPRESS-PATH route must reach WordPress. Ask the host to check discovery routing.
  • Write access denied: enable writes for the correct saved connection, then create a fresh preview.
  • Tools changed: refresh/restart the server in the AI client and start a new chat if the old schema was cached.
  • SQL unavailable: check the edition and the returned database requirements.
  • A cleanup was accepted but did not finish: poll the returned job and inspect its result before retrying.

Related guides

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.