Facing issue while deploying adk agent with Atlassian mcp server with oauth flow #5739
Replies: 2 comments
-
|
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: The error Hello! I can help with this issue. The error you're encountering, In your agent's code, the Recommended Solution for ProductionFor production deployments, the best practice is to create a self-contained, reproducible environment that includes all your agent's dependencies. Containerization with Docker is a standard way to achieve this. You need to modify your # Start from a standard Python base image
FROM python:3.11-slim
# Install Node.js (v20.x in this example) and npm, which includes npx
# This is necessary because McpToolset uses 'npx' to run the MCP server
RUN apt-get update && apt-get install -y curl && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -y nodejs && rm -rf /var/lib/apt/lists/*
# Set up the working directory in the container
WORKDIR /app
# Copy and install your Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of your agent's application code
COPY . .
# Command to run your ADK agent application
# Replace 'your_main_script.py' with the entrypoint to your application
CMD ["python", "your_main_script.py"]By adding the This approach ensures that your deployment environment is properly configured with all the necessary runtime dependencies for your agent and its tools. [2, 3] Citations: |
Beta Was this translation helpful? Give feedback.
-
|
can i use custom docker file for the agent engine deployments? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Code that i have
from google.adk.agents import Agent
from google.adk.tools.mcp_tool import McpToolset
from google.adk.tools.mcp_tool.mcp_session_manager import StdioConnectionParams
from mcp import StdioServerParameters
from google.adk.models import Gemini
from google.genai import types
import os
import google.auth
_, project_id = google.auth.default()
os.environ["GOOGLE_CLOUD_PROJECT"] = project_id
os.environ["GOOGLE_CLOUD_LOCATION"] = "us-central1"
os.environ["GOOGLE_GENAI_USE_VERTEXAI"] = "True"
root_agent = Agent(
model=Gemini(
model="gemini-2.5-flash",
retry_options=types.HttpRetryOptions(attempts=3),
),
name="atlassian_agent",
instruction="""
You are an expert Atlassian assistant with deep knowledge of Confluence and Jira.
You have direct access to the user's Atlassian workspace through MCP tools.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
IDENTITY & ROLE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Confluence (wiki, documentation) and Jira (project management, issue tracking).
page content, issue details, or space names.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CORE CAPABILITIES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CONFLUENCE:
JIRA:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
BEHAVIOR RULES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ALWAYS call the appropriate MCP tool before answering questions about
workspace content — never answer from memory or assumptions.
CLARIFY before acting on destructive or write operations:
SEARCH STRATEGY — when searching:
STRUCTURED OUTPUT — format all responses clearly:
ERROR HANDLING:
PERMISSIONS AWARENESS:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
RESPONSE STYLE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• Title
• Space or Project key
• Last updated date (if available)
• Direct URL or page ID
show specific sections on request.
" Page 'Sprint 22 Notes' created in space ENG."
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CHAIN OF THOUGHT — HOW TO HANDLE REQUESTS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
For every user request, follow this internal reasoning process:
STEP 1 → UNDERSTAND: What is the user asking for?
(search / read / create / update / summarize / report?)
STEP 2 → IDENTIFY: Which product is involved?
(Confluence page? Jira issue? Both?)
STEP 3 → PLAN: Which MCP tool(s) do I need to call?
(list them mentally before calling)
STEP 4 → EXECUTE: Call the tool(s) with correct parameters.
STEP 5 → VALIDATE: Did I get useful results?
(if not, retry with refined parameters)
STEP 6 → RESPOND: Present results clearly using the response style rules above.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EXAMPLES OF GOOD RESPONSES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
User: "find pages about deployment"
DO: Call confluence_search("deployment"), return top results with titles,
spaces, and URLs. Offer to open any specific page.
DON'T: Answer from memory about what deployment pages "usually contain".
User: "create a page for today's standup"
DO: Ask — "Which space should I create it in, and would you like me to use
a standup template (Date / Attendees / Updates / Blockers)?"
DON'T: Create the page immediately without confirming space and content.
User: "what tickets are blocking the release?"
DO: Search Jira for issues with label "blocker" or status "In Progress" in
the relevant project. Ask for project key if not specified.
DON'T: Guess which tickets are blockers without querying Jira.
""",
tools=[
McpToolset(
connection_params=StdioConnectionParams(
server_params=StdioServerParameters(
command="npx",
args=[
"-y",
"mcp-remote",
"https://mcp.atlassian.com/v1/mcp",
]
),
timeout=940,
),
)
],
)
Issue i am getting:-
n plain English. - Suggest an alternative approach or ask the user to …
DEFAULT 2026-05-18T07:05:52.244366216Z {"content":{…}}
DEFAULT 2026-05-18T07:05:52.245212Z [13] INFO: AFC is enabled with max remote calls: 10.
DEFAULT 2026-05-18T07:05:53.273819198Z {"content":{…}, "finish_reason":"STOP", "index":0}
DEFAULT 2026-05-18T07:05:53.275119Z [13] INFO: Response received from the model.
DEFAULT 2026-05-18T07:05:53.282295Z [13] WARNING: Error on session runner task: [Errno 2] No such file or directory: 'npx'
DEFAULT 2026-05-18T07:05:53.282309Z [13] INFO: Retrying get_tools due to error: Failed to create MCP session: Failed to create MCP session: [Errno 2] No such file or directory: 'npx'
DEFAULT 2026-05-18T07:05:53.282315Z [13] WARNING: Error on session runner task: [Errno 2] No such file or directory: 'npx'
DEFAULT 2026-05-18T07:05:53.282320Z [13] WARNING: Failed to get tools from toolset McpToolset: Failed to create MCP session: Failed to create MCP session: [Errno 2] No such file or directory: 'npx'
DEFAULT 2026-05-18T07:05:58.961466Z [13] INFO: 169.254.169.126:13772 - "POST /api/stream_reasoning_engine HTTP/1.1" 200 OK
DEFAULT 2026-05-18T07:05:59.208696Z [13] WARNING: Error on session runner task: [Errno 2] No such file or directory: 'npx'
DEFAULT 2026-05-18T07:05:59.208756Z [13] INFO: Retrying get_tools due to error: Failed to create MCP session: Failed to create MCP session: [Errno 2] No such file or directory: 'npx'
DEFAULT 2026-05-18T07:05:59.209870Z [13] WARNING: Error on session runner task: [Errno 2] No such file or directory: 'npx'
DEFAULT 2026-05-18T07:05:59.210164Z [13] WARNING: Failed to get tools from toolset McpToolset: Failed to create MCP session: Failed to create MCP session: [Errno 2] No such file or directory: 'npx'
DEFAULT 2026-05-18T07:05:59.210975Z [13] INFO: Sending out request, model: gemini-2.5-flash, backend: GoogleLLMVariant.VERTEX_AI, stream: False
What is the recommended way to resolve this in production deployments?
Beta Was this translation helpful? Give feedback.
All reactions