wp_get_plugins
Retrieve installed WordPress plugins with their status, version, and details to manage site functionality and troubleshoot issues.
Instructions
Get installed plugins from WordPress. Requires authentication.
Args:
status: Filter by status - 'active', 'inactive', or 'all'. Default is 'all'.
Returns:
List of plugins with name, plugin slug, status, version, and description.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | No | all |
Implementation Reference
- src/wordpress_mcp/server.py:80-92 (handler)The MCP tool handler for wp_get_plugins. Decorated with @mcp.tool() for registration. Delegates to WordPressClient.get_plugins().@mcp.tool() def wp_get_plugins(status: str = "all") -> list[dict]: """Get installed plugins from WordPress. Requires authentication. Args: status: Filter by status - 'active', 'inactive', or 'all'. Default is 'all'. Returns: List of plugins with name, plugin slug, status, version, and description. """ client = get_client() return client.get_plugins(status=status)
- src/wordpress_mcp/client.py:146-164 (helper)Core implementation of plugin fetching in WordPressClient using WP REST API /plugins endpoint, formats response with name, plugin slug, status, version, description.def get_plugins(self, status: str = "all") -> list[dict]: """Get installed plugins (requires authentication).""" params = {} if status != "all": params["status"] = status plugins = self._get("plugins", params, require_auth=True) return [ { "name": p["name"], "plugin": p["plugin"], "status": p["status"], "version": p.get("version", "unknown"), "description": p.get("description", {}).get("raw", "")[:100], } for p in plugins ]
- src/wordpress_mcp/server.py:80-80 (registration)The @mcp.tool() decorator registers the wp_get_plugins function as an MCP tool.@mcp.tool()
- src/wordpress_mcp/server.py:15-22 (helper)Helper function to get or initialize the shared WordPressClient instance used by all tools.def get_client() -> WordPressClient: """Get or create the WordPress client.""" global _client if _client is None: config = load_config() _client = WordPressClient(config) return _client
- src/wordpress_mcp/client.py:31-41 (helper)Generic _get method used by get_plugins to query the /plugins endpoint.def _get( self, endpoint: str, params: dict | None = None, require_auth: bool = False ) -> Any: """Make a GET request to the WordPress API.""" url = f"{self.config.api_base}/{endpoint}" headers = self._get_headers(require_auth) response = self._client.get(url, headers=headers, params=params) response.raise_for_status() return response.json()