Skip to main content
Glama

swit-oauth-logout

Logout from OAuth authentication to delete stored tokens and re-authenticate with Swit MCP Server for secure access to Swit collaboration tools.

Instructions

Logout from OAuth authentication and delete stored tokens. Use when re-authentication is required.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the swit-oauth-logout tool. It checks if the OAuthWebServer is available and calls logout() on its OAuthManager, returning success or error messages.
    export const handleOAuthLogout = async (oauthWebServer: OAuthWebServer | null) => { if (!oauthWebServer) { return { error: 'OAuth web server is not available. Cannot perform logout.', }; } oauthWebServer.getOAuthManager().logout(); return { message: 'OAuth logout completed successfully.', note: 'Cached tokens have been cleared. Use swit-oauth-start to re-authenticate.', }; };
  • Tool schema definition specifying the name, description, and empty input schema (no parameters required).
    { name: 'swit-oauth-logout', description: 'Logout from OAuth authentication and delete stored tokens. Use when re-authentication is required.', inputSchema: zodToJsonSchema(EmptySchema), },
  • Local registration of the swit-oauth-logout tool within the oauthHandlers object, mapping the tool name to its handler function. This object is later spread into the global toolHandlers in src/index.ts.
    export const oauthHandlers = (oauthWebServer: OAuthWebServer | null) => ({ 'swit-oauth-status': () => handleOAuthStatus(oauthWebServer), 'swit-oauth-start': () => handleOAuthStart(oauthWebServer), 'swit-oauth-logout': () => handleOAuthLogout(oauthWebServer), });
  • The OAuthManager.logout() method called by the tool handler, which clears the in-memory token information and the persistent token cache.
    logout(): void { this.tokenInfo = null; this.tokenCache.clear(); console.error('OAuth logout completed'); }

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/TykanN/swit-mcp'

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