Skip to content

juanma-wp/test-stream-abilities-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Test Stream Abilities API

A minimal WordPress plugin used to exercise the Abilities API and the WordPress MCP adapter. It registers a sample ability (my-plugin/get-site-info) and then calls it from an editor-side script.

What this plugin does

  • Registers a category site-information.
  • Registers an ability my-plugin/get-site-info with an empty input schema and a simple object output (name, description, url). See plugin.php.
  • Enqueues index.js in the block editor, which:
    • Lists available abilities via wp.abilities.getAbilities()
    • Executes my-plugin/get-site-info via wp.abilities.executeAbility()

Prerequisites

MCP configuration used

Cursor MCP client configuration (/Users/juanmanuelgarrido/.cursor/mcp.json):

{
  "mcpServers": {
    "wordpress": {
      "command": "npx",
      "args": ["-y", "@automattic/mcp-wordpress-remote"],
      "env": {
        "NODE_TLS_REJECT_UNAUTHORIZED": "0",
        "WP_API_URL": "http://getting-started-block-development.local/wp-json/mcp/mcp-adapter-default-server",
        "WP_API_USERNAME": "admin",
        "WP_API_PASSWORD": "CXLe 7z03 kgyW CR9D DOhf kvYG",
        "LOG_FILE": "/Users/juanmanuelgarrido/Local Sites/getting-started-block-development/app/public/wp-content/mcp-debug.log"
      }
    },
  }
}

How to run

  1. Activate this plugin along with Abilities API and MCP Adapter.
  2. Open the admin; check the browser console. You should see logs from index.js:
    • The number of abilities
    • Each ability’s name/description
    • The output of my-plugin/get-site-info (site name, description, URL)

Files

  • plugin.php: registers the category and ability; enqueues script.
  • index.js: logs abilities and executes the sample ability.

About

A minimal WordPress plugin used to exercise the Abilities API and the WordPress MCP adapter.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published