'wp', 'args' => array( 'mcp-adapter', 'serve', '--server=' . $server_slug, '--user=admin', '--path=' . $wp_root, ), ); $stdio_json = (string) wp_json_encode( $stdio_config, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES ); echo '
%s
', esc_html__( 'MCP clients can connect by launching WP-CLI as a subprocess instead of calling the HTTP endpoint. This is ideal for local WordPress installs — no credentials are transmitted over the network.', 'acrossai-mcp-manager' ) ); printf( '%s
', esc_html__( 'MCP clients can also connect by launching WP-CLI as a subprocess instead of calling the HTTP endpoint. This is ideal for local WordPress installs — no credentials are transmitted over the network.', 'acrossai-mcp-manager' ) ); $this->render_command_block( 'wpcli_list_' . $server_id, __( 'List all registered MCP servers', 'acrossai-mcp-manager' ), '', $cmd_list, 1 ); $this->render_command_block( 'wpcli_serve_' . $server_id, __( 'Start this server via STDIO', 'acrossai-mcp-manager' ), __( 'Blocks until the MCP client disconnects. Replace "admin" with any WordPress user login or ID.', 'acrossai-mcp-manager' ), $cmd_serve, 1 ); $this->render_command_block( 'wpcli_stdio_config_' . $server_id, __( 'STDIO config block (paste into your MCP client)', 'acrossai-mcp-manager' ), sprintf( /* translators: %s: server key */ __( 'Add this under the key "%s" in your MCP client\'s config file. WP-CLI must be in your PATH, or replace "wp" with the full path to the binary.', 'acrossai-mcp-manager' ), $server_key ), $stdio_json, 8 ); $this->render_transport_notice(); echo '%s
', esc_html( $description ) ); } $css_class = 1 === $rows ? 'widefat code mcp-cmd' : 'widefat code'; printf( '', esc_attr( $field_id ), esc_attr( $css_class ), (int) $rows, esc_textarea( $body ) ); printf( '', esc_attr( $field_id ), esc_html__( 'Copy', 'acrossai-mcp-manager' ) ); echo '%s
', esc_html__( 'STDIO vs HTTP transport', 'acrossai-mcp-manager' ) ); echo '%s
', esc_html__( 'The --path flag in the STDIO config is the absolute path to this WordPress installation on disk. Adjust it if the wp binary cannot find WordPress automatically.', 'acrossai-mcp-manager' ) ); echo '