Prerequisites
Bug Description
confluence_get_page_history and confluence_get_page_diff fail for every page and every version number (including the current one) when the server uses OAuth 2.0 with granular scopes, raising Version {n} not found for page '{id}'.
Under OAuth the call routes to ConfluenceV2Adapter.get_page_by_version() in src/mcp_atlassian/confluence/v2_adapter.py, which maps a version number to a version id:
if ver.get("number") == version:
version_id = ver.get("id") # always None
...
raise ValueError(f"Version {version} not found for page '{page_id}'")
url = f"{self.base_url}/api/v2/versions/{version_id}" # not a real endpoint
But Confluence v2 version objects from GET /api/v2/pages/{id}/versions have no id field. Verified against the live API, the keys are number, message, minorEdit, authorId, createdAt, page. So ver.get("id") is always None and the lookup always raises. get_page_diff calls get_page_history for both versions, so it fails too.
Two deeper issues beyond the id bug:
- There is no
GET /api/v2/versions/{id} endpoint.
- No v2 endpoint returns a historical version's body (the version endpoints are metadata-only), so even with the id lookup fixed, the OAuth/v2 path cannot return historical content.
The v1 fallback GET /rest/api/content/{id}?status=historical&version=N&expand=body.storage returns 401 "scope does not match" under granular OAuth scopes, so it is not available to OAuth apps either.
Steps to Reproduce
- Run the server with OAuth 2.0 + granular scopes against a Confluence Cloud site.
- Call
confluence_get_page_history with a valid page_id and version (e.g. the page's current version number).
- See the error. Same for
confluence_get_page_diff with any two versions.
Expected Behavior
get_page_history returns the requested version (ideally with body) and get_page_diff returns a diff. At minimum, version metadata should be retrievable under OAuth.
Actual Behavior
Error getting page history: Failed to get page '<id>' version 8: Version 8 not found for page '<id>'
Fails for every version number, including the page's current version.
mcp-atlassian Version: 0.21.1
Installation Method: From PyPI (uvx mcp-atlassian)
Operating System: Windows
Python Version: 3.13.13
Atlassian Instance Type: Confluence Cloud
Client Application: Claude Code (MCP client)
Additional Context / suggested fix
- For history, match on
number and return the version metadata from /pages/{id}/versions (this works under OAuth).
- Returning a historical body (and therefore the diff) is not possible via v2; it requires the v1 content API, which granular-scope OAuth apps cannot call. Consider documenting that body/diff need API-token auth, and make
get_page_diff fail with a clear, actionable message under OAuth instead of Version not found.
- Buggy line is
version_id = ver.get("id") in get_page_by_version (around line 822 on the v0.21.1 tag).
Prerequisites
Bug Description
confluence_get_page_historyandconfluence_get_page_difffail for every page and every version number (including the current one) when the server uses OAuth 2.0 with granular scopes, raisingVersion {n} not found for page '{id}'.Under OAuth the call routes to
ConfluenceV2Adapter.get_page_by_version()insrc/mcp_atlassian/confluence/v2_adapter.py, which maps a version number to a version id:But Confluence v2 version objects from
GET /api/v2/pages/{id}/versionshave noidfield. Verified against the live API, the keys arenumber, message, minorEdit, authorId, createdAt, page. Sover.get("id")is alwaysNoneand the lookup always raises.get_page_diffcallsget_page_historyfor both versions, so it fails too.Two deeper issues beyond the
idbug:GET /api/v2/versions/{id}endpoint.The v1 fallback
GET /rest/api/content/{id}?status=historical&version=N&expand=body.storagereturns401 "scope does not match"under granular OAuth scopes, so it is not available to OAuth apps either.Steps to Reproduce
confluence_get_page_historywith a validpage_idandversion(e.g. the page's current version number).confluence_get_page_diffwith any two versions.Expected Behavior
get_page_historyreturns the requested version (ideally with body) andget_page_diffreturns a diff. At minimum, version metadata should be retrievable under OAuth.Actual Behavior
Fails for every version number, including the page's current version.
mcp-atlassian Version: 0.21.1
Installation Method: From PyPI (
uvx mcp-atlassian)Operating System: Windows
Python Version: 3.13.13
Atlassian Instance Type: Confluence Cloud
Client Application: Claude Code (MCP client)
Additional Context / suggested fix
numberand return the version metadata from/pages/{id}/versions(this works under OAuth).get_page_difffail with a clear, actionable message under OAuth instead ofVersion not found.version_id = ver.get("id")inget_page_by_version(around line 822 on thev0.21.1tag).