Problem
The MCP server currently only supports post_type = 'post'. The WordPress REST API endpoint GET /wp/v2/posts/{id} returns a 404 for pages and custom post types — each post type has its own controller and endpoint (e.g., /wp/v2/pages/ for pages).
This means wp_open_post fails for pages, WooCommerce products, or any custom post type that uses the block editor.
Affected areas
MCP server (src/wordpress/api-client.ts)
getPost(), updatePost(), listPosts() all hardcode /wp/v2/posts
- Need to resolve the correct REST base for a given post type (e.g.,
/wp/v2/pages for page)
WordPress plugin
getEntityRecord('postType', 'post', id) in ConnectionStatus hardcodes the post type when looking up titles for "Editing: ..." display
- Command
post_id doesn't include the post type, so the plugin can't resolve the correct entity
MCP tools
wp_open_post / wp_list_posts / wp_create_post should accept a post type parameter (defaulting to post)
wp_read_post output should indicate the post type
Sync protocol
- The Yjs room format is already post-type-aware:
postType/{type}:{id} — this should work as-is
Approach
- During
connect(), fetch available post types from GET /wp/v2/types to build a map of post_type → rest_base
- Add an optional
postType parameter to wp_open_post, wp_list_posts, wp_create_post (default: post)
- Use the resolved
rest_base for all REST API calls on the opened post
- Include
post_type in the command REST response so the plugin can resolve entity records correctly
Problem
The MCP server currently only supports
post_type = 'post'. The WordPress REST API endpointGET /wp/v2/posts/{id}returns a 404 for pages and custom post types — each post type has its own controller and endpoint (e.g.,/wp/v2/pages/for pages).This means
wp_open_postfails for pages, WooCommerce products, or any custom post type that uses the block editor.Affected areas
MCP server (
src/wordpress/api-client.ts)getPost(),updatePost(),listPosts()all hardcode/wp/v2/posts/wp/v2/pagesforpage)WordPress plugin
getEntityRecord('postType', 'post', id)inConnectionStatushardcodes theposttype when looking up titles for "Editing: ..." displaypost_iddoesn't include the post type, so the plugin can't resolve the correct entityMCP tools
wp_open_post/wp_list_posts/wp_create_postshould accept a post type parameter (defaulting topost)wp_read_postoutput should indicate the post typeSync protocol
postType/{type}:{id}— this should work as-isApproach
connect(), fetch available post types fromGET /wp/v2/typesto build a map ofpost_type → rest_basepostTypeparameter towp_open_post,wp_list_posts,wp_create_post(default:post)rest_basefor all REST API calls on the opened postpost_typein the command REST response so the plugin can resolve entity records correctly