Skip to main content
Glama
gaupoit

WordPress MCP Server

by gaupoit

wp_site_info

Retrieve WordPress site details including name, description, URL, timezone, and GMT offset to understand site configuration and settings.

Instructions

Get WordPress site information.

Returns:
    Site info including name, description, url, home, gmt_offset, and timezone.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function for the wp_site_info tool. Retrieves the shared WordPressClient instance and delegates to its get_site_info() method. The @mcp.tool() decorator registers the tool with the MCP server and infers schema from signature/docstring.
    @mcp.tool()
    def wp_site_info() -> dict:
        """Get WordPress site information.
    
        Returns:
            Site info including name, description, url, home, gmt_offset, and timezone.
        """
        client = get_client()
        return client.get_site_info()
  • Core helper method in WordPressClient that implements the site information retrieval by querying the WordPress REST API root endpoint (/wp-json), parsing the response, and returning a formatted dictionary with site details.
    def get_site_info(self) -> dict:
        """Get site information."""
        # Use the root endpoint for site info
        url = f"{self.config.url.rstrip('/')}/wp-json"
        headers = self._get_headers()
    
        response = self._client.get(url, headers=headers)
        response.raise_for_status()
        data = response.json()
    
        return {
            "name": data.get("name", ""),
            "description": data.get("description", ""),
            "url": data.get("url", ""),
            "home": data.get("home", ""),
            "gmt_offset": data.get("gmt_offset", 0),
            "timezone_string": data.get("timezone_string", ""),
        }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/gaupoit/wordpress-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server