mcp-atlassian ignores `Authorization: Token` header; how to pass a PAT via headers?
I'm running mcp-atlassian behind a streamable HTTP endpoint and passing a Jira PAT as
Authorization: Token ...in the client config (langchain-mcp-adapter 0.1.7). The token works when set as a container env var, but header auth fails: the server logs show a 307 redirect from/mcpto/mcp/and the redirected request hasAuthHeader='Not Provided'. Is there a supported way to pass the PAT via headers, or a working workaround?Originally asked on GitHub: https://github.com/sooperset/mcp-atlassian/issues/590
6 answers
Still an open issue as of this thread. The logs show the root cause: the first POST to
/mcpreturns307 Temporary Redirectto/mcp/, and the redirected request arrives withAuthHeader='Not Provided', so the PAT header is never applied to the actual MCP call. Setting the PAT as a container env var works because mcp-atlassian's auth checks read environment variables, not request headers.Workaround that worked for at least one user (comment 5): start the container with both
JIRA_URLandJIRA_PERSONAL_TOKEN=true, and keep theAuthorization: Token <PAT>header in the client config:bashdocker run -d --name mcp-atlassian \ -p 8080:8080 \ -e JIRA_URL="https://jira.oci.myorg.com/" \ -e JIRA_PERSONAL_TOKEN=true \ ghcr.io/sooperset/mcp-atlassian:latest \ --transport streamable-http --port 8080 -vvvClient config (Cline, streamableHttp transport):
json{ "mcpServers": { "mcp-server": { "type": "streamableHttp", "url": "http://localhost:8080/mcp", "headers": { "Authorization": "Token <YOUR_JIRA_PERSONAL_TOKEN>" } } } }This workaround is not universal: comment 2 and comment 4 report
Auth type: None. Token present: Falseor "Total tools after filtering: 0" even withJIRA_PERSONAL_TOKEN=true. Comment 3 proposes a code change inmain.pydispatch()that readsJIRA_URL,JIRA_PERSONAL_TOKEN,CONFLUENCE_URL, andCONFLUENCE_PERSONAL_TOKENfrom request headers and sets them into the environment; that is a proposal and not confirmed in the thread.General advice: treat your PAT as a secret and avoid printing it in configs or logs.
Did this work for you?What a GitHub user tried on GitHub (Didn't work)
Passed the Jira PAT via
Authorization: Token MT...in a langchain-mcp-adapter 0.1.7 config withstreamable_http. The server received the header on the first POST, but a 307 redirect to/mcp/followed and the second request had no Authorization header.Source: https://github.com/sooperset/mcp-atlassian/issues/590 (opens external site)
Did this work for you?What @matthieugauthier tried on GitHub (Worked)
Added
JIRA_PERSONAL_TOKEN: trueas an environment variable. The commenter said this made it work, explaining that mcp-atlassian's config checks read env vars and request headers are not available where those checks happen.Source: https://github.com/sooperset/mcp-atlassian/issues/590#issuecomment-3022693610 (opens external site)
Did this work for you?What @bmanikantareddy tried on GitHub (Worked)
Ran Docker with
-e JIRA_URL=... -e JIRA_PERSONAL_TOKEN=trueand used a Cline streamableHttp config withAuthorization: Token <PAT>. The server connected and the integration worked.Source: https://github.com/sooperset/mcp-atlassian/issues/590#issuecomment-3888474010 (opens external site)
Did this work for you?What @hghew tried on GitHub (Didn't work)
Tried
JIRA_PERSONAL_TOKEN=trueas suggested, but still got auth errors:User auth type: None ... Token present: False.Source: https://github.com/sooperset/mcp-atlassian/issues/590#issuecomment-3025865696 (opens external site)
Did this work for you?What @saranyababu2005 tried on GitHub (Didn't work)
Set
JIRA_PERSONAL_TOKEN=truewith valid credentials; Jira tools were still excluded with "configuration/authentication is incomplete" and "Total tools after filtering: 0".Source: https://github.com/sooperset/mcp-atlassian/issues/590#issuecomment-3367813825 (opens external site)
Did this work for you?
Related questions
- mcp-atlassian: 'JiraConfig' object has no attribute 'read_only' when calling create_issue
- mcp-atlassian Docker fails on startup with 'ValueError: I/O operation on closed file' — fixed?
- OAuth 2.0 for Confluence Data Center (on-prem) in mcp-atlassian?
- mcp-atlassian crashes with Pydantic 2.12.0: 'cannot specify both default and default_factory'
- mcp-atlassian Jira search_issues: 'requested API has been removed' error and total -1