Skip to main content
Glama

clear_auth

Clear authentication tokens and sessions on CyberMCP to prevent unauthorized access and mitigate risks associated with authentication bypass vulnerabilities in backend APIs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The inline handler function for the clear_auth MCP tool. It retrieves the AuthManager singleton instance and calls its clearAuth() method to reset the authentication state, then returns a confirmation message.
    const authManager = AuthManager.getInstance(); authManager.clearAuth(); return { content: [ { type: "text", text: "Authentication cleared. The server is no longer authenticated.", }, ], }; } );
  • Registers the clear_auth tool on the MCP server within the registerAuthenticationTools function. Uses empty schema (no inputs) and the inline handler above.
    server.tool( "clear_auth", {}, async () => { const authManager = AuthManager.getInstance(); authManager.clearAuth(); return { content: [ { type: "text", text: "Authentication cleared. The server is no longer authenticated.", }, ], }; } );
  • Supporting method in AuthManager class that implements the core logic of clearing authentication by resetting the authState to unauthenticated state.
    public clearAuth(): void { this.authState = { type: 'none' }; }

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/ricauts/CyberMCP'

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