Skip to main content
Glama
ascentkorea

Hubble MCP Server

by ascentkorea

crawl_google_serp

Fetch Google search results for specific keywords and regions using Hubble MCP Server's API integration.

Instructions

구글 SERP API 요청

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keywordYes
glNokr

Implementation Reference

  • The core handler function for the 'crawl_google_serp' MCP tool, registered via the @mcp.tool() decorator. Includes an async retry wrapper. Proxies parameters to an internal Hubble API endpoint '/google_serp' and returns the raw text response typed against SerpResponse schema.
    @mcp.tool()
    @async_retry(exceptions=(Exception), tries=2, delay=0.3)
    async def crawl_google_serp(
            keyword: str,
            gl: Literal['kr', 'us', 'jp'] = "kr") -> dict[SerpResponse, Any] | None:
        '''
        구글 SERP API 요청
        '''
        async with httpx.AsyncClient() as client:
            payload = {
                "keyword": keyword,
                "gl": gl
            }
            headers = {"X-API-Key": HUBBLE_API_KEY}
            response = await client.post(
                f"{HUBBLE_API_URL}/google_serp",
                headers=headers,
                json=payload,
                timeout=30.0)
            response.raise_for_status()
            return response.text
  • Pydantic BaseModel defining the structure of the SERP response (output schema for the tool), inheriting from BaseResponse. Includes request details, cost, credits, and data list.
    class SerpResponse(BaseResponse):
        """SERP 응답 형식
        """
        request_detail: SerpParameters = Field(description="요청 받았던 파라미터")
        cost: int = Field(default=0, title="", description="")
        remain_credits: int = Field(default=-1, title="", description="")
        data: Optional[List[dict]] = Field(default=None, title="", description="")
  • data_api.py:381-381 (registration)
    The @mcp.tool() decorator registers the crawl_google_serp function as an MCP tool.
    @mcp.tool()

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/ascentkorea/hubble_mcp'

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