open_polarion_login
Launch Polarion login page in browser to authenticate and generate access tokens for requirements management system integration.
Instructions
<purpose>Open Polarion login page in browser for manual authentication</purpose>
<when_to_use>
- When you need to authenticate with Polarion for the first time
- When existing token has expired (401 errors)
- When check_polarion_status() shows no valid token
</when_to_use>
<workflow_position>
STEP 1: Use this tool first if you don't have authentication
STEP 2: Complete login in browser and generate token
STEP 3: Use set_polarion_token() with the generated token
STEP 4: Use check_polarion_status() to verify authentication
STEP 5: Begin exploring with get_polarion_projects()
</workflow_position>
<output>Instructions for manual authentication process</output>
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- polarion_mcp/server.py:71-94 (handler)MCP tool handler for open_polarion_login, decorated with @mcp.tool() which also serves as registration. Calls the client helper to open the login page.@mcp.tool() def open_polarion_login() -> str: """ <purpose>Open Polarion login page in browser for manual authentication</purpose> <when_to_use> - When you need to authenticate with Polarion for the first time - When existing token has expired (401 errors) - When check_polarion_status() shows no valid token </when_to_use> <workflow_position> STEP 1: Use this tool first if you don't have authentication STEP 2: Complete login in browser and generate token STEP 3: Use set_polarion_token() with the generated token STEP 4: Use check_polarion_status() to verify authentication STEP 5: Begin exploring with get_polarion_projects() </workflow_position> <output>Instructions for manual authentication process</output> """ logger.info("Opening Polarion login page for manual authentication") return polarion_client.open_login_page()
- polarion_mcp/client.py:89-115 (helper)Core helper method in PolarionClient that opens the browser to the Polarion login URL and returns JSON instructions for token generation.def open_login_page(self) -> str: """Open Polarion login page in user's browser for manual authentication""" try: webbrowser.open(LOGIN_URL) return json.dumps({ "status": "success", "message": f"Polarion login page opened in your browser: {LOGIN_URL}", "instructions": [ "1. Complete the login form in your browser", "2. After successful login, navigate to: " + TOKEN_PAGE_URL, "3. Generate a new token manually", "4. Copy the token and use it with the 'set_polarion_token' command" ], "login_url": LOGIN_URL, "token_page_url": TOKEN_PAGE_URL, "note": "If you get an 'Internal server error', try refreshing the page or check if the Polarion instance is accessible" }, indent=2) except Exception as e: logger.error(f"Failed to open login page: {e}") return json.dumps({ "status": "error", "message": f"Failed to open login page: {e}", "manual_url": LOGIN_URL }, indent=2)