wp_get_auth_status
Check if your WordPress site is properly authenticated to manage content, users, and settings through the MCP WordPress Server.
Instructions
Gets the current authentication status for a configured WordPress site.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site | No | The ID of the WordPress site to target (from mcp-wordpress.config.json). Required if multiple sites are configured. |
Implementation Reference
- src/tools/auth.ts:116-140 (handler)Executes the wp_get_auth_status tool: checks if the WordPress client is authenticated, fetches current user if yes, formats a status message with site URL, method, auth status, and user info.public async handleGetAuthStatus( client: WordPressClient, params: Record<string, unknown>, ): Promise<Record<string, unknown>> { try { const isAuthenticated = client.isAuthenticated; const config = client.config; let content = `**Authentication Status for ${config.baseUrl}**\n\n` + `**Authenticated:** ${isAuthenticated ? "✅ Yes" : "❌ No"}\n` + `**Method:** ${config.auth.method}\n`; if (isAuthenticated) { const user = await client.getCurrentUser(); content += `**User:** ${user.name} (@${user.slug})\n`; } else { content += "**Status:** Not connected. Use 'wp_test_auth' to connect and verify credentials."; } return { content }; } catch (_error) { throw new Error(`Failed to get auth status: ${getErrorMessage(_error)}`); } }
- src/tools/auth.ts:41-46 (registration)Registers the wp_get_auth_status tool within AuthTools.getTools(), defining its name, description, empty parameters schema, and binding to the handleGetAuthStatus handler.{ name: "wp_get_auth_status", description: "Gets the current authentication status for a configured WordPress site.", parameters: [], handler: this.handleGetAuthStatus.bind(this), },