Skip to content

feat(mcp): Use Official Jira MCP - #990

Closed
syntaxsdev wants to merge 2 commits into
ambient-code:mainfrom
syntaxsdev:feat/atlassian-remote-mcp
Closed

syntaxsdev wants to merge 2 commits into
ambient-code:mainfrom
syntaxsdev:feat/atlassian-remote-mcp

Conversation

@syntaxsdev

@syntaxsdev syntaxsdev commented Mar 23, 2026 •

Copy link
Copy Markdown
  • .mcp.json — Replaced the community mcp-atlassian stdio server (spawns a local Python process via uvx) with the official
    Atlassian Remote MCP Server as an HTTP endpoint (https://mcp.atlassian.com/v1/mcp) with Basic auth header
  • auth.py — After fetching Jira creds from the backend, computes a base64 email:apiToken string and sets ATLASSIAN_AUTH_HEADER
    env var for the HTTP header
  • mcp.py — Auth check recognizes the new "atlassian" server name and checks ATLASSIAN_AUTH_HEADER first
  • pyproject.toml — Removed mcp-atlassian>=0.11.9 optional dependency
  • Tests — Updated tool classification tests to use mcp__atlassian__* prefix, added tests for the new auth header check

This Eliminates local Python process + community dependency, uses first-party Atlassian server with Jira + Confluence + Compass

@coderabbitai

coderabbitai Bot commented Mar 23, 2026 •

Copy link
Copy Markdown
Contributor

Walkthrough

Replaces the local mcp-atlassian MCP server entry with a remote atlassian HTTP server using Authorization: Basic ${ATLASSIAN_AUTH_HEADER}; runtime now derives/clears ATLASSIAN_AUTH_HEADER from Jira email/API token and check_mcp_authentication recognizes "atlassian". Tests and dependency extras updated.

Changes

Cohort / File(s) Summary
MCP Server Configuration
components/runners/ambient-runner/.mcp.json
Replaced mcp-atlassian command-based server entry with an atlassian HTTP server at https://mcp.atlassian.com/v1/mcp, configured to send Authorization: Basic ${ATLASSIAN_AUTH_HEADER}.
Auth logic & credential population
components/runners/ambient-runner/ambient_runner/bridges/claude/mcp.py, components/runners/ambient-runner/ambient_runner/platform/auth.py
check_mcp_authentication() now treats "atlassian" like other Atlassian server names and returns authenticated when ATLASSIAN_AUTH_HEADER (trimmed) is present. populate_runtime_credentials() sets ATLASSIAN_AUTH_HEADER as base64(email:apiToken) when Jira refresh yields an API token, and clears it when missing or on error.
Dependency manifest
components/runners/ambient-runner/pyproject.toml
Removed the mcp-atlassian optional-dependency group and excluded it from the all extras bundle.
Tests
components/runners/ambient-runner/tests/test_mcp_auth.py, components/runners/ambient-runner/tests/test_observability_metrics.py
Updated tests and docstring to include atlassian; added tests for presence/absence of ATLASSIAN_AUTH_HEADER; adjusted observability test inputs to use mcp__atlassian__ tool naming.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: switching from a community mcp-atlassian server to the official Jira MCP, which is the primary objective of this PR.
Description check ✅ Passed The description is directly related to the changeset, explaining the migration from community mcp-atlassian to official Atlassian Remote MCP Server, credential handling, and related configuration updates across all modified files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
components/runners/ambient-runner/ambient_runner/bridges/claude/mcp.py (1)

227-234: ⚠️ Potential issue | 🟠 Major

Avoid false-positive auth for atlassian by requiring the new header

Line 227 currently routes atlassian through legacy Jira fallback checks (Lines 231-234). That can report “configured” even when ATLASSIAN_AUTH_HEADER is missing, while the HTTP MCP config still fails auth.

Proposed fix
-    if server_name in ("atlassian", "mcp-atlassian", "jira"):
-        if os.getenv("ATLASSIAN_AUTH_HEADER", "").strip():
-            return True, "Atlassian credentials configured"
+    if server_name == "atlassian":
+        if os.getenv("ATLASSIAN_AUTH_HEADER", "").strip():
+            return True, "Atlassian credentials configured"
+        return False, "Atlassian not configured - missing ATLASSIAN_AUTH_HEADER"
+
+    if server_name in ("mcp-atlassian", "jira"):
+        if os.getenv("ATLASSIAN_AUTH_HEADER", "").strip():
+            return True, "Atlassian credentials configured"

         jira_url = os.getenv("JIRA_URL", "").strip()
         jira_token = os.getenv("JIRA_API_TOKEN", "").strip()
         if jira_url and jira_token:
             return True, "Jira credentials configured"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@components/runners/ambient-runner/ambient_runner/bridges/claude/mcp.py`
around lines 227 - 234, The current check treats server_name == "atlassian" as
satisfied if legacy JIRA env vars (JIRA_URL/JIRA_API_TOKEN) exist, causing a
false-positive; change the logic so that when server_name is "atlassian" (or
"mcp-atlassian"/"jira") you require ATLASSIAN_AUTH_HEADER to be present and
non-empty to return True/"Atlassian credentials configured" and do not fall back
to checking JIRA_URL or JIRA_API_TOKEN for that branch (leave the legacy Jira
fallback only for non-Atlassian server_name cases or remove the fallback
entirely for the Atlassian names).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@components/runners/ambient-runner/ambient_runner/platform/auth.py`:
- Around line 279-299: The ATLASSIAN_AUTH_HEADER can persist from a previous
successful fetch because the current try/except only sets it on the happy path;
change the Jira refresh logic in the block surrounding fetch_jira_credentials so
that when jira_creds lacks email or apiToken you explicitly delete/clear
os.environ["ATLASSIAN_AUTH_HEADER"] (or set it to empty) and also clear it in
the except Exception handler; locate the code around fetch_jira_credentials,
jira_creds, and the ATLASSIAN_AUTH_HEADER assignment to implement these clears
to avoid reusing stale credentials.

---

Outside diff comments:
In `@components/runners/ambient-runner/ambient_runner/bridges/claude/mcp.py`:
- Around line 227-234: The current check treats server_name == "atlassian" as
satisfied if legacy JIRA env vars (JIRA_URL/JIRA_API_TOKEN) exist, causing a
false-positive; change the logic so that when server_name is "atlassian" (or
"mcp-atlassian"/"jira") you require ATLASSIAN_AUTH_HEADER to be present and
non-empty to return True/"Atlassian credentials configured" and do not fall back
to checking JIRA_URL or JIRA_API_TOKEN for that branch (leave the legacy Jira
fallback only for non-Atlassian server_name cases or remove the fallback
entirely for the Atlassian names).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7396e338-6a81-4b4c-930f-0c1c0cfa7e0c

📥 Commits

Reviewing files that changed from the base of the PR and between 6b21778 and f93084c.

📒 Files selected for processing (4)
  • components/runners/ambient-runner/.mcp.json
  • components/runners/ambient-runner/ambient_runner/bridges/claude/mcp.py
  • components/runners/ambient-runner/ambient_runner/platform/auth.py
  • components/runners/ambient-runner/pyproject.toml

@ambient-code ambient-code Bot modified the milestone: Review Queue Mar 24, 2026
@syntaxsdev
syntaxsdev force-pushed the feat/atlassian-remote-mcp branch from 6b63b27 to 5049092 Compare March 24, 2026 17:37

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
components/runners/ambient-runner/ambient_runner/platform/auth.py (1)

325-347: ⚠️ Potential issue | 🟠 Major

ATLASSIAN_AUTH_HEADER lifecycle is still incomplete (stale credential risk).

The header is only managed inside the apiToken branch. If Jira refresh errors or returns no token, an old ATLASSIAN_AUTH_HEADER can persist. Also ensure turn cleanup removes this env var.

Proposed fix
     # Jira / Atlassian credentials
+    os.environ.pop("ATLASSIAN_AUTH_HEADER", None)
     if isinstance(jira_creds, Exception):
         logger.warning(f"Failed to refresh Jira credentials: {jira_creds}")
     elif jira_creds.get("apiToken"):
         os.environ["JIRA_URL"] = jira_creds.get("url", "")
         os.environ["JIRA_API_TOKEN"] = jira_creds.get("apiToken", "")
         os.environ["JIRA_EMAIL"] = jira_creds.get("email", "")
         logger.info("Updated Jira credentials in environment")
@@
         else:
             os.environ.pop("ATLASSIAN_AUTH_HEADER", None)
             logger.info("Cleared ATLASSIAN_AUTH_HEADER: missing email or apiToken")
+    else:
+        logger.info("No Jira apiToken returned; ATLASSIAN_AUTH_HEADER cleared")
 def clear_runtime_credentials() -> None:
@@
     for key in [
         "GITHUB_TOKEN",
         "GITLAB_TOKEN",
         "JIRA_API_TOKEN",
         "JIRA_URL",
         "JIRA_EMAIL",
+        "ATLASSIAN_AUTH_HEADER",
         "USER_GOOGLE_EMAIL",
     ]:

As per coding guidelines, "Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@components/runners/ambient-runner/ambient_runner/platform/auth.py` around
lines 325 - 347, jira_creds handling currently only sets/clears
ATLASSIAN_AUTH_HEADER inside the apiToken branch, leaving a stale
ATLASSIAN_AUTH_HEADER when jira_creds is an Exception or missing apiToken;
update the logic so that whenever jira_creds is an Exception or jira_creds does
not contain an "apiToken" you explicitly os.environ.pop("ATLASSIAN_AUTH_HEADER",
None) and log the action (use the same logger used around jira_creds), and also
add removal of ATLASSIAN_AUTH_HEADER in the turn/cleanup routine (the function
that runs at end of a turn/session—add a single
os.environ.pop("ATLASSIAN_AUTH_HEADER", None) with an info log) so the header is
always cleared on failures and at cleanup; reference jira_creds,
ATLASSIAN_AUTH_HEADER, and the turn cleanup function when making these edits.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@components/runners/ambient-runner/ambient_runner/bridges/claude/mcp.py`:
- Around line 228-230: The current server_name check in the tuple ("atlassian",
"mcp-atlassian", "jira") allows ATLASSIAN_AUTH_HEADER to mark auth successful
for jira and mcp-atlassian; update the condition in the function in mcp.py that
evaluates server_name so that the ATLASSIAN_AUTH_HEADER success path runs only
when server_name == "atlassian" (leave other branches for mcp-atlassian/jira to
use their existing auth checks), and keep the existing
os.getenv("ATLASSIAN_AUTH_HEADER", "").strip() guard and the returned message
"Atlassian credentials configured".

---

Duplicate comments:
In `@components/runners/ambient-runner/ambient_runner/platform/auth.py`:
- Around line 325-347: jira_creds handling currently only sets/clears
ATLASSIAN_AUTH_HEADER inside the apiToken branch, leaving a stale
ATLASSIAN_AUTH_HEADER when jira_creds is an Exception or missing apiToken;
update the logic so that whenever jira_creds is an Exception or jira_creds does
not contain an "apiToken" you explicitly os.environ.pop("ATLASSIAN_AUTH_HEADER",
None) and log the action (use the same logger used around jira_creds), and also
add removal of ATLASSIAN_AUTH_HEADER in the turn/cleanup routine (the function
that runs at end of a turn/session—add a single
os.environ.pop("ATLASSIAN_AUTH_HEADER", None) with an info log) so the header is
always cleared on failures and at cleanup; reference jira_creds,
ATLASSIAN_AUTH_HEADER, and the turn cleanup function when making these edits.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4152ce26-31bd-4eac-bf3a-241eb1e5dbe9

📥 Commits

Reviewing files that changed from the base of the PR and between 6b63b27 and 5049092.

📒 Files selected for processing (6)
  • components/runners/ambient-runner/.mcp.json
  • components/runners/ambient-runner/ambient_runner/bridges/claude/mcp.py
  • components/runners/ambient-runner/ambient_runner/platform/auth.py
  • components/runners/ambient-runner/pyproject.toml
  • components/runners/ambient-runner/tests/test_mcp_auth.py
  • components/runners/ambient-runner/tests/test_observability_metrics.py

Comment on lines +228 to +230
if server_name in ("atlassian", "mcp-atlassian", "jira"):
if os.getenv("ATLASSIAN_AUTH_HEADER", "").strip():
return True, "Atlassian credentials configured"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Limit ATLASSIAN_AUTH_HEADER success path to the atlassian server only.

Right now, jira and mcp-atlassian can be marked authenticated from ATLASSIAN_AUTH_HEADER alone, which can misreport auth readiness for legacy Jira-style configs.

Proposed fix
-    if server_name in ("atlassian", "mcp-atlassian", "jira"):
-        if os.getenv("ATLASSIAN_AUTH_HEADER", "").strip():
-            return True, "Atlassian credentials configured"
+    if server_name == "atlassian":
+        if os.getenv("ATLASSIAN_AUTH_HEADER", "").strip():
+            return True, "Atlassian credentials configured"
+
+    if server_name in ("atlassian", "mcp-atlassian", "jira"):
         jira_url = os.getenv("JIRA_URL", "").strip()
         jira_token = os.getenv("JIRA_API_TOKEN", "").strip()

As per coding guidelines, "Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@components/runners/ambient-runner/ambient_runner/bridges/claude/mcp.py`
around lines 228 - 230, The current server_name check in the tuple ("atlassian",
"mcp-atlassian", "jira") allows ATLASSIAN_AUTH_HEADER to mark auth successful
for jira and mcp-atlassian; update the condition in the function in mcp.py that
evaluates server_name so that the ATLASSIAN_AUTH_HEADER success path runs only
when server_name == "atlassian" (leave other branches for mcp-atlassian/jira to
use their existing auth checks), and keep the existing
os.getenv("ATLASSIAN_AUTH_HEADER", "").strip() guard and the returned message
"Atlassian credentials configured".

@Gkrumbach07

Copy link
Copy Markdown
Contributor

i want to hold this until we test it. have u tested it working in a cluster yet? can u run a workflow for triage and show that. with bug bash rn this might be risky

@ambient-code

ambient-code Bot commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

Review Queue Status

Check Status Detail
CI FAIL test-local-dev-simulation
Conflicts pass ---
Reviews pass ---

Action needed: Fix failing CI checks

Auto-generated by Review Queue workflow. Updated when PR changes.

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.

3 participants