swit-oauth-status
Check OAuth authentication status for the Swit MCP Server to verify access to Swit collaboration tools before performing workspace operations.
Instructions
Check OAuth authentication status
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/handlers/oauth.handlers.ts:3-15 (handler)The handleOAuthStatus function that executes the core logic of the 'swit-oauth-status' tool by checking OAuth authentication status and returning relevant details.export const handleOAuthStatus = async (oauthWebServer: OAuthWebServer | null) => { const isAuthenticated = oauthWebServer?.isAuthenticated() || false; const port = process.env.OAUTH_PORT || '3000'; return { authenticated: isAuthenticated, status: isAuthenticated ? 'Authenticated' : 'Authentication required', webServerUrl: oauthWebServer ? `http://localhost:${port}` : null, message: isAuthenticated ? 'OAuth authentication completed. Swit API is ready to use.' : 'OAuth authentication required. Use swit-oauth-start tool to begin authentication.', }; };
- src/tools/oauth.tools.ts:8-11 (schema)Input schema definition for the 'swit-oauth-status' tool (empty schema since no parameters required).name: 'swit-oauth-status', description: 'Check OAuth authentication status', inputSchema: zodToJsonSchema(EmptySchema), },
- src/handlers/oauth.handlers.ts:62-66 (registration)Registration of the 'swit-oauth-status' handler within the oauthHandlers factory function, which is later used in the main index.ts.export const oauthHandlers = (oauthWebServer: OAuthWebServer | null) => ({ 'swit-oauth-status': () => handleOAuthStatus(oauthWebServer), 'swit-oauth-start': () => handleOAuthStart(oauthWebServer), 'swit-oauth-logout': () => handleOAuthLogout(oauthWebServer), });
- src/index.ts:62-63 (registration)Registration of tool schemas (including 'swit-oauth-status' from oauthTools) in the MCP server's listTools handler.return { tools: [...oauthTools, ...coreTools] }; });
- src/index.ts:109-109 (registration)Final dynamic registration of the oauthHandlers (including 'swit-oauth-status') into the MCP toolHandlers object after OAuth initialization.toolHandlers = { ...oauthHandlers(oauthWebServer), ...coreHandlers(switClient) };