=== StifLi Flex MCP - MCP Server with undo for ChatGPT, Claude & Gemini === Contributors: estebandezafra Donate link: https://github.com/estebanstifli/stifli-flex-mcp Tags: mcp, chatgpt, claude, woocommerce ai, ai copilot Requires at least: 5.8 Tested up to: 7.0 Stable tag: 3.3.2 Requires PHP: 7.4 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html The most secure MCP Server for WordPress with Undo, plus AI Copilot & Chat Agent. ChatGPT, Claude, Gemini, OpenRouter & Mistral. == Description == **StifLi Flex MCP** is the most secure MCP Server for WordPress with built-in Undo. Connect AI clients safely (ChatGPT, Claude, Gemini, etc), roll back changes when needed, and manage your site through natural conversation without losing control. Three powerful tools in one plugin: 1. **MCP Server** — Connect ChatGPT, Claude Desktop, or any MCP client directly to your site 2. **AI Copilot** — A floating assistant inside the Gutenberg and Classic editors that writes, rewrites, and optimizes your content in real time 3. **AI Chat Agent** — A full conversational interface to manage posts, WooCommerce, settings, and more **✍️ AI Copilot — Your Writing Assistant Inside the Editor** The AI Copilot lives as a floating widget right inside the WordPress post and page editor. It understands the full context of what you're editing — title, content, categories, tags, featured image, and even WooCommerce product fields — and helps you write better, faster. * **Rewrite, expand, or optimize content** — Ask the Copilot to improve your text and it applies the changes directly into the editor * **One-click quick actions** — "⚡ Optimize content", "🏷️ Generate tags", "📝 Write excerpt", "🖼️ Generate image" — one tap, instant results * **Real-time editing** — The Copilot sets titles, excerpts, tags, slugs, and categories directly in the editor. No copy-pasting * **Content block operations** — Insert, update, replace, or delete Gutenberg blocks through conversation * **Visual feedback** — Changed fields and blocks are highlighted with a green border so you always see what the AI modified * **Keep or Undo** — Every change shows a floating banner: keep it or undo with a single click. You stay in control * **Image generation** — Ask the Copilot to generate an image and it sets it as the featured image or inserts it as a block, automatically * **Works with Gutenberg and Classic Editor** — Full support for both editors * **Context-aware** — The Copilot reads your current post content, blocks, metadata, and editor state to give relevant suggestions * **WooCommerce-aware** — When editing a product, the Copilot sees prices, stock, SKU, attributes, and product type Choose OpenAI (GPT-5.4), Anthropic (Claude 4.6 Opus/Sonnet), or Google (Gemini 3.1 Pro/Flash), and optionally use WordPress AI Client connectors like OpenRouter and Mistral when installed. No complex setup — just your API key or connector credentials. **💡 What Can You Do With the Copilot?** Here are just a few examples of what you can ask while editing a post or page: * ✏️ "Rewrite the introduction to sound more professional and engaging" * 📊 "Add a comparison table below the second paragraph with pros and cons" * 🌍 "Translate the third paragraph into French" * 🔤 "Bold the most important keywords for SEO throughout the article" * 🖼️ "Generate an image that illustrates the idea in paragraph four and insert it right above" * 📝 "Write a compelling meta description and set it as the excerpt" * 🏷️ "Suggest 5 relevant tags based on the content and add them" * 📐 "Split this long paragraph into three shorter ones with subheadings" * 🔗 "Add a call-to-action block at the end with a link to the pricing page" * 💬 "Turn the bullet list into a FAQ block with questions and answers" * 🎨 "Add a custom CSS class to the hero image block for full-width display" * 🛒 "Update the product short description to highlight free shipping and set the sale price to $19.99" The Copilot reads your full content, understands context, and applies changes directly in the editor — no copy-pasting, no switching tabs. **🤖 AI Chat Agent — Your WordPress AI Assistant** The built-in AI Chat Agent gives you a powerful conversational interface to manage your entire WordPress site: * **Talk to your site** — "Show me the last 5 orders", "Create a blog post about SEO tips", "What plugins are installed?" * **Multi-provider** — Built-in OpenAI (GPT-5.4, GPT-5.3), Anthropic (Claude 4.6 Opus/Sonnet, Claude 4.5 Haiku), Google (Gemini 3.1 Pro, Gemini 3 Flash) + optional WordPress AI Client connectors (OpenRouter, Mistral) * **117+ tools at its disposal** — The AI agent can read posts, create content, manage WooCommerce products, check orders, update settings, and much more * **Smart suggestions** — After each response, get contextual follow-up suggestions * **Conversation history** — Auto-saved across sessions with multi-tab support * **Safe by design** — Choose "Always Allow" or "Ask User" mode for tool execution confirmations * **Advanced tuning** — Control temperature, max tokens, top_p, system prompts **💡 What Can You Do With It?** Here are just a few examples of what you can ask your AI agent: * 📝 "Write a 500-word blog post about healthy eating and publish it as draft" * 🛒 "Show me today's WooCommerce orders and their total revenue" * 🔍 "What are the top 10 most commented posts on my site?" * 📊 "List all products with stock below 5 units" * 🏷️ "Create a 20% discount coupon valid for the next 7 days" * 📦 "Update the price of product #123 to $29.99" * 💬 "Show me all pending comments so I can review them" * 🧩 "What plugins are currently active?" * 🎨 "Generate a hero image for my latest blog post about technology" * 🎬 "Create a 5-second promotional video for my new product" The AI agent understands context, chains multiple operations, and works with your site's real data in real time. **🎨 AI Image & Video Generation** Generate stunning images and videos directly from your AI agent or the dedicated Multimedia Settings page: * **Image Generation** — "Generate a hero image for my blog post about AI" using OpenAI (GPT Image family + DALL·E 2/3) or Google Gemini (Gemini Image + Imagen 4) * **Video Generation** — "Create a 5-second product showcase video" using OpenAI Sora or Google Veo 2/3 **🧩 Code Snippet Management — Design and Develop Through Conversation** Create, edit, activate, and manage code snippets on your WordPress site entirely through AI — no manual coding required. Compatible with the three most popular snippet plugins: **WPCode**, **Code Snippets**, and **Woody Code Snippets**. * **Add functionality instantly** — "Add a PHP snippet that redirects users after login based on their role" * **Custom CSS on demand** — "Create a CSS snippet that hides the sidebar on mobile devices" * **JavaScript injection** — "Add a JS snippet that shows a sticky banner with a 10% discount code" * **Full lifecycle management** — List, create, edit, activate, deactivate, and delete snippets from conversation * **Safe by design** — PHP code is sanitized automatically, removing stray `` tags and markdown code fences from AI-generated code * New: Code Snippets v3.x full namespace support — resolves namespaced functions and classes automatically * New: Woody Code Snippets scope mapping — translates locations to Woody's dual scope/location system * Security: Rate limiting (30 requests/minute per IP) on MCP endpoints to prevent abuse * Security: SSRF protection on fetch tool — blocks requests to private/reserved IP ranges (127.x, 10.x, 172.16.x, 192.168.x) * Improved: Snippet tools added to WordPress Full Management profile (auto-migrated for existing installs) = 3.0.1 = * **✍️ AI Copilot — New floating writing assistant for the WordPress editor!** * New: AI Copilot widget available inside the Gutenberg and Classic editors * New: Quick action chips — Optimize content, Generate tags, Write excerpt, Generate image * New: Direct editing — the Copilot sets titles, excerpts, tags, categories, and slugs in the editor * New: Block operations — insert, update, replace, and delete Gutenberg blocks through conversation * New: Visual feedback — green highlight on changed fields and blocks with auto-dismiss * New: Keep/Undo banner on every AI change for full user control * New: Image generation workflow — generate an image and set it as featured or insert as block * New: AI Copilot settings page with enable/disable toggle and tools mode selection * New: Full context awareness — reads post content, blocks, metadata, and WooCommerce product fields = 2.2.2 = * **📊 Token Usage Bars** — Real-time speedometer-style token bars in the AI Chat Agent showing input, output, and cached tokens per interaction. = 2.2.1 = * **🤖 Updated AI Models for All Providers** — Refreshed the full model catalog across OpenAI, Anthropic (Claude), and Google Gemini. * New: OpenAI GPT-5.4 series — GPT-5.4 Pro, GPT-5.4, GPT-5.4 Mini, GPT-5.4 Nano (1M context, Computer Use support) * New: OpenAI GPT-5.3 and GPT-5.3 Mini added as stable production models * New: Anthropic Claude Sonnet 4.6 and Claude Opus 4.6 (1M context, 128K output, Extended Thinking) * New: Anthropic Claude Sonnet 4.5, Claude Opus 4.5, and Claude Haiku 4.5 * New: Google Gemini 3.1 Pro, Gemini 3 Flash, and Gemini 3.1 Flash-Lite (latest generation) * Updated: Google Gemini 2.5 Pro, Flash, and Flash-Lite remain as stable production models * Updated: Default models changed — GPT-5.4 (OpenAI), Claude Sonnet 4.6 (Claude), Gemini 3 Flash (Gemini) * Removed: Deprecated models — GPT-5 Nano, Gemini 2.0 Flash/Flash-Lite, older Claude 3.x aliases = 2.2.0 = * **🆕 AI Image Generation** — Generate images directly from your AI agent using `wp_generate_image`! * **🆕 AI Video Generation** — Generate videos with `wp_generate_video` using cutting-edge AI models! * New: wp_generate_image tool with multi-provider support (OpenAI gpt-image-1, DALL·E 2/3, Google Gemini Imagen 4) * New: wp_generate_video tool with multi-provider support (OpenAI Sora, Google Veo 2/3) * New: Multimedia Settings admin page with dedicated Images and Videos tabs * New: Post-processing options — auto-save generated media to Media Library, auto-insert into posts * New: Configurable default providers, models, image sizes, and quality settings = 2.1.0 = * **🆕 Automation Tasks** — Schedule AI tasks to run automatically on a recurring basis! * **🆕 Event Automations** — Trigger AI workflows when WordPress events occur (new post, new user, etc.) * New: Automation Tasks admin with create, edit, duplicate, delete, and run-now functionality * New: 4 schedule presets (hourly, daily, weekly, monthly) with custom time and timezone support * New: Pre-built automation templates (Daily Sales Report, Trending Article, Weekly Summary, and more) * New: "Detected Tools" mode — AI identifies required tools during test, saves tokens significantly * New: Output actions — Email, Webhook, Draft Post, or Custom Hook * New: Execution Logs tab with full history, token usage, and detailed results * New: Event Automations with WordPress triggers (post published, user registered, comment posted) * New: Conditional logic for event triggers (post type, status, category filters) * New: Dynamic placeholders in prompts (`{{post.title}}`, `{{user.email}}`, etc.) * New: Rate limiting per automation to prevent runaway executions * New: Test mode for event automations — preview AI response with real trigger data * New: Tools count display in AI Chat Agent header with quick configure link * Improved: Cron tasks now execute with proper user permissions (task creator or admin fallback) * Improved: Complete log entry format fixes for database consistency * Improved: Database migration for automation logs table columns * Technical: New tables `wp_sflmcp_automation_tasks`, `wp_sflmcp_automation_logs`, `wp_sflmcp_event_automations`, `wp_sflmcp_event_logs`, `wp_sflmcp_event_triggers` = 2.0.3 = * ** Encrypted API Keys** - API keys are now stored encrypted (AES-256-CBC) in the database for improved security * ** Prompt Caching (Claude)** - Enabled Anthropic prompt caching on system prompt and tools, reducing token usage and latency on repeated requests * ** Provider Usage Logging** - Real-time logging of input/output/cached tokens for Claude, OpenAI, and Gemini * ** Rate Limit Awareness** - Captures and logs rate limit headers from all three providers for better diagnostics on 429 errors * New: Conversation history trimming with configurable "Max Tool Cycles in History" setting to control payload size * New: Smart trim algorithm with safe cut points — never orphans tool_result references * New: API key visibility toggle (eye icon) in chat settings * New: Token estimation utilities (`estimateTokensFromString`, `estimateTokensFromJson`) * Improved: Auto-save on all chat settings (removed manual "Save Settings" button) * Improved: Compact request logging — summaries instead of full body dumps, reducing log noise * Improved: HTTP request layer now returns headers and status code alongside body (`make_request_with_meta`) * Improved: JSON encoding with `JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE` for cleaner payloads = 2.0.2 = * **🆕 WordPress Abilities Integration** (WordPress 6.9+) - Auto-discover and import abilities from other plugins! * New: Abilities tab in admin (appears only on WordPress 6.9+) * New: Discover button to scan all registered abilities from themes/plugins * New: Import, enable/disable, and delete individual abilities * New: Abilities exposed as MCP tools (ability_* prefix) for AI agents * New: Database table wp_sflmcp_abilities for persistent ability storage * Improved: Plugin description updated to reflect 117+ tools * Improved: Admin menu reordered — AI Chat Agent first, MCP Server second * Improved: Renamed "AI Chat" to "AI Chat Agent" across the UI * Technical: Uses wp_get_abilities(), wp_get_ability(), $ability->execute() APIs = 2.0.1 = * **🆕 Built-in AI Chat Client** - Chat with AI directly from your WordPress admin panel! * New: Multi-provider support - OpenAI, Claude (Anthropic), and Google Gemini * New: Support for latest models including GPT-4.5, Claude 4 Opus/Sonnet, Gemini 2.5 Pro/Flash * New: Smart suggestion chips that appear after AI responses * New: Conversation history auto-saved per user (7-day retention) * New: Stop button to cancel AI responses mid-generation * New: Tool permission modes - "Always Allow" or "Ask User" for confirmations * New: Advanced settings tab with temperature, max tokens, top_p, frequency/presence penalty * New: Customizable system prompt for AI behavior * New: Tool display options (Full details, Compact, or Hidden) * New: Multilingual suggestions - AI responds in the same language you use * Improved: Sequential tool execution for better reliability across all providers * Improved: Claude 4.5 model compatibility (temperature/top_p handling) * Improved: Gemini API message format conversion * Fixed: Claude multiple tool_use error handling * Fixed: Gemini "content" vs "parts" API format issue = 1.0.5 = * **New: Custom Tools** - Turn any WordPress plugin into an AI tool! Copy-paste examples included, no coding expertise required. * New: Custom Tools management tab with code editor, enable/disable toggle, and built-in examples * New: Pre-built Custom Tool examples (WooCommerce product lookup, CF7 forms, Yoast SEO, WP Super Cache) * New: Custom Tools support input schemas for structured AI interactions * Improved: All admin styles externalized for WordPress.org compliance * Fix: Resolved object persistence issue in PHP 8.1+ causing 404 errors on API endpoints * Fix: Deferred WooCommerce detection to ensure tools load correctly regardless of plugin load order * Fix: WooCommerce module dispatch now correctly handles tool routing = 1.0.4 = * New: Debug logging system with dedicated log file (wp-content/uploads/sflmcp-logs/) * New: Logs tab in admin UI to enable/disable logging and view debug logs * New: Clear logs and refresh functionality from admin panel * New: "WordPress Full Management" profile now active by default on fresh installs * Security: Log directory protected with .htaccess and index.php = 1.0.3 = * Security: Replaced custom token authentication with WordPress Application Passwords * Security: Removed wp_set_current_user calls for compliance with WordPress.org guidelines * Removed: User management tools (wp_create_user, wp_update_user, wp_delete_user) * Removed: Customer management tools (wc_get_customers, wc_create_customer, wc_update_customer, wc_delete_customer) * Updated: Settings page now guides users to create Application Passwords * Improved: Authentication uses native WordPress security features = 1.0.0 = * Initial public release * 55 WordPress management tools (posts, pages, comments, media, taxonomies, options) * 61 WooCommerce tools (products, orders, coupons, shipping, taxes, webhooks) * Profile-based tool management with 8 predefined profiles * WordPress Application Passwords authentication * JSON-RPC 2.0 compliant REST API endpoint * Server-Sent Events (SSE) support for real-time streaming * Full internationalization support (i18n/l10n ready) * Granular permission control per tool * Profile import/export functionality * Compatible with ChatGPT Custom Connectors, Claude Desktop, LibreChat