=== Agentmatica MCP Connector ===
Contributors: cinghaman
Tags: mcp, woocommerce, chatbot, ecommerce, ai
Requires at least: 6.9
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.6.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Free MCP connector for Agentmatica.com. Expose WordPress content and optional WooCommerce tools to Agentmatica visitor chat.

== Description ==

**Agentmatica MCP Connector** is the official, free MCP connector for [Agentmatica](https://agentmatica.com).

Agentmatica is a website visitor agent: it answers from your own pages, captures leads, and can take store actions when you connect tools. This plugin is the WordPress side of that connection. It is **free to install** from the WordPress plugin directory. You do not pay for the plugin.

You need an [Agentmatica account](https://agentmatica.com/signup) to use the chat product. Agentmatica has a **free plan** (no credit card). Paid Agentmatica plans add higher reply limits and extra product features. All plugin code on your site stays available either way.

Developed by [Thought Bulb](https://thoughtbulb.dev).

= What this plugin does =

It runs an MCP (Model Context Protocol) server on your WordPress site so Agentmatica can use documented tools:

* **WordPress content** (always on) — site info, published pages, published posts
* **WooCommerce** (optional, when WooCommerce is installed) — catalog search, in-chat cart, checkout link, order lookup, merchant-gated post-purchase actions, and AI order attribution for Agentmatica Insights

Connect Agentmatica with:

* The UCP MCP endpoint (`/wp-json/agentmatica/v1/ucp/mcp`)
* An integration token (Bearer auth, `amk_wp_` prefix for new tokens)
* No WordPress username or application password

Requires WordPress **6.9 or later** for the Abilities API used by the MCP server.

Setup guide: [WordPress integration docs](https://agentmatica.com/docs/integrations/wordpress)

== External services ==

This plugin is a connector for the [Agentmatica](https://agentmatica.com) service.

* **Service:** Agentmatica visitor chat and agent platform ([terms](https://agentmatica.com/terms), [privacy](https://agentmatica.com/privacy))
* **When data is sent:** Only after you connect this site in Agentmatica (endpoint + integration token), or when a WooCommerce order attributed to Agentmatica is completed
* **Data Agentmatica may read via MCP:** published site content; with WooCommerce, catalog/cart data and (if you enable them) order lookup / post-purchase tools, using the integration token or a logged-in customer token
* **Data this plugin may POST to Agentmatica:** for attributed WooCommerce orders, order id/number, total, currency, shop URL, and conversation id to `https://app.agentmatica.com/api/webhooks/woocommerce/order-attribution` so revenue can appear in Agentmatica Insights
* **Widget:** the chat widget itself is loaded from Agentmatica when you paste the Deploy snippet on your site; this plugin does not inject that widget until you add the snippet

See `PRIVACY.md` in the plugin for local storage details.

== Installation ==

1. Install **Agentmatica MCP Connector** from Plugins → Add New, or upload the zip. Activate it. The plugin is free.
2. Create a free Agentmatica account at [agentmatica.com/signup](https://agentmatica.com/signup) if you do not have one.
3. In WordPress, open **Settings → Agentmatica** and copy the UCP MCP endpoint and integration token.
4. In Agentmatica → Integrations → WordPress, paste the token (and endpoint if asked). You can also use **Detect MCP** after a site crawl.
5. Optional: install WooCommerce for catalog, chat cart, checkout, and post-purchase support.
6. From Agentmatica **Deploy**, copy the WordPress PHP embed snippet onto your theme or a snippet plugin.

== Frequently Asked Questions ==

= Is this plugin free? =

Yes. Installing and using this WordPress plugin is free. Agentmatica.com is a separate product with a free plan and optional paid plans.

= Do I need Agentmatica.com? =

Yes. This plugin is the MCP connector for Agentmatica visitor chat. Without an Agentmatica bot configured with your endpoint and token, the plugin still runs locally but nothing connects to it.

= Do I need the WordPress MCP Adapter plugin? =

No. This plugin ships its own UCP MCP server at `/wp-json/agentmatica/v1/ucp/mcp`.

= Do I need WooCommerce? =

No. WooCommerce enables catalog, cart, checkout, post-purchase support, and order attribution. WordPress content tools work without it.

= Can the chat edit products or orders? =

No, not as a store admin. Only published content, catalog reads, and visitor-scoped cart mutations are exposed by default. Post-purchase order writes (cancel, address update, return request) require a logged-in customer token and merchant-enabled toggles.

= Who develops this plugin? =

[Thought Bulb](https://thoughtbulb.dev) builds and maintains the plugin for Agentmatica.com.

= How do I get support? =

Read [https://agentmatica.com/docs/integrations/wordpress](https://agentmatica.com/docs/integrations/wordpress) or use the WordPress.org support forum for this plugin.

== Screenshots ==

1. Settings → Agentmatica connection page with UCP MCP endpoint and integration token.
2. Integration status and MCP abilities (WooCommerce optional).
3. AI discovery (llms.txt) setting.

== Changelog ==

= 0.6.2 =
* Checkout hand-off links now carry a random single-purpose token instead of the chat session key; the public redirect only accepts that token.
* Registered abilities now require the plugin's Bearer integration token (or an administrator) instead of an always-true permission callback.
* Static llms.txt / .well-known/ucp files are only written on plain-permalink sites, from admin-side events, via the WP_Filesystem API; pretty-permalink sites serve both routes dynamically and no root files are written.

= 0.6.1 =
* WordPress.org listing copy: free MCP connector for Agentmatica.com, Thought Bulb as developer, fuller external-service disclosure.
* Uninstall no longer fatals when cleaning public files (load compatibility classes before route cleanup).

= 0.6.0 =
* Widget parity: persist UCP `__ai_*` cart attributes on chat cart and order meta; push completed orders to Agentmatica for Insights revenue.
* Accept widget session keys (`c_*`) on transient chat carts.
* Customer-token REST route for logged-in Woo shoppers (WISMO + post-purchase writes from embed snippet).
* UCP cart `create_cart` / `update_cart` merge attribution attributes.

= 0.5.1 =
* Add `export_catalog_snapshot` MCP tool for Agentmatica inventory-map generation.

= 0.5.0 =
* WooCommerce post-purchase support on UCP MCP (WISMO + merchant-gated cancel / address / return request).

= 0.4.0 =
* UCP 2026-04-08 MCP at `/wp-json/agentmatica/v1/ucp/mcp`; business profile at `/.well-known/ucp`.

= 0.3.0 =
* Rename plugin package to `agentmatica-wordpress`; modular architecture; `amk_wp_` integration tokens.

== Upgrade Notice ==

= 0.6.2 =
Security hardening for checkout links and ability permissions; static root files only on plain permalinks.
