wp_seo_test_integration
Test SEO plugin integration on WordPress sites to detect installed plugins and verify metadata access for proper SEO functionality.
Instructions
Test SEO plugin integration and detect available SEO plugins on the WordPress site
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site | No | Site identifier for multi-site setups | |
| checkPlugins | No | Check which SEO plugins are installed and active | |
| testMetadataAccess | No | Test ability to read/write SEO metadata |
Implementation Reference
- src/tools/seo/SEOTools.ts:606-655 (handler)Core implementation of the wp_seo_test_integration tool logic, performing SEO plugin detection, metadata access tests, and generating recommendations./** * Test SEO plugin integration and WordPress API connectivity */ async testSEOIntegration(params: SEOToolParams): Promise<unknown> { const siteLogger = LoggerFactory.tool("wp_seo_test_integration", params.site); return await siteLogger.time("Test SEO integration", async () => { try { const seoClient = await this.getSEOClient(params.site); // Test the integration const integrationTest = await seoClient.testSEOIntegration(); // Get some sample SEO data let sampleSEOData = null; if (integrationTest.canReadMetadata && integrationTest.samplePostsWithSEO > 0) { try { const posts = await seoClient.getPosts({ per_page: 1, status: ["publish"] }); if (posts && posts.length > 0) { sampleSEOData = await seoClient.getSEOMetadata(posts[0].id); } } catch (_error) { // Sample data fetch failed, but that's okay this.logger.debug("Failed to fetch sample SEO data", { _error: _error }); } } const result = { integrationTest, sampleSEOData, recommendations: this.generateIntegrationRecommendations(integrationTest), testedAt: new Date().toISOString(), }; siteLogger.info("SEO integration test completed", { plugin: integrationTest.pluginDetected, canRead: integrationTest.canReadMetadata, canWrite: integrationTest.canWriteMetadata, postsWithSEO: integrationTest.samplePostsWithSEO, }); return result; } catch (_error) { handleToolError(_error, "test SEO integration", { site: params.site, }); throw _error; } }); }
- src/tools/seo/SEOHandlers.ts:255-274 (handler)MCP protocol handler entry point for wp_seo_test_integration, parses arguments and delegates to SEOTools.testSEOIntegration method.export async function handleTestSEOIntegration( client: WordPressClient, args: Record<string, unknown>, ): Promise<unknown> { const logger = LoggerFactory.tool("wp_seo_test_integration"); try { const seoTools = getSEOToolsInstance(); const params: SEOToolParams = { checkPlugins: args.checkPlugins as boolean, testMetadataAccess: args.testMetadataAccess as boolean, site: args.site as string, }; return await seoTools.testSEOIntegration(params); } catch (error) { logger.error("Failed to test SEO integration", { error, args }); throw error; } }
- Tool definition including name, description, and input schema for wp_seo_test_integration.export const testSEOIntegrationTool: Tool = { name: "wp_seo_test_integration", description: "Test SEO plugin integration and detect available SEO plugins on the WordPress site", inputSchema: { type: "object", properties: { checkPlugins: { type: "boolean", description: "Check which SEO plugins are installed and active", }, testMetadataAccess: { type: "boolean", description: "Test ability to read/write SEO metadata", }, site: { type: "string", description: "Site identifier for multi-site setups", }, }, required: [], }, };
- src/tools/seo/SEOTools.ts:379-391 (registration)Handler mapping registration that associates 'wp_seo_test_integration' with its handler function for MCP tool registration.const handlers: Record<string, unknown> = { wp_seo_analyze_content: handleAnalyzeContent, wp_seo_generate_metadata: handleGenerateMetadata, wp_seo_bulk_update_metadata: handleBulkUpdateMetadata, wp_seo_generate_schema: handleGenerateSchema, wp_seo_validate_schema: handleValidateSchema, wp_seo_suggest_internal_links: handleSuggestInternalLinks, wp_seo_site_audit: handlePerformSiteAudit, wp_seo_track_serp: handleTrackSERPPositions, wp_seo_keyword_research: handleKeywordResearch, wp_seo_test_integration: handleTestSEOIntegration, wp_seo_get_live_data: handleGetLiveSEOData, };