Hi @123nadav,
Both are a yes! 😊
Images: AI Engine’s MCP includes media-upload tools that take a URL or raw base64 data, so when Claude generates an image it can upload it straight into your media library and use it in the page it’s building.
PHP execution: Yes, and this is where AI Engine architecture is interesting. We don’t ship a “run any PHP” tool enabled for everyone, because that’s risky on a live site by default, but also, because it is forbidden per WP rules, no plugins hosted here can allow running/eval PHP. That said, AI Engine with MCP is fully extensible, so you can add that tool. You can add this via Code Engine or directly into your functions.php:
add_filter( 'mwai_mcp_tools', function ( $tools ) {
$tools[] = [
'name' => 'run_php',
'description' => 'Execute PHP and return the returned value plus echoed output. No <?php tags; use "return $value;".',
'inputSchema' => [ 'type' => 'object', 'properties' => [ 'code' => [ 'type' => 'string' ] ], 'required' => [ 'code' ] ],
];
return $tools;
} );
add_filter( 'mwai_mcp_callback', function ( $result, $tool, $args, $id ) {
if ( $tool !== 'run_php' ) return $result;
ob_start();
try {
$return = eval( (string) ( $args['code'] ?? '' ) );
return [ 'success' => true, 'return_value' => $return, 'output' => ob_get_clean() ];
} catch ( \Throwable $e ) {
ob_end_clean();
return [ 'success' => false, 'error' => $e->getMessage() ];
}
}, 10, 4 );
Again, that’s real code execution, so only add it where you control who holds the token, and treat that token like a secret. Same as any tool that can run code 😊
My prior recommendation (“keep your plugins’ code available to Claude Code locally, either pull it down or give it SFTP/SCP access”) is still by far the better and safer approach.
My goal with AI Engine is to provide an MCP server that can do it all safely and in an optimized way, rather than having a huge list of features just for the sake of a long list. The intelligence is in how those tools are crafted, used, and backed by a solid environment.
Let me know how it goes! 😊Jordy.
Тональность 0
Информативность 0
wordpress.org