Dual-Native Abilities Bridge
The Agentic Bridge for WordPress. Connects the Dual-Native Data Layer with the Core Abilities API and AI Client SDK.
by Antun Jurkovikj & Contributors · github.com/antunjurkovic-collab/wp-dual-native-abilities
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/antunjurkovic-collab/wp-dual-native-abilities/archive/refs/heads/master.zipThe Agentic Bridge for the WordPress AI Ecosystem.
This plugin demonstrates Composability by wiring together the three critical building blocks of WordPress AI into a unified, safe workflow:
- Data Layer: Dual-Native API (Machine Representation & Safe Writes).
- Logic Layer: Abilities API (Routing & Registration).
- Transport Layer: WP AI Client (LLM Connectivity).
What It Does
When activated, this plugin registers a suite of Core Abilities that allow AI Agents to read, understand, and modify WordPress content safely.
1. The "Eyes" (Read Abilities)
dni/get-post-mr: Fetches the Machine Representation (MR) of a post.- Benefit: Saves ~60% of tokens compared to raw HTML by stripping theme markup.
- Meta: Returns
etag(CID) andlast_modifiedfor caching.
dni/get-post-md: Fetches the Markdown representation of a post.- Format: Pure text/markdown with ETag support.
dni/get-catalog: Returns a lightweight index of content (supportssince,status, andtypesfilters) for efficient discovery.
2. The "Hands" (Write Abilities)
dni/insert-blocks: Performs Atomic Mutations (append, prepend, insert at index).- Safety: Enforces Optimistic Locking via
if_match. If the content changed since the Agent read it, the write fails (412 Precondition Failed) to prevent data loss. - Integrity: Handles server-side block serialization to prevent HTML corruption.
- Safety: Enforces Optimistic Locking via
3. The "Brain" (AI Integration)
dni/ai-suggest: Uses the official WP AI Client SDK to generate summaries and tags.- Fallback: If the SDK is not present, falls back to a deterministic heuristic.
dni/generate-title: AI-powered title generation with safe update.- Safety: Supports
If-Matchfor optimistic locking.
- Safety: Supports
dni/agentic-summarize: The "Super-Ability" reference implementation.- Workflow: Reads MR (Data) → Generates Summary (SDK) → Appends Block (Safe Write).
- Default Safety: Automatically uses current CID for
If-Matchif not provided.
REST Polyfill (Works Today)
If the Abilities API (WordPress 6.9+) is not yet installed on the site, this plugin automatically falls back to exposing these features via standard REST endpoints.
This allows you to build and test Agentic workflows right now on any WordPress site.
Read Endpoints
GET /wp-json/dni-abilities/v1/mr/{id}- Machine Representation (JSON)GET /wp-json/dni-abilities/v1/md/{id}- Markdown representationGET /wp-json/dni-abilities/v1/ai/suggest/{id}- AI suggestions
Caching: /mr and /md return ETag and Last-Modified headers, and honor If-None-Match for 304 responses.
Write Endpoints
POST /wp-json/dni-abilities/v1/insert- Insert blocks (supportsIf-Matchheader)POST /wp-json/dni-abilities/v1/title/generate- Generate and update titlePOST /wp-json/dni-abilities/v1/agentic/summarize- Full summarize workflow
Safety: All write endpoints forward If-Match to the DNI write path and return the current ETag in responses.
Requirements
- Required: Dual-Native API providing
DNI_MRandDNI_CIDclasses (or a compatible Dual-Native provider).- The bridge fails closed if these classes are not available.
- Optional: WordPress AI Client for LLM connectivity.
- Falls back to deterministic heuristics if not present.
- Optional: Abilities API for standard registration.
- Falls back to REST polyfill if not present.
Installation
- Ensure
wp-dual-nativeis installed and active. - Upload this plugin to
wp-content/plugins/wp-dual-native-abilities. - Activate via WordPress Admin.
- (Optional) Configure your LLM Provider in Settings > Dual-Native API or via the AI Client settings.
Permissions
- Read abilities (
dni/get-post-mr,dni/get-post-md): Requireedit_postcapability on the target post. - Catalog (
dni/get-catalog): Requiresedit_postscapability. - Write abilities (
dni/insert-blocks,dni/generate-title,dni/agentic-summarize): Requireedit_post+ REST nonce.
Admin Tools
Access Tools → DNI Agent Console to test abilities locally:
- Status lights for DNI, Abilities API, and AI Client
- Test UI for summarize, insert at index, and safe title generation
- Useful for validating your setup before deploying agents
Official MCP Adapter Integration
This plugin is fully compatible with the WordPress MCP Adapter (v0.3.0+).
When the Abilities API (v0.4.0+) is present, your Dual-Native Abilities are automatically discovered and exposed as MCP tools/resources/prompts with full observability.
Configuration
- Install MCP Adapter: https://github.com/WordPress/mcp-adapter (v0.3.0 or later).
- Install and activate Dual-Native Abilities (this plugin).
- Ensure Abilities API v0.4.0+ is available so abilities are registered.
- Point your MCP client (e.g., Claude/IDE) at the Adapter's HTTP server.
Why use the Official Adapter?
- Observability: unified event name (e.g., mcp.request) with success/failure status.
- Transports: HTTP and STDIO, plus an interface for custom transports.
- Multi-server: run multiple MCP servers with different configs from one site.
- Tooling: validation, permissions, and WP-CLI integration.
Note: For local development without the official adapter, you can still use the Node server in the Dual-Native repo: https://github.com/antunjurkovic-collab/wp-dual-native/tree/master/tools/mcp-server
Usage Example (MCP / Agent)
An Agent using this bridge can perform a safe edit loop:
- Call
dni/get-post-mr→ Get Content + CID (abc123...). - Think → Generate new content.
- Call
dni/insert-blocks→ Passif_match: "abc123...". - Result → Success (200) or Conflict (412).
License: GPL v2 or later