Documentation
Forge
Developer Reference

Developer Reference


Constants

ConstantValueDescription
WCFORGE_VERSION1.0.0Plugin version
WCFORGE_PLUGIN_FILE__FILE__Main plugin file
WCFORGE_PLUGIN_DIRplugin_dir_path()Plugin directory
WCFORGE_PLUGIN_URLplugin_dir_url()Plugin URL
WCFORGE_REST_NAMESPACEwindcodex-forge/v1REST namespace
WCFORGE_REST_ROUTE/mcpMCP route

REST Routes

RouteMethodDescription
/wp-json/windcodex-forge/v1/mcpPOSTMCP JSON-RPC endpoint (Bearer token)
/wp-json/windcodex-forge/v1/oauth/registerPOSTDynamic client registration (10 per hour per IP)
/wp-json/windcodex-forge/v1/oauth/tokenPOSTToken exchange and refresh
/wcforge-oauth/authorizeGET/POSTConsent screen (rewrite rule)

OAuth lifetimes: authorization code 5 minutes, access token 1 hour, refresh token 30 days.

Options

OptionDescription
wcforge_settingsAll settings (shared with Forge Pro)

Notable keys: enabled, read_only, acting_user_id, max_results_limit (default 50), requests_per_minute_limit (10-600, default 120), allow_dynamic_registration, delete_data_on_uninstall, primitive_enabled (per-tool toggles).

Filters

FilterArgumentsDescription
wcforge_ability_capability$capability (string), $tool_name (string)Change the capability required to run a tool through the Abilities API. Default manage_options
add_filter( 'wcforge_ability_capability', function ( $capability, $tool_name ) {
    if ( 'wp_list_plugins' === $tool_name ) {
        return 'activate_plugins';
    }
    return $capability;
}, 10, 2 );

WordPress Abilities API

On WordPress 6.9+, each tool is registered as an ability in the windcodex-forge category.

The MCP endpoint and the Abilities API are the supported integration surfaces. Internal PHP classes are not a public API.