Skip to main content
Glama
environment.py2.51 kB
"""Utility functions related to environment checking.""" import logging import os from .urls import is_atlassian_cloud_url logger = logging.getLogger("mcp-atlassian.utils.environment") def get_available_services() -> dict[str, bool | None]: """Determine which services are available based on environment variables.""" jira_url = os.getenv("JIRA_URL") jira_is_setup = False if jira_url: is_cloud = is_atlassian_cloud_url(jira_url) # OAuth check (highest precedence, applies to Cloud) if all( [ os.getenv("ATLASSIAN_OAUTH_CLIENT_ID"), os.getenv("ATLASSIAN_OAUTH_CLIENT_SECRET"), os.getenv("ATLASSIAN_OAUTH_REDIRECT_URI"), os.getenv("ATLASSIAN_OAUTH_SCOPE"), os.getenv("ATLASSIAN_OAUTH_CLOUD_ID"), ] ): jira_is_setup = True logger.info( "Using Jira OAuth 2.0 (3LO) authentication (Cloud-only features)" ) elif all( [ os.getenv("ATLASSIAN_OAUTH_ACCESS_TOKEN"), os.getenv("ATLASSIAN_OAUTH_CLOUD_ID"), ] ): jira_is_setup = True logger.info( "Using Jira OAuth 2.0 (3LO) authentication (Cloud-only features) " "with provided access token" ) elif is_cloud: # Cloud non-OAuth if all( [ os.getenv("JIRA_USERNAME"), os.getenv("JIRA_API_TOKEN"), ] ): jira_is_setup = True logger.info("Using Jira Cloud Basic Authentication (API Token)") else: # Server/Data Center non-OAuth if os.getenv("JIRA_PERSONAL_TOKEN") or ( os.getenv("JIRA_USERNAME") and os.getenv("JIRA_API_TOKEN") ): jira_is_setup = True logger.info( "Using Jira Server/Data Center authentication (PAT or Basic Auth)" ) elif os.getenv("ATLASSIAN_OAUTH_ENABLE", "").lower() in ("true", "1", "yes"): jira_is_setup = True logger.info( "Using Jira minimal OAuth configuration - expecting user-provided tokens via headers" ) if not jira_is_setup: logger.info( "Jira is not configured or required environment variables are missing." ) return {"jira": jira_is_setup} # Made with Bob

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/amruthabesto28/JIRA-MCP'

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