Skip to main content
Glama
mvacaporale

Claude Usage MCP Server

by mvacaporale

check_claude_auth

Verify authentication status for Claude.ai sessions to monitor usage limits and track API consumption.

Instructions

Check if the current session is authenticated with Claude.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler logic for 'check_claude_auth' tool, which checks browser authentication status.
    elif name == "check_claude_auth":
        context = await get_browser_context()
        is_authenticated = await check_authenticated(context)
    
        return [TextContent(
            type="text",
            text=json.dumps({
                "authenticated": is_authenticated,
                "auth_state_exists": AUTH_STATE_PATH.exists()
            }, indent=2)
        )]
  • server.py:211-219 (registration)
    Registration of the 'check_claude_auth' tool within the list_tools function.
            name="check_claude_auth",
            description="Check if the current session is authenticated with Claude.",
            inputSchema={
                "type": "object",
                "properties": {},
                "required": []
            }
        )
    ]
  • Helper function used by 'check_claude_auth' to perform the actual authentication check using Playwright.
    async def check_authenticated(context: BrowserContext) -> bool:
        """Check if current session is authenticated."""
        page = await context.new_page()
        try:
            await page.goto(USAGE_URL, wait_until="domcontentloaded", timeout=60000)
            # Wait a bit for any redirects
            await page.wait_for_timeout(2000)
            # Check if we're on the usage page or redirected to login
            current_url = page.url
            return "settings/usage" in current_url and "login" not in current_url
        except Exception:
            return False
        finally:
            await page.close()
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It fails to specify what constitutes a successful check (boolean return? user object? exception?), whether the check modifies session state, or what latency/network requirements exist.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence of ten words with zero redundancy. The core purpose is front-loaded and immediately comprehensible. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Adequate for a zero-parameter tool but lacks critical information about return values since no output schema exists. For a status-checking tool, the description should ideally indicate what 'authenticated' means in terms of response data or side effects.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Zero parameters with 100% schema coverage means the description carries baseline expectations. No parameter explanation is required, though the description implicitly confirms no inputs are needed to perform this check.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific action ('Check') and clear scope ('current session is authenticated with Claude'). However, it does not explicitly differentiate from sibling tool 'claude_login' (which establishes auth) despite the distinct purposes being inferable from names alone.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides no guidance on when to invoke this tool versus alternatives. Does not indicate whether it should be called before other Claude operations, what to do if authentication fails, or how it relates to the 'claude_login' workflow.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/mvacaporale/claude-usage-mcp'

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