Skip to content

Conversation

sooperset
Copy link
Owner

Description

This PR fixes the confluence_get_page tool failure when using OAuth authentication by implementing v2 API support for page retrieval operations. The v1 REST API endpoints have been removed for OAuth but continue to work with API tokens.

Fixes: #576

Changes

  • Extended ConfluenceV2Adapter with get_page method for v2 API page retrieval
  • Updated PagesMixin.get_page_content to use v2 adapter when OAuth is configured
  • Added unit tests for OAuth page retrieval flow
  • Maintained backward compatibility for API token authentication

Testing

  • Unit tests added/updated
  • Integration tests passed
  • Manual checks performed: Tested OAuth page retrieval with mocked v2 API responses

Checklist

  • Code follows project style guidelines (linting passes).
  • Tests added/updated for changes.
  • All tests pass locally.
  • Documentation updated (if needed).

This fix addresses the deprecated v1 REST API endpoint issue when using
OAuth authentication. The v1 endpoint has been removed for OAuth but
continues to work with API tokens.

- Extended ConfluenceV2Adapter with get_page method
- Updated PagesMixin to use v2 API for OAuth authentication
- Added comprehensive unit tests for OAuth flow
- Maintained backward compatibility for API token users

Reported-by: dannymyers
Github-Issue: #576
@sooperset sooperset merged commit aaeb824 into main Jun 28, 2025
5 checks passed
@sooperset sooperset deleted the fix/oauth-confluence-get-page branch June 28, 2025 15:14
@phuoc-nguyen-ts
Copy link

Hello, I still encounter this onghcr.io/sooperset/mcp-atlassian:latest, when trying to use the get_confluence_page tool

My current setup

# docker-compose.yml

  confluence-mcp:
    #    image: mcp/atlassian
    image: ghcr.io/sooperset/mcp-atlassian:latest
    restart: unless-stopped
    container_name: confluence-mcp
    command: [ "--transport", "streamable-http", "--port", "9000", "-vv" ]
    environment:
      CONFLUENCE_SSL_VERIFY: false
      JIRA_SSL_VERIFY: false
      ATLASSIAN_OAUTH_ENABLE: true
      ATLASSIAN_OAUTH_CLOUD_ID: ******
    networks:
      - confluence-mcp-network
    ports:
      - '9000:9000'

The error

DEBUG - mcp-atlassian.servers.dependencies - get_confluence_fetcher: ENTERED. Context ID: 281473602740112
DEBUG - mcp-atlassian.servers.dependencies - get_confluence_fetcher: In HTTP request context. Request URL: http://confluence-mcp:9000/mcp/. State.confluence_fetcher exists: True. State.user_auth_type: oauth. State.user_token_present: True.
DEBUG - mcp-atlassian.servers.dependencies - get_confluence_fetcher: Returning ConfluenceFetcher from request.state.
DEBUG - mcp-atlassian - Using v1 API for token/basic authentication to get page '4202627116'
DEBUG - atlassian.rest_client - curl --silent -X GET -H 'Content-Type: application/json' -H 'Accept: application/json'  'https://api.atlassian.com/ex/confluence/******/rest/api/content/4202627116?expand=body.storage,version,space,children.attachment'
DEBUG - urllib3.connectionpool - https://api.atlassian.com:443 "GET /ex/confluence/*****/rest/api/content/4202627116?expand=body.storage,version,space,children.attachment HTTP/1.1" 410 None
DEBUG - atlassian.rest_client - HTTP: GET rest/api/content/4202627116 -> 410 Gone
DEBUG - atlassian.rest_client - HTTP: Response text -> {"statusCode":410,"data":{"authorized":true,"valid":true,"errors":[],"successful":true},"message":"com.atlassian.confluence.api.service.exceptions.GoneException: This deprecated endpoint has been removed."}
ERROR - mcp-atlassian - HTTP error during API call: com.atlassian.confluence.api.service.exceptions.GoneException: This deprecated endpoint has been removed.
ERROR - mcp_atlassian.servers.confluence - Error fetching page by ID '4202627116': com.atlassian.confluence.api.service.exceptions.GoneException: This deprecated endpoint has been removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: confluence_get_page fails when using OAuth
2 participants