get_privacy_info
Detect if an IP address is associated with privacy services like VPNs, proxies, Tor, relays, or hosting providers to assess connection authenticity.
Instructions
Detect privacy services (VPN, proxy, Tor, etc.) for an IP address.
Args: ip: IP address to check
Returns: Privacy detection results including VPN, proxy, Tor, relay, and hosting status.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ip | Yes |
Implementation Reference
- src/mcp_ipinfo/server.py:209-224 (handler)MCP tool handler function for 'get_privacy_info'. Automatically registered via @mcp.tool() decorator. Gets IPInfoClient instance and calls its get_privacy method, handling errors via context.@mcp.tool() async def get_privacy_info(ip: str, ctx: Context[Any, Any, Any]) -> PrivacyResponse: """Detect privacy services (VPN, proxy, Tor, etc.) for an IP address. Args: ip: IP address to check Returns: Privacy detection results including VPN, proxy, Tor, relay, and hosting status. """ client = get_client(ctx) try: return await client.get_privacy(ip) except IPInfoAPIError as e: ctx.error(f"API error: {e.message}") raise
- src/mcp_ipinfo/api_models.py:52-59 (schema)Pydantic BaseModel defining the output schema for the privacy information response, used for validation and serialization.class PrivacyResponse(BaseModel): vpn: bool = Field(..., description="VPN detected") proxy: bool = Field(..., description="Proxy detected") tor: bool = Field(..., description="Tor detected") hosting: bool = Field(..., description="Hosting provider detected") relay: bool = Field(..., description="Relay detected") service: str = Field(..., description="Service name if detected")
- src/mcp_ipinfo/api_client.py:231-234 (helper)Supporting method in IPInfoClient class that makes the HTTP GET request to the IPInfo /privacy endpoint and constructs the PrivacyResponse from the API data.async def get_privacy(self, ip: str) -> PrivacyResponse: """Get privacy information for an IP.""" data = await self._request("GET", f"/{ip}/privacy") return PrivacyResponse(**data)