Skip to main content
GET
/
v1
/
proxy
/
{provider}
/
info
curl "https://api.mcprank.com/v1/proxy/google/info" \
  -H "X-API-Key: your-api-key" \
  -H "Authorization: Bearer your-access-token"
{
  "provider": "google",
  "connected": true,
  "status": "active",
  "can_access": true
}

Overview

Check whether a user has connected a specific OAuth provider and can make proxy requests. Use this to determine if you need to prompt the user to authenticate before making proxy requests.

Path Parameters

provider
string
required
OAuth provider name. Currently supported: google

Headers

X-API-Key
string
required
Your MCP Rank API key
Authorization
string
required
Bearer token. Format: Bearer {mcp_identity_access_token}

Response

provider
string
The provider name
connected
boolean
Whether the user has connected this provider
status
string
Connection status. Possible values:
  • active - Connection is working
  • needs_reauth - User needs to re-authenticate (e.g., token expired and couldn’t refresh)
  • null - Not connected
can_access
boolean
Whether proxy requests can be made. true only if connected is true and status is active.
curl "https://api.mcprank.com/v1/proxy/google/info" \
  -H "X-API-Key: your-api-key" \
  -H "Authorization: Bearer your-access-token"
{
  "provider": "google",
  "connected": true,
  "status": "active",
  "can_access": true
}

Use Cases

Pre-flight check before proxy requests

async def get_user_emails(client: MCPRank):
    """Get user's emails, handling connection state."""
    
    # Check access first
    info = await client.get_proxy_info("google")
    
    if not info["can_access"]:
        if info["status"] == "needs_reauth":
            raise Exception("Please re-connect your Google account")
        else:
            raise Exception("Please connect your Google account first")
    
    # Safe to proceed
    return await client.proxy_get("google", "gmail/v1/users/me/messages")

Show connection status in UI

async def get_connection_status(client: MCPRank):
    """Get connection status for all providers."""
    
    providers = ["google"]  # Add more as they become available
    status = {}
    
    for provider in providers:
        try:
            info = await client.get_proxy_info(provider)
            status[provider] = {
                "connected": info["connected"],
                "status": info["status"],
                "can_access": info["can_access"],
            }
        except Exception:
            status[provider] = {
                "connected": False,
                "status": None,
                "can_access": False,
            }
    
    return status

Error Responses

Status CodeDescription
400Unsupported provider
401Missing or invalid API key or access token
429Rate limit exceeded