Skip to content

Use MCP

OG AI Core has two MCP servers. The admin server (/wp-json/mcp/v1/http) is the one you extend. The Public MCP server (/wp-json/ogaie-public/v1/mcp) has a fixed, read-only tool list.

Add your own tools

The ogaie_mcp_tools filter receives the list of base tools and returns the list to expose. Each tool has a name, description and input schema.

Handle the call in ogaie_mcp_callback. It receives null, the tool name, the arguments, the request ID and the server. Return a result for your own tools and leave the value alone for the rest. The call runs as the connected user, so check capabilities.

Abilities API

Plugins that register with the WordPress Abilities API can join the server. Turn on Abilities under From WordPress in Settings > MCP and they become tools, each keeping its own permission checks. Filter: ogaie_mcp_abilities.

Hooks

  • ogaie_mcp_tool_called fires after every tool call, also refused or failed ones.
  • ogaie_mcp_post_changed fires when a tool changes a post.
  • ogaie_mcp_mutate fires after a tool that changes data.
  • ogaie_allow_mcp decides who may use the admin server (default: users who can manage_options).
  • ogaie_mcp_oauth_user_can_authorize decides who may approve an OAuth connection.

Public MCP

The Public MCP module never calls ogaie_mcp_tools or ogaie_mcp_callback, so your admin tools can never appear there. Every request runs as a signed-out visitor.

  • Endpoint: POST /wp-json/ogaie-public/v1/mcp, stateless JSON-RPC over Streamable HTTP. GET and DELETE answer 405.
  • Tools: site_info, search_content, get_page, list_products, get_product.
  • Rate limit: 120 requests per caller every 5 minutes by default. Over the limit, the server answers 429.
  • Keep a post out of it with ogaie_public_mcp_can_share: return false for that post.
  • Settings live in the option ogaie_module_public_mcp (enabled, advertise, rate_limit, tools).

Connecting out

OG AI Core can also use external MCP servers to give chatbots more tools (ogaie_ai_mcp_servers).

Safety

Tools should do one thing, validate input and never run arbitrary code. The plugin does not provide an arbitrary PHP tool on purpose.