WW

woocommerce/wc-mcp-ability

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

6 stars 3 forks 质量 53 趋势 34

WooCommerce MCP and Ability Integration Demo Plugin

概览

This is a demonstration plugin showing how third-party developers can integrate with the WooCommerce MCP (Model Context Protocol) server by registering custom abilities using the WordPress Abilities API. This plugin demonstrates the integration between: - WordPress Abilities API - A standardized way to register capabilities in WordPress - WooCommerce MCP Adapter - Integrating into WooCommerce 10.3 release : The MCP implementation in WooCommerce 10.3 is a . Implementation details, APIs, and integration patterns may change in future releases. This demo is designed to showcase current capabilities and may require updates as the feature matures. The demo creates a custom ability that retrieves WooCommerce store information and statistics, showcasing how external plugins can extend the MCP server's capabilities. - WordPress 6.0 or higher - PHP 8.0 or higher - WooCommerce 10.3+ (includes WordPress Abilities API and MCP Adapter) 1.

README

以下为原文 README 节选,完整内容请查看原文。

WooCommerce MCP Ability Demo Plugin

⚠️ DEMO TOOL - NOT PRODUCTION READY ⚠️

This is a demonstration plugin showing how third-party developers can integrate with the WooCommerce MCP (Model Context Protocol) server by registering custom abilities using the WordPress Abilities API. This plugin is for educational and testing purposes only and should not be used in production environments.

Overview

This plugin demonstrates the integration between:

Important Notice: The MCP implementation in WooCommerce 10.3 is a developer preview. Implementation details, APIs, and integration patterns may change in future releases. This demo is designed to showcase current capabilities and may require updates as the feature matures.

The demo creates a custom ability that retrieves WooCommerce store information and statistics, showcasing how external plugins can extend the MCP server’s capabilities.

Requirements

  • WordPress 6.0 or higher
  • PHP 8.0 or higher
  • WooCommerce 10.3+ (includes WordPress Abilities API and MCP Adapter)

Installation

  1. Clone or download this repository to your WordPress plugins directory:

    cd wp-content/plugins/
    git clone [repository-url] wc-mcp-ability
    
  2. Activate the plugin through the WordPress admin dashboard or WP-CLI:

    wp plugin activate wc-mcp-ability
    

What This Demo Does

The plugin registers a custom ability called woocommerce-demo/store-info that:

Functionality

  • Retrieves basic store information (name, URL, admin email, versions)
  • Optionally includes store statistics (product count, order counts by status, customer count)
  • Demonstrates proper schema definition for inputs and outputs
  • Shows permission handling for MCP abilities

Technical Implementation

  • Ability Registration: Uses wp_register_ability() from the WordPress Abilities API
  • MCP Integration: Implements the woocommerce_mcp_include_ability filter to ensure the ability is exposed through the MCP server
  • Permission Control: Requires manage_woocommerce capability for access
  • Schema Definition: Provides complete JSON schema for both input parameters and output structure

Usage Example

Once installed and the MCP server is running, the ability can be called with:

{
  "ability": "woocommerce-demo/store-info",
  "input": {
    "include_stats": true
  }
}

Sample Response

{
  "store_name": "My WooCommerce Store",
  "store_url": "https://example.com",
  "admin_email": "[email protected]",
  "woocommerce_version": "8.5.0",
  "wordpress_version": "6.4",
  "currency": "USD",
  "country": "US",
  "plugin_source": "WooCommerce Abilities Demo Plugin v1.0.0",
  "stats": {
    "product_count": 150,
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →