WP Manifestindependent plugin directory
manifest / seo / ks-agent-friendly

KS Agent Friendly

Make your WordPress site readable by AI agents. LLMs.txt, Markdown Mirror, WebMCP tools, Fluent Forms, WooCommerce, and rich AI discovery.

by Konan & Spade · github.com/konanspade/ks-agent-friendly · website

0stars
0forks

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/konanspade/ks-agent-friendly/archive/refs/heads/main.zip

KS Agent Friendly

KS Agent Friendly

Make your WordPress site readable by AI agents.
LLMs.txt • Markdown Mirror • WebMCP • Fluent Forms • WooCommerce • AI Discovery

License PHP 7.4+ WP 7.0


KS Agent Friendly makes your WordPress site accessible to AI agents and large language models. Six modules provide structured content access, form interaction, commerce tools, and standards-based discovery.

Modules

Content Layer

Module What it does
LLMs.txt Serves llms.txt and llms-full.txt at your site root per the llms.txt spec. Auto-generates from published pages or accepts custom content.
Markdown Mirror Every published post/page available as clean Markdown at /md/{slug}/. Converts rendered HTML (Gutenberg, shortcodes, page builders) on the fly with YAML front matter.

Tool Layer

Module What it does
WebMCP Registers structured tools via navigator.modelContext for AI-powered browsers (Chrome 149+, Edge). Falls back to window.afwpTools public API.
Tool Registry Central coordination for all tools. Unified POST /tools/execute endpoint with per-IP rate limiting, nonce protection, and optional Turnstile captcha. Developer API via afwp_register_tools hook.
Fluent Forms When Fluent Forms is active: list_forms, get_form_fields, submit_form tools with optional Cloudflare Turnstile captcha.
WooCommerce When WooCommerce is active: product search, product details, categories (public) + cart management and coupons (nonce-protected).

Discovery Layer

Endpoint Standard
/.well-known/webmcp.json WebMCP manifest
/.well-known/mcp/server-card.json MCP Server Card (SEP-1649)
/.well-known/api-catalog RFC 9727 API Catalog
/.well-known/agent-skills/index.json Agent Skills Index

Plus RFC 8288 Link HTTP headers and <link> HTML tags on every frontend page, and robots.txt directives for LLMs.txt and WebMCP.

Quick Start

  1. Upload the plugin folder to /wp-content/plugins/ and activate in wp-admin
  2. Visit KS Agent Friendly in your admin sidebar
  3. LLMs.txt, Markdown Mirror, and WebMCP work immediately — zero config
  4. Install Fluent Forms or WooCommerce to unlock form and commerce tools

Registered Tools

Content (public, read-only)

Tool Description
search_site Full-text search across published content
get_page Page/post content by URL path or ID
get_site_info Site name, description, language, content types
get_navigation Menu structure with nested links
list_posts Recent posts filtered by category or tag
get_contact_info Site name and URL

Forms (requires Fluent Forms)

Tool Access Description
list_forms Public List published forms with IDs and field counts
get_form_fields Public Field schema for a specific form
submit_form Protected + Turnstile Submit form data with validation

WooCommerce (requires WooCommerce)

Tool Access Description
woo_search_products Public Search by keyword, category, price range
woo_get_product Public Full product details by ID or slug
woo_get_product_categories Public List categories with counts
woo_add_to_cart Protected Add product to cart
woo_get_cart Protected Current cart contents and totals
woo_remove_from_cart Protected Remove item by cart key
woo_apply_coupon Protected Apply a coupon code

REST API

All endpoints under the ks-agent-friendly/v1 namespace.

# List all tools
GET  /wp-json/ks-agent-friendly/v1/tools

# Execute any tool
POST /wp-json/ks-agent-friendly/v1/tools/execute
     {"tool": "search_site", "input": {"query": "hello"}}

# Get a nonce for protected tools (requires login)
GET  /wp-json/ks-agent-friendly/v1/tools/nonce

Individual backward-compatible endpoints also available at /webmcp/search, /webmcp/page, etc.

Developer API

Register custom tools from any plugin or theme:

add_action( 'afwp_register_tools', function( $registry ) {
    $registry->register( 'my_custom_tool', [
        'description' => 'Does something useful.',
        'group'       => 'custom',
        'inputSchema' => [
            'type'       => 'object',
            'properties' => [
                'text' => [
                    'type'        => 'string',
                    'description' => 'Input text to process.',
                ],
            ],
            'required' => [ 'text' ],
        ],
        'callback' => function( $input ) {
            return [ 'result' => strtoupper( $input['text'] ) ];
        },
        'protected' => false,
        'turnstile' => false,
    ] );
} );

Your tool automatically appears in the WebMCP manifest, browser registration, discovery endpoints, and the unified execute endpoint.

Filters

Filter Description
afwp_protected_tools Array of tool names that require nonce authentication

Security

  • Read-only tools are publicly accessible (same data as your public site)
  • Write tools (cart, form submission) require a valid WordPress REST nonce
  • Turnstile captcha optionally protects form submissions via Cloudflare's managed challenge
  • Rate limiting enforces per-IP request limits on the execute endpoint (default: 120 req / 60s)
  • Coexistence guard prevents conflicts if Konan & Spade Helper is active

External Services

This plugin optionally connects to Cloudflare Turnstile for captcha verification on form submissions. When enabled, the Turnstile widget script is loaded from Cloudflare's CDN and verification requests are sent to their API. See Cloudflare's Terms of Service and Privacy Policy.

Architecture

ks-agent-friendly.php          Bootstrap, constants, module registration
includes/
  class-plugin.php             Singleton container, module lifecycle
  class-tool-registry.php      Central tool registry + execute/nonce/settings REST
  class-rate-limiter.php       Per-IP rate limiting with transient counters
  class-admin-page.php         Dedicated admin page with vertical tab nav
  class-module.php             Abstract module base class
  class-html-to-markdown.php   DOMDocument-based HTML to Markdown converter
  modules/
    class-llms-txt-module.php
    class-markdown-mirror-module.php
    class-webmcp-module.php
    class-fluent-forms-module.php
    class-woocommerce-module.php
    class-discovery-module.php
uninstall.php                  Clean removal of all options and transients

Requirements

  • WordPress 7.0+
  • PHP 7.4+
  • Optional: Fluent Forms (for form tools)
  • Optional: WooCommerce (for commerce tools)

License

GPL-2.0-or-later. See LICENSE.


Built by Konan & Spade