You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'enableRestApiCrudToolsDescription' => __( '⚠️ EXPERIMENTAL FEATURE: Enable or disable the generic REST API CRUD tools for accessing WordPress endpoints. This is experimental functionality that may change or be removed in future versions. When enabled, all tools that are a rest_alias or have the disabled_by_rest_crud flag will be disabled.', 'wordpress-mcp' ),
if ( empty( $settings['enable_rest_api_crud_tools'] ) ) {
40
+
return;
41
+
}
42
+
43
+
// Example: Register CRUD tools for a custom endpoint '/wp/v2/example'.
44
+
// To use for other endpoints, duplicate and adjust the route/method/name/description as needed.
45
+
46
+
newRegisterMcpTool(
47
+
array(
48
+
'name' => 'list_wordpress_rest_api_endpoints',
49
+
'description' => 'List all available WordPress REST API endpoints and their supported HTTP methods. Use this first to discover what API endpoints are available before making specific calls.',
'description' => 'Get the complete schema and documentation for a specific WordPress REST API endpoint and HTTP method. Use this to understand what parameters are required and available for an endpoint before making calls.',
70
+
'type' => 'read',
71
+
'inputSchema' => array(
72
+
'type' => 'object',
73
+
'properties' => array(
74
+
'route' => array(
75
+
'type' => 'string',
76
+
'description' => 'The REST API route (e.g., "/wp/v2/posts", "/wp/v2/users")'
'description' => 'The HTTP method to get schema for'
82
+
),
83
+
),
84
+
'required' => array( 'route', 'method' ),
85
+
),
86
+
'callback' => array( $this, 'get_tool_details' ),
87
+
'permission_callback' => '__return_true',
88
+
'annotations' => array(
89
+
'title' => 'Get Endpoint Schema',
90
+
'readOnlyHint' => true,
91
+
'openWorldHint' => false,
92
+
),
93
+
)
94
+
);
95
+
96
+
newRegisterMcpTool(
97
+
array(
98
+
'name' => 'call_wordpress_rest_api',
99
+
'description' => 'Make a direct call to any WordPress REST API endpoint. Supports GET (read), POST (create), PATCH (update), and DELETE operations. Use this to interact with WordPress content like posts, pages, users, etc.',
100
+
'type' => 'action',
101
+
'inputSchema' => array(
102
+
'type' => 'object',
103
+
'properties' => array(
104
+
'route' => array(
105
+
'type' => 'string',
106
+
'description' => 'The REST API route (e.g., "/wp/v2/posts", "/wp/v2/users/123")'
Copy file name to clipboardExpand all lines: package.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "wordpress-mcp",
3
-
"version": "0.2.0",
3
+
"version": "0.2.1",
4
4
"description": "A plugin to integrate WordPress with Model Context Protocol (MCP), providing AI-accessible interfaces to WordPress data and functionality through standardized tools, resources, and prompts. Enables AI assistants to interact with posts, users, site settings, and WooCommerce data.",
5
5
"keywords": [
6
6
"wordpress",
@@ -27,7 +27,7 @@
27
27
"lint:js": "wp-scripts lint-js",
28
28
"packages-update": "wp-scripts packages-update",
29
29
"plugin-zip": "wp-scripts plugin-zip",
30
-
"plugin-zip:build": "composer install --no-dev && npm run build && npm run plugin-zip",
30
+
"plugin-zip:build": "composer install --no-dev && pnpm run build && pnpm run plugin-zip",
0 commit comments